Skip to content

fix: correct match handler to update order sizes properly (closes #278)#490

Open
botbikamordehai2-sketch wants to merge 1 commit into
danpaquin:masterfrom
botbikamordehai2-sketch:fix/issue-278-1779954071
Open

fix: correct match handler to update order sizes properly (closes #278)#490
botbikamordehai2-sketch wants to merge 1 commit into
danpaquin:masterfrom
botbikamordehai2-sketch:fix/issue-278-1779954071

Conversation

@botbikamordehai2-sketch
Copy link
Copy Markdown

What

The match method in order_book.py was incomplete and did not properly update the size of resting (maker) orders when a trade occurred. This caused the order book to show incorrect/stale sizes for orders that had been partially filled.

Fix

Implemented the match method to find the maker order by maker_order_id at the matched price level and subtract the matched size from it. If the resulting size is zero or negative, the order is removed from the book.

Closes #278

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Order Book gives wrong size

1 participant