Skip to content
New issue

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

Implement handleMarketSellOrder #2

Open
ssonthal opened this issue Oct 24, 2024 · 0 comments
Open

Implement handleMarketSellOrder #2

ssonthal opened this issue Oct 24, 2024 · 0 comments
Assignees

Comments

@ssonthal
Copy link
Owner

Steps involved:

  1. Get all open buy orders from in-memory order book.
  2. Sort them in descending order (willingness to pay -> highest to lowest).
  3. If buyOrder's qty <= sellOrderQty => remove order from orderbook.
  4. If buyOrder's qty > sellOrderQty => find valid buyers (FIFO) and remove them from the stakeholders' list. Decrement the qty of the order by sellOrderQty.
  5. Execute buy and sell orders for the users.
@ssonthal ssonthal self-assigned this Oct 24, 2024
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

No branches or pull requests

1 participant