Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

L3 Matching Engine and Alpha Pipeline

C++20 implementation of a Level 3 limit order book, NASDAQ ITCH 5.0 parser, lock-free telemetry path, online VPIN/imbalance/micro-price signals, an adaptive Avellaneda-Stoikov market-making simulator, and a quote-level risk gate.

The hot path avoids heap allocation by using fixed-capacity, cache-line-aligned data structures:

  • FixedSlabPool<T, N> owns order nodes in pre-linked 64-byte chunks.
  • LockFreeSPSC<T, N> moves engine events to the alpha thread using atomic head/tail sequences.
  • The L3 book uses intrusive FIFO queues per price level plus fixed open-addressed tables for order and price lookup.
  • RiskController evaluates quote permissions and sizes from inventory, notional, drawdown, and VPIN toxicity state.

Build

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
ctest --test-dir build --output-on-failure

The default compiler flags include -O3, -march=native, -fno-exceptions, and -fno-rtti on GCC/Clang-compatible compilers.

Tests

The project always builds a dependency-free CTest harness. If GTest is installed, CMake also builds the matching_engine_gtests target.

ctest --test-dir build --output-on-failure

CI installs GTest and configures with MATCHING_ENGINE_REQUIRE_GTEST=ON, so the richer GoogleTest suite is required on GitHub Actions.

Run

./build/matching_engine
./build/engine_bench

If Google Benchmark is installed, the benchmark target links against it. Otherwise it builds a standalone latency harness that reports median, p99, and throughput for hot FIFO fills, add/cancel churn, ITCH decode, and alpha quote/risk generation.

More detail:

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages