Quickstart¶
Build FLOX and run the demo application in 5 minutes.
1. Clone and Build¶
git clone https://github.com/FLOX-Foundation/flox.git
cd flox
mkdir build && cd build
cmake .. -DFLOX_ENABLE_DEMO=ON
make -j$(nproc)
2. Run the Demo¶
The demo runs for 30 seconds, then prints latency statistics:
[demo] price spike starting
[demo] price spike starting
demo finished
=== Latency Report ===
BusPublish: p50=123ns p99=456ns max=1.2µs
StrategyOnTrade: p50=89ns p99=234ns max=890ns
3. What the Demo Does¶
The demo creates a complete trading system:
┌─────────────┐ ┌───────────┐ ┌──────────────┐
│ DemoConnector│────▶│ TradeBus │────▶│ DemoStrategy │
│ (generates │ │ BookBus │ │ (reacts to │
│ fake data) │ └───────────┘ │ trades) │
└─────────────┘ └──────────────┘
│
▼
┌──────────────┐
│ ExecutionBus │
└──────────────┘
- DemoConnector generates fake trades and order book updates
- Events flow through TradeBus and BookUpdateBus (Disruptor-style ring buffers)
- DemoStrategy receives events and submits orders
- Orders flow through OrderExecutionBus to an execution tracker
4. Build Options¶
| Option | Default | Description |
|---|---|---|
FLOX_ENABLE_DEMO |
OFF | Build the demo application |
FLOX_ENABLE_TESTS |
OFF | Build unit tests |
FLOX_ENABLE_BENCHMARKS |
OFF | Build performance benchmarks |
FLOX_ENABLE_LZ4 |
OFF | Enable LZ4 compression for replay |
FLOX_ENABLE_CPU_AFFINITY |
OFF | Enable CPU pinning (requires libnuma) |
FLOX_ENABLE_TRACY |
OFF | Enable Tracy profiler integration |
Example with multiple options:
cmake .. \
-DFLOX_ENABLE_DEMO=ON \
-DFLOX_ENABLE_TESTS=ON \
-DFLOX_ENABLE_LZ4=ON \
-DCMAKE_BUILD_TYPE=Release
5. Verify Installation¶
Run the tests to verify everything works:
Next Steps¶
- First Strategy — Write your own trading strategy
- Architecture Overview — Understand how components fit together