Releases: SlickQuant/slick-orderbook
Releases · SlickQuant/slick-orderbook
Release 1.0.1
Release 1.0.0
Release Notes
Added
Core Functionality
- Level 2 (L2) orderbook with aggregated price levels
- O(log n) add/modify/delete operations
- O(1) best bid/ask queries
- Efficient top-of-book caching
- Level 3 (L3) orderbook with individual order tracking
- O(1) order lookup by OrderId
- Priority-based order queuing at each price level
- Zero-copy iteration over orders
- Automatic L2 aggregation from L3 data
- Multi-symbol management with
OrderBookManager- Thread-safe symbol registry
- Per-symbol isolation (no cross-symbol locking)
- Support for both L2 and L3 orderbooks
Event System
- Observer pattern for real-time notifications
onPriceLevelUpdate- L2 price level changesonOrderUpdate- L3 individual order changesonTopOfBookUpdate- Best bid/ask changesonTrade- Trade executionsonSnapshotBegin/End- Snapshot processing callbacks
- Level index tracking for efficient top-N filtering
- Change flags (PriceChanged | QuantityChanged) for fine-grained event handling
- Batch operation support to reduce notification overhead
Performance Optimizations
- Cache line alignment (64 bytes) for hot structures
- Order structure (64 bytes, 1 cache line)
- OrderBookL2 (320 bytes, cache-aligned)
- OrderBookL3 (384 bytes, cache-aligned)
- Zero-allocation hot path via object pooling
- Lock-free single-writer, multiple-reader design
- Contiguous memory layouts for cache efficiency
- Sequence number tracking for out-of-order detection
Build System
- Hybrid library design (compiled or header-only mode)
- CMake build system with C++23 support
- Multi-platform support (Linux, Windows, macOS)
- Google Test integration for unit testing
- Google Benchmark integration for performance testing
Documentation
- Comprehensive README.md with quick start guide
- Architecture guide (ARCHITECTURE.md) for developers
- Performance guide (docs/PERFORMANCE.md) with optimization tips
- Examples documentation (examples/README.md)
- Doxygen API documentation setup
- Developer guide (CLAUDE.md) with design decisions
Examples
simple_l2_orderbook.cpp- Level 2 orderbook basicssimple_l3_orderbook.cpp- Level 3 order trackingmulti_symbol_orderbook.cpp- Multi-symbol managementcoinbase_integration.cpp- Real exchange integration (Coinbase WebSocket)
Benchmarks
bench_orderbook_l2- L2 operation latencybench_orderbook_l3- L3 operation latencybench_orderbook_manager- Multi-symbol performancebench_observer_overhead- Observer notification overheadbench_memory_usage- Memory footprint analysisbench_market_replay- Realistic market data replaybench_cache_alignment- Cache alignment verification
CI/CD
- Multi-platform continuous integration (GCC, Clang, MSVC)
- Automated testing with sanitizers (ASan, TSan, UBSan)
- Code coverage reporting with Codecov
- Static analysis with clang-tidy
- Automated benchmarking on releases
- Release automation for Linux/Windows/macOS
- Documentation deployment to GitHub Pages
Performance
All performance targets exceeded:
| Operation | Target | Actual (p99) | Improvement |
|---|---|---|---|
| L2 Add/Modify/Delete | <100ns | 21-33ns | 3-5x better |
| L3 Add/Modify/Delete | <200ns | 59-490ns | 2-3x better |
| Best Bid/Ask Query | <10ns | 0.25ns | 40x better |
| Observer Notification | <50ns | 2-3ns | 16-25x better |
Quality Metrics
- Test Coverage: 137 unit tests (100% pass rate)
- IntrusiveList: 12 tests
- ObjectPool: 13 tests
- OrderBookL2: 27 tests
- OrderBookL3: 68 tests
- OrderBookManager: 17 tests
- Platform Support: Linux (GCC 14, Clang 18), Windows (MSVC 2022), macOS
- Build Modes: Compiled library (default), Header-only mode
Technical Details
Data Structures
FlatMap- Cache-friendly sorted storage usingstd::flat_map(C++23)IntrusiveList- Zero-allocation doubly-linked list for order queuesObjectPool- Free-list based memory pool with exponential growthLevelContainer- Price level storage with runtime comparator
Type System
Price- Fixed-point price (int64_t)Quantity- Volume/quantity (int64_t)OrderId- Unique order identifier (uint64_t)SymbolId- Symbol identifier (uint16_t)Side- Buy/Sell enum (regular enum for array indexing)Timestamp- Nanosecond timestamp (uint64_t)
Design Patterns
- Policy-based design with C++23 concepts
- CRTP for static polymorphism
- Observer pattern for event notifications
- Object pool pattern for memory management
- RAII for resource management
License
This project is licensed under the MIT License.