Select a document from the sidebar to start reading.
A production-grade C++ matching engine built in four phases. From a correct in-memory core to a hardware-pinned, nanosecond-latency networked exchange.
This is a faithful JavaScript implementation of the C++ matching engine running in your browser. Price-time priority, partial fills, cancellations — all exact.
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.
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.
| Slot | Order ID | Side | Price | Qty | Prev Slot | Next Slot |
|---|