An ultra-low-latency High-Frequency Trading (HFT) matching engine built in Rust with Python (PyO3) bindings. Features zero-allocation hot paths (O(1) cancellation, 182ns matching), a realistic Gymnasium RL environment for training market-making agents, and a live terminal L2 orderbook dashboard.
# run rust tests
cargo test --lib
cargo test --tests
# setup python
python3 -m venv .venv && source .venv/bin/activate
pip install maturin pytest
maturin develop
# run python tests
pytest tests/ -v
# run example
python example/basic_usage.py
# live dashboard
python -m matching_enegine.dashboard
# rl example
python example/rl_training/train_ppo.py
python example/rl_training/train_grpo.py