This fixes a bug in the logic to calculate whether a request to place a new order exceeds the available capacity and trading limits by properly accounting for the quantity that is being replaced by the new order request. Previously, this was not accounted for and attempting to replace an order, even if not changing quantity, could result in an error due to exceeding the trading capacity.
Closes #1999.
I'm still working on some tests to cover this case but figured I'd open the PR for testing/review so we can get this merged soon.
This fixes a bug in the logic to calculate whether a request to place a new order exceeds the available capacity and trading limits by properly accounting for the quantity that is being replaced by the new order request. Previously, this was not accounted for and attempting to replace an order, even if not changing quantity, could result in an error due to exceeding the trading capacity.
Closes #1999.
I'm still working on some tests to cover this case but figured I'd open the PR for testing/review so we can get this merged soon.