Back to Projects
C++20CMakeGoogle TestHFTSystems Programming
NanoMatch
NanoMatch is a high-performance limit order book and matching engine built in modern C++20. It simulates a financial exchange's core operations, processing buy/sell orders with price-time priority matching at millions of operations per second.
01. Problem
Financial exchanges require ultra-low-latency order matching. Understanding how matching engines work at the systems level demands building one from scratch with real performance constraints.
02. Solution Overview
- Implemented price-time priority (FIFO) matching with support for Limit, Market, IOC, and FOK orders
- Designed O(1) order cancellation and modification using hash map indexing
- Built a custom pool allocator to eliminate heap allocation overhead on the hot path
- Added multi-instrument support with independent order books per symbol
Build
Tech Stack
C++20CMake 3.20+Google Test 1.17GitHub Actions CI/CDAddressSanitizerUBSan
- • Price-time priority (FIFO) matching algorithm
- • 4 order types: Limit, Market, IOC, Fill-or-Kill
- • O(1) order cancellation/modification via hash map
- • Custom pool allocator eliminating heap allocation overhead
Secure
- AddressSanitizer and UndefinedBehaviorSanitizer in CI
- 60+ unit tests across 18 test suites
- cppcheck static analysis on every push
- No external runtime dependencies
03. Proof & Verification
Verified Claims
- >Throughput: 9.29M ops/sec on benchmarks
- >Latency: 84ns p50, sub-microsecond p99
- >60+ unit tests across 18 test suites — all passing
- >CI: ASan, UBSan, cppcheck, clang-format on every push