Order Allocation in Memory Pool
Execution State
The order acquires a preallocated pointer from the contiguous OrderPool free list. No OS memory allocator primitive (malloc/new) is invoked.
Maintains direct mappings from OrderID ➔ PriceLevel Iterator to enable constant-time cancellation without scanning.
| Price ($) | Aggregated Vol | Orders | Depth Visual | Action |
|---|
High-Throughput Ingestion Benchmark
Continuous execution test processing 1,000,000 synthetic multi-threaded limit, market, and cancellation orders through the ingestion pipeline.
Architectural Specification: High-Frequency In-Memory Matching Engine
Mathematical models and systems design principles for ultra-low latency determinism in modern C++.
1. Fixed-Point Decimal Quantization ($\mathcal{Q}$)
Under IEEE-754 floating-point arithmetic, decimal representations accumulate non-deterministic rounding errors ($0.1 + 0.2 \neq 0.3$). Prices are mathematically projected onto scaled 64-bit signed integers:
Reconstruction mapping and bounded precision error:
Enforces deterministic integer comparisons across all CPU microarchitectures.
2. Price-Time Priority Strict Ordering Relation ($\succ$)
For any two orders $O_i = (P_i, t_i, q_i)$ and $O_j = (P_j, t_j, q_j)$ submitted to the engine:
Enforced using sorted Red-Black Trees (std::map) nested with FIFO doubly-linked lists (std::list).
3. Continuous Double Auction Crossing Invariant
Let $P_{\text{bid}}^* = \max_{B \in \mathcal{B}} P(B)$ and $P_{\text{ask}}^* = \min_{A \in \mathcal{A}} P(A)$. A continuous trade execution is triggered if and only if the bid-ask spread crosses:
Execution price is strictly determined by the resting maker order.
4. Inverted Hash Index Table $\mathcal{O}(1)$ Cancellation
Direct hash-indexed iterator dereferencing eliminates tree traversal latency:
Eliminates the $\mathcal{O}(N)$ or $\mathcal{O}(\log N)$ cancellation bottleneck in high-frequency trading.