dcrdex icon indicating copy to clipboard operation
dcrdex copied to clipboard

mm: bot should account for orders-to-be-canceled during calculating allocations

Open norwnd opened this issue 11 months ago • 0 comments

When I have open orders on some market (be it manually placed orders, or MM-bot placed orders from my past run when I didn't explicitly stop MM bot so it cancels those orders) and I start MM bot for that same market - MM bot will cancel those orders.

That's fine, the issue is MM bot calculates its allocations (both, Balance required to fund orders and Fee reserves) before cancelling those orders looks like (or as if funds will stay locked in those orders, even though these funds are shortly released due to cancels MM bot issues). This means bot thinks he has less funds (and fee reserves) to work with than what he actually could/should use.

I guess the solution would be for MM bot to wait until all cancels he issued succeed (releasing all the funds on the market he'll be operating on) and only then initialize his market-making projections & start acting on these.

the issue is MM bot calculates its allocations (both, Balance required to fund orders and Fee reserves) before cancelling those orders looks like

I should note it might not reproduce every time, so maybe there is a race condition(s) that needs to be resolved.

norwnd avatar Jan 19 '25 12:01 norwnd