QuantForge
QuantForge is a CLI-first trading systems framework in Rust for deterministic research, SQLite-backed market data, and controlled strategy execution.
Version 0.2.0 keeps the repository as a single Cargo package, following the
0.1.0 contributor experience, while adding the first live-trading and monitoring
path for Binance Spot.
There is no UI. The CLI is the product.
What changed in 0.2.0
- single-crate repository layout with internal Rust modules
datacommand group for historical and incremental candle ingestion into SQLitetrade runcommand for a polling strategy bot that reads closed bars from SQLite, evaluates a strategy, and can place or close spot market orderstrade closecommand for operator-driven position exitsmonitorcommand group for balances, open orders, recent trades, manual cancel, and manual close- bot run state and order or trade journal persisted in SQLite
QuantForge is engineering software. It is not investment advice, does not recommend trades, and does not promise profitability.
Why keep a single crate?
This repository stays as a single Cargo package in 0.2.0 so versioning,
publishing, installation, and contributor onboarding remain simple.
Internal boundaries still exist as Rust modules:
model- normalized market types and validationports- exchange and storage traits plus request typesexchange- Binance Spot REST clientstorage- SQLite candle store and bot journalsdk- strategy trait, indicators, built-in strategiesbacktest- deterministic bar-by-bar enginedata_sync- historical and incremental ingestion looplive- polling live-trade engine
Scope and guardrails
- exchange in 0.2.0: Binance Spot
- storage in 0.2.0: SQLite
- strategy execution model: closed-bar, event-driven
- built-in strategy in 0.2.0: SMA crossover example
- default execution mode: dry-run
- live order placement requires explicit
--mode liveand Binance credentials from environment variables
Credentials
QuantForge keeps secrets out of the repository. For live and monitor commands, use:
Use Binance Spot testnet first.
Quickstart
Sync candles into SQLite:
Validate the stored series:
Backtest the SMA crossover example:
Run the strategy against live-updating database candles without sending real orders:
Run against Binance Spot testnet with live order placement:
Inspect balances, open orders, and recent trades:
Cancel an order manually:
Close the bot-managed position manually:
Determinism contract
- timestamps are stored as UTC epoch milliseconds
- prices and volumes use decimal arithmetic, not floating-point math
- strategies evaluate only closed bars
- backtests execute intent on the next bar open
- live trading polls closed bars and records run state into SQLite
Local development
Run the full quality gate before opening a PR:
Roadmap
- additional exchanges such as Bybit
- restart reconciliation between local bot state and exchange state
- richer indicators and more built-in strategies
- alternative storage backends such as Postgres
- research-oriented parameter sweeps and snapshot reports
License
Licensed under MIT.