ExchangeUnion / xud

Exchange Union Daemon 🔁 ⚡️
https://exchangeunion.com
GNU Affero General Public License v3.0
115 stars 49 forks source link

fix: limits account for replaced order quantity #2002

Closed sangaman closed 3 years ago

sangaman commented 3 years ago

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.