We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
orderbook-rs/src/engine/orderbook.rs
Line 246 in 3210aa9
Imagine 10.000 ask limit orders with qty = 1 and the same "best" price, say 1.
qty = 1
price
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.
Use a non-recursive loop: pull the best opposite order, fill it fully, and partially fill the big order.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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
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.
The text was updated successfully, but these errors were encountered: