Daedalus Labs is a trading systems monorepo for research, backtesting, simulation, machine learning experiments, and eventually live trading infrastructure.
The repository is organized around a few principles:
- Keep research reproducible and close to the code that produced it.
- Keep execution-critical code small, measurable, and heavily tested.
- Separate experiments from production-grade libraries.
- Prefer explicit contracts between data, strategy, execution, and evaluation.
.
├── engines/ # Performance-critical trading engines
│ └── janus/ # Rust backtesting engine
├── experiments/ # Short-lived research and strategy experiments
├── ml/ # Feature engineering, training, evaluation, model tooling
├── data/ # Local data manifests and schemas, not raw market data
├── strategies/ # Strategy definitions and shared strategy components
├── infra/ # Deployment, storage, orchestration, and environment setup
├── docs/ # Architecture notes, runbooks, design records
└── tools/ # Developer tooling and scripts
Raw market data, broker credentials, API keys, model weights, and private research dumps should not be committed. Put durable interfaces, manifests, schemas, and sample fixtures in the repo instead.
Janus is the first engine in this workspace: a high-performance Rust backtesting engine designed for event-driven simulations.
Current scope:
- deterministic event-driven OHLCV replay
- multi-exchange, multi-symbol domain model
- spot and perpetual accounting contracts with funding-rate events
- configurable candle-based fills, fees, spread, slippage, and order delay
- compiled-in strategy registry with buy-and-hold, moving average crossover, momentum breakout, mean reversion, and a custom template
- CLI for import, inspect, run, sweep, summarize, and local service startup
- axum/Tokio local HTTP/WebSocket service
- JSON/CSV artifacts for summaries, metrics, progress, equity curves, fills, and positions
Planned scope:
- Parquet columnar cache once the JSONL schema is stable
- streaming data adapters
- order book and bar/tick simulation modes
- partial-fill, limit, stop, cancel/replace, and liquidity models
- richer metrics and attribution reporting
- bindings for Python research workflows where useful
Install Rust, then run:
cargo test --workspace
cargo fmt --allTo work on Janus:
cargo test -p janus
cargo run -p janus -- strategies
tools/janus-check.shNormalize Binance-style kline CSV data:
cargo run -p janus -- import \
--input data/raw/BTCUSDT-1m-sample.csv \
--output data/cache/btcusdt-1m.jsonl \
--format csv \
--exchange binance \
--symbol BTCUSDTRun a backtest:
cargo run -p janus -- run \
--input data/cache/btcusdt-1m.jsonl \
--output-dir artifacts/janus/btcusdt-buy-hold \
--strategy buy_and_hold \
--strategy-config '{"quantity": 1.0}'Start the local service:
cargo run -p janus -- serve --bind 127.0.0.1:7878See docs/runbooks/ for import, backtest, sweep, and service workflows.
- Use Rust for performance-critical engines and simulation cores.
- Use Python where it is clearly better for notebooks, ML, data inspection, and rapid research.
- Put reusable logic in libraries; keep experiments easy to delete.
- Add tests for accounting, order semantics, determinism, and edge cases.
- Benchmark before optimizing. Keep benchmark results and assumptions in docs.
Major components should use concise names with clear ownership:
Janus: backtesting and simulation engine- future engines can live under
engines/<name> - strategy packages should live under
strategies/<market-or-style>/<name>