CLOB-Sync
A synchronous, high-performance Central Limit Order Book implementation in Rust featuring an in-memory architecture with zero-cost abstractions and type-safe financial primitives for ultra-low latency trading applications.
Central Limit Order Book
A Central Limit Order Book (CLOB) is composed of two priority queues: asks (limit sell orders ordered low to high) and bids (limit buy orders ordered high to low). Orders at the same price are FIFO.
Price
^
| +---------+
| | $102 C | ← Worst Ask
| | $101 B |
| | $100 A | ← Best Ask (lowest)
| +---------+
| spread
| +---------+
| | $99 X | ← Best Bid (highest)
| | $98 Y |
| | $97 Z | ← Worst Bid
| +---------+
+--------------------------> Quantity
Order Behavior
- Limit orders: Not allowed to cross spread (buy price >= best ask, sell price <= best bid). Rests on book otherwise.
- Market orders: Execute immediately at best price. Partial fills when liquidity insufficient.
Installation
Add this to your Cargo.toml:
[]
= "0.1.2"
Or use cargo add:
Development
Main development tasks are executed as a result of git commit and git push operations.
Commit messages are validated during commit-msg phase of git hook and must be compatible with Conventional Commits.
License
This project is licensed under the GNU Affero General Public License v3.0. See the LICENSE file for details.