// the find
joaquinbejar/OrderBook-rs
A high-performance, thread-safe limit order book implementation written in Rust. This project provides a comprehensive order matching engine designed for low-latency trading systems, with a focus on concurrent access patterns and lock-free data structures.
A limit order book engine in Rust with price-time priority matching, covering the full order lifecycle from submission through cancellation and fills. It targets HFT and exchange simulation use cases. The feature set is unusually complete for an open-source project: STP modes, iceberg/GTD/pegged/trailing-stop orders, a kill switch, pre-trade risk gates, NATS JetStream publishing, a journaled sequencer with replay, and Prometheus metrics.
The DashMap + SegQueue hybrid for PriceLevel storage is a real improvement — O(1) order lookup by ID without draining the entire queue, which was the classic Rust FIFO-book footgun. The Clock trait abstraction means deterministic replay actually works in tests rather than being aspirational. Feature flags are well-scoped: wire protocol, bincode, alloc counters, and metrics are all off by default so you don't pay for what you don't use. The HDR histogram bench suite with p99.9/p99.99 reporting is the right tool for latency work — Criterion means can miss tail behavior entirely.
The hot-spot contention numbers in the README are backwards — throughput increasing 7x as 100% of operations concentrate on one price level suggests the benchmark is measuring lock acquisition on an uncontested path, not real contention. That's a benchmark design problem, not a performance win, and it should make you skeptical of the other numbers. The implied volatility module shipping inside an order book crate is odd scope creep with no explanation of why it belongs here rather than a separate crate. Snapshot format version is at 2 but v0.7.0 introduced multiple breaking changes to `RejectReason` and `OrderStatus` — the versioning story for rolling upgrades in production is underdocumented. The async Sequencer runtime is still listed as under development, which means the NATS/journal path is not yet usable end-to-end for anyone building a real exchange.