https://github.com/brettfazio/orderbook
Port of www.quantcup.org (implementing a fast stock exchange matching engine) from C to Rust
https://github.com/brettfazio/orderbook
matching-engine optimization rust
Last synced: 2 months ago
JSON representation
Port of www.quantcup.org (implementing a fast stock exchange matching engine) from C to Rust
- Host: GitHub
- URL: https://github.com/brettfazio/orderbook
- Owner: brettfazio
- Created: 2021-05-04T22:11:27.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-30T23:08:24.000Z (about 4 years ago)
- Last Synced: 2025-03-28T13:21:44.559Z (3 months ago)
- Topics: matching-engine, optimization, rust
- Language: C
- Homepage:
- Size: 616 KB
- Stars: 15
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rust Order Book
`rust-quantcup` (renamed `orderbook` for brevity) is a reimplementation of Quantcup.org's matching engine and order book in Rust. It attempts to make use of Rust language features at the implementation level as well as the project level (using `cargo test` and `cargo bench` for testing and scoring the matching engine).
`engine.rs` provides a baseline naive implementation of the machine engine akin to that of the original C quantcup code. The goal would be to optimize this matching engine.
The baseline quantcup code from Quantcup.org is also provide (though it has been modified to use C++ instead of C).
While there is no official leaderboard or competition like the original QuantCup, a way to participate here would be to fork the repo, edit `engine.rs` and try to get the best bench score possible.
## Modification
`engine.rs` should be the main location for modification and optimization.
## Testing
To test your matching engine simply run:
```
cd source
cargo test
```This will run the unit tests in `src/engine/test.rs`.
## Scoring
To score your program go into the `source` directory like before and run
```
cargo bench
```This will benchmark your code using the `score_feed.csv` as the order flow and the matching engine implemented in `engine.rs`.
## Contribution
PRs are welcome either adding additional novel matching engines to the examples or improving the base running/scoring code itself.