Single-Threaded · C++17 · Linux epoll

Limit Order Book
Matching Engine

A production-grade C++ matching engine built in four phases. From a correct in-memory core to a hardware-pinned, nanosecond-latency networked exchange.

Simulation Note: The interactive widgets below are a pure JavaScript implementation of the engine logic for visualization. To run the actual engine with true nanosecond latency and zero-allocation guarantees, clone and compile the C++ codebase.
<3μsMedian Latency
1MPre-allocated Slots
14BWire Protocol
0Heap Allocs on Hot Path

Interactive Demo

This is a faithful JavaScript implementation of the C++ matching engine running in your browser. Price-time priority, partial fills, cancellations — all exact.

Place Order

Auto Simulation

600ms

Order Book Ladder

LIVE
BID QTY PRICE ASK QTY
Spread: —

Execution Tape

Memory Pool State

The engine pre-allocates one million OrderNode slots at startup. Every order allocation and deallocation is an O(1) array index operation — no OS heap calls on the hot path.

Pool Statistics

Used Slots 0%
0
1,000,000
0
Free List Head Pointer

Occupied Slots

The physical indices shown are the actual array positions in the one-million-element arena that currently hold live orders. When an order is cancelled the slot returns to the free-list head and will be handed out first on the next allocation.

Node Data — Raw OrderNode Structs

Every resting order is stored as an OrderNode in the pool arena. The prev_idx and next_idx fields form the doubly linked list that encodes time priority at each price level.

Active Nodes (first 10)

LIVE
Slot Order ID Side Price Qty Prev Slot Next Slot
No active resting orders. Place an order above.
Select a document from the sidebar to start reading.