-
Notifications
You must be signed in to change notification settings - Fork 112
Open
Description
Overview
Thanks for this repo. It's a great exercise on the orderbooks. Taking a look for inspiration.
I know you're not going to maintain it. Just thought it would be a good idea to share ideas for potential contributors.
Recursive partial matchmaking
orderbook-rs/src/engine/orderbook.rs
Line 246 in 3210aa9
| self.process_market_order( |
Potential stack overflow
Imagine 10.000 ask limit orders with qty = 1 and the same "best" price, say 1.
Then a bid market order with qty = 10.000 and price 1, too.
To fulfill the bid, all 10.000 need to be executed. I haven't run the example, but I guess a stack overflow error will be thrown in runtime.
Solution
Use a non-recursive loop: pull the best opposite order, fill it fully, and partially fill the big order.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels