Low-latency trading engine with a Python market-data pipeline and a live web UI.
- C++ limit-order-book core with pluggable strategies
- Python websocket ingest and normalization pipeline
- Bridge ingress from Python to C++ (Unix socket IPC + in-process fallback)
- Optional WebSocket server + dashboard
- CMake 3.16+
- C++20 compiler (GCC/Clang)
- Python 3.10+ (for the market-data pipeline)
- Node.js 18+ (optional, for local web dashboard development)
Linux/macOS is recommended because the engine/pipeline bridge uses Unix-domain sockets.
Live UI: Order Book, Trade Flow, Latency Metrics, and Strategy Signals.
- Build:
cmake -S . -B build cmake --build build - Terminal A: start the engine (WebUI mode):
./build/quantumflow \ --symbols BTC-USDT-SWAP,ETH-USDT-SWAP \ --ws-port 9001 \ --bridge-socket /tmp/quantumflow_bridge.sock \ --pipeline-control-socket /tmp/quantumflow_pipeline_ctrl.sock
- Terminal B: start the Python pipeline and push into the C++ engine:
python3 -m pip install -r pipeline/requirements.txt cd pipeline PYTHONPATH=. python3 -m src.app \ --symbols BTC-USDT-SWAP,ETH-USDT-SWAP \ --channels books5,trades \ --cpp-bridge \ --bridge-socket /tmp/quantumflow_bridge.sock \ --control-socket /tmp/quantumflow_pipeline_ctrl.sock - Terminal C (optional): run the React dashboard:
Then open
cd web npm install npm run devhttp://localhost:5173(the app connects tows://localhost:9001).
- Start
quantumflowfirst. - Start the Python pipeline with
--cpp-bridge. - View metrics/order book/trades in the web app.
- Use the symbol selector in the UI to request runtime symbol changes (sent through the control socket).
./build/quantumflow --headless --symbols BTC-USDT-SWAP,ETH-USDT-SWAPThis keeps the strategy/LOB engine running without the WebSocket broadcast/UI loop.
make build # Configure + build C++ engine
make configure-bridge # Configure with bridge ON (updates compile_commands for bridge C file)
make build-bridge # Build with bridge ON
make run-engine # Run engine (WebUI mode + bridge sockets)
make pipeline-run # Create venv, install deps, run pipeline with --cpp-bridge
make web # Start web dashboard dev server
make test # Run C++ tests
make headless # Build headless configuration--symbols BTC-USDT-SWAP,ETH-USDT-SWAPcomma-separated instruments--headlessdisable WebUI broadcasting--ws-port 9001WebSocket server port for UI clients--bridge-socket /tmp/quantumflow_bridge.sockPython->C++ ingress socket--pipeline-control-socket /tmp/quantumflow_pipeline_ctrl.sockruntime symbol control socket
For C/C++ editor diagnostics (for example in VS Code), this repo uses
compile_commands.json at the project root (symlink to build/compile_commands.json).
If you see include-path squiggles, regenerate it by reconfiguring:
make configureIf you need IntelliSense for the bridge C API translation unit
(bridge/quantumflow_uds_bridge_capi.c), configure with bridge enabled:
make configure-bridgequantumflow/
├── main.cpp # C++ engine entrypoint
├── CMakeLists.txt # Build configuration
├── Makefile # Common dev/build/run commands
├── bridge/ # Python -> C++ ingress bridge
├── common/ # Shared C++ data models/utilities
├── orderbook/ # Limit order book core + tests/bench
├── pipeline/ # Python market-data ingest/normalize/sinks
├── strategies/ # Strategy interfaces + implementations
├── ws/ # C++ WebSocket server + JSON serializers
├── web/ # React/Tailwind dashboard
├── tests/ # C++ unit tests (engine/bridge/strategies)
├── third_party/ # Dependency setup via CMake FetchContent
├── graphics/
│ └── include/memory/allocator.h # Shared allocator utilities
└── screenshot/ # README/UI assets