Engine and benchmarks
How the matching engine is built and how its speed is measured. Live figures from the running engine are on the home page.
VerifyEIP-712 recover and account checks before a command enters the queue.
SequenceThe market's thread numbers the command.
MatchPrice-time book, fills at the maker's price.
LogCommand and events appended to the hash chain.
SettleFills grouped into the next numbered batch.
Design
The engine is written in Rust. Each market runs on its own thread with its own book and log, so markets never contend. Matching is deterministic: the same commands in the same order always produce the same events and the same log hash. Anything time-based, such as expiry, is decided before a command reaches the book.
Method
Benchmarks use criterion. The suite is in the engine's benches/matcher.rs:
cargo bench --bench matcherResults
| Bench | What it measures | Result (one core) |
|---|---|---|
rest | Rest a limit order on an empty level | 51.1 ns |
cancel | Cancel a resting order | 121.2 ns |
take_1 | Take one resting order | 86.2 ns |
sweep_5_levels | Sweep five price levels | 5,506.5 ns |
mixed | Mixed flow, book only | 18,467,000 orders/s |
mixed_with_log | Mixed flow with the hash-chained log | 2,383,000 orders/s |
verify | EIP-712 recover of one order | 39.5 µs |