How Rust Powers a Low-Latency Matching Engine With No GC Pauses
A team at amBrain has detailed the architecture of a spot exchange matching engine built in Rust, designed to run on MOEX colocation infrastructure. The engine processes orders under strict price-time priority, ensuring deterministic replay, correct partial-fill queue placement, and consistent low-latency performance even during traffic bursts. Order book levels are structured as integer-price-indexed FIFO queues, with orders stored in a preallocated slab and referenced by index handles to avoid memory movement or scanning. Cancels and replaces are resolved via direct lookup using client order IDs, making deep-book operations as fast as top-of-book ones. The design avoids garbage collection pauses entirely, with the team reporting market data delivery under 5 ms and pre-trade risk checks completing in under 1 ms on live trading paths.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in