Andrew Dao
All work
03

Limit order book in C++

[One sentence: what the engine does, what it matches, and what you were optimising for.]

RoleSolo · personal project
Timeline[Duration, 2024]
Throughput[N orders/sec]
StackC++[ 20 · CMake · Catch2]

The problem

[Two paragraphs. Why you built it: what you wanted to understand about matching engines that reading about them would not teach you.]

[What made it hard. Price-time priority is simple to state and unforgiving to implement — cancels, partial fills, and self-trade prevention are where naive designs fall over. Say which data structure you chose for the book and what you rejected.]

What I built

Intake[Order parsing]
[Validation]
Book[Price levels]
[FIFO queues per level]
[O(1) best bid/ask]
Match[Price-time priority]
[Partial fills]
[Cancel / replace]
Out[Executions]
[Book snapshots]

[Walk through the data structure. Why a sorted map of price levels with intrusive lists, or whatever you actually chose. Where the cache misses were, and what you did about them. How you convinced yourself the matching logic was correct.]

// A short excerpt of the hot path is worth more here than prose.

Results

[N ns][median add-order latency]
[N/sec][sustained throughput in the benchmark]
[N][test cases, or a correctness property you verified]

What I'd do differently

[One honest paragraph. For this project, a good answer is often about benchmarking methodology rather than the code.]

Next projectAlternative data pipeline