FLOX¶
AI-native framework for building trading systems.
Strategies, backtests, paper trading, and live execution sit behind one toolkit. AI agents discover the surface and drive it end-to-end through an MCP control plane. One strategy class runs backtest, paper, and live.
Getting started¶
Pick your language:
| Python quickstart | Indicators, strategies, and backtesting from Python |
| Node.js quickstart | Same API from JavaScript/TypeScript |
| C++ quickstart | Build FLOX and run the demo |
| Architecture | How the components fit together |
Quick example¶
#include "flox/strategy/istrategy.h"
#include "flox/book/event/trade_event.h"
class MyStrategy : public flox::IStrategy {
public:
void onTrade(const flox::TradeEvent& event) override {
if (event.trade.symbol == _targetSymbol) {
processSignal(event.trade.price);
}
}
void start() override { _running = true; }
void stop() override { _running = false; }
private:
flox::SymbolId _targetSymbol;
bool _running = false;
};
Language bindings¶
| Language | Guide | Reference |
|---|---|---|
| Python | Python | reference |
| Node.js | Node.js | reference |
| Codon | Codon | reference |
| JavaScript (embedded) | JavaScript | reference |
| C API | C API | reference |
Documentation¶
| Section | Description |
|---|---|
| Tutorials | Step-by-step lessons for new users |
| How-To Guides | Solutions for specific problems |
| Explanation | Architecture and design concepts |
| Reference | API specifications |
Features¶
| Feature | Description |
|---|---|
| Lock-free event delivery | Disruptor-style ring buffers, busy-spin consumers |
| Zero-allocation hot path | Pre-allocated pools, no heap allocation in market data callbacks |
| CPU affinity support | Pin threads to isolated cores |
| Multi-exchange trading | CEX coordination with aggregation and smart routing |
| Native connectors | Bybit / Bitget / Hyperliquid / Polymarket under connectors/, opt-in via -DFLOX_BUILD_CONNECTORS=ON |
| Binary replay system | Record live data, replay for backtesting |
| Backtest analytics | Grid search, walk-forward, heatmap, White's reality check, MLflow logging |
| Multi-language bindings | Python, Node.js, Codon, JavaScript, C API |
| AI companion | flox-mcp — Model Context Protocol server for Cursor / Claude Code / Cline |
| Type-safe primitives | Strong types for Price, Quantity, SymbolId |
| Modular architecture | Use only what you need |
Requirements¶
Pick the row for your binding. The C++ engine itself only matters if you build from source.
| If you use | You need |
|---|---|
| Python | Python 3.10+. pip install flox-py for prebuilt wheels (Linux / macOS). |
| Node.js | Node 18+. npm install @flox-foundation/flox. |
| Codon | Codon compiler + flox built with -DFLOX_ENABLE_CAPI=ON. |
| C++ | C++20 compiler (GCC 13+ / Clang 16+), CMake 3.22+, Linux or macOS. |
Optional across all bindings: LZ4 for binary log compression.
License¶
MIT License