Closed ArjunVachhani closed 4 years ago
It's ok to cancel expired good till date order during AddOrder, as far as it is deterministic. Actually MatchingEngine should not have a dependency on any non-deterministic function/type. ITimeProvider is non-deterministic. instead of passing ITimeProvider to the constructor of MatchingEngine. the timestamp should be passed when adding a new order.
Add order cancels expired good till date orders before executing incoming order. This behavior makes add order method non deterministic. All the methods should be deterministic this may help in replication/high availability implementation.