Skip to content

Improve Orderbook management#1

Merged
auralshin merged 4 commits intomainfrom
dev
Oct 5, 2025
Merged

Improve Orderbook management#1
auralshin merged 4 commits intomainfrom
dev

Conversation

@auralshin
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings October 4, 2025 07:50
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the orderbook implementation with Time in Force (TIF) support and Self-Trade Prevention (STP), improving the matching engine's functionality and control.

  • Adds support for TIF types (GTC, IOC, FOK) to control order lifetime and execution behavior
  • Implements STP functionality to prevent self-trading by the same owner
  • Refactors matching algorithms to handle owner-based order filtering and improved price-time priority

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/models/mod.rs Extends Order struct with owner_id, tif, post_only, and max_slippage_bps fields; adds Tif enum
src/order_book/mod.rs Implements TIF logic, STP prevention, refactors matching algorithms, and adds comprehensive test coverage

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

- Added Ord, PartialOrd, PartialEq, and Eq implementations for the Price struct to enable proper comparison based on integral and fractional values.
- Created a new test suite for the OrderBook, covering various scenarios including adding limit orders, matching orders, handling market orders, and ensuring proper order cancellation.
- Included tests for edge cases such as partial fills, FIFO behavior within price levels, and the behavior of different order types (GTC, IOC, FOK).
- Verified that the notifier broadcasts matches correctly and that the order book maintains expected states after operations.
@auralshin auralshin requested a review from Copilot October 4, 2025 08:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@auralshin auralshin merged commit cb80491 into main Oct 5, 2025
1 check passed
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.

2 participants