A low-latency Limit Order Book (LOB) implementation designed for high-frequency trading simulations.
Screen.Recording.2026-01-10.at.1.36.24.AM.mov
Tested on MacBook Air (Apple Silicon):
- Average Latency: 1.21 microseconds/order
- Throughput: ~800000 orders/sec
- Matching Engine: Standard Price-Time priority (FIFO) matching logic.
- Data Structures:
std::map(Red-Black Tree) for ordered price levels;std::vectorfor order queues. - Live Feed: Integrated Python adapter to stream real-time Binance BTC/USDT market depth.
- Optimization: Uses fixed-point arithmetic (integers) to avoid floating-point errors and latency.
1. Live Trading Simulation: This script fetches data from Binance and updates the book in real-time.
chmod +x run_live.sh
./run_live.sh