Rust-based, modular AI trading agent for crypto (extensible to other asset classes). Combines market data, technical features, and source-aware news signals with a model-driven decision engine.
Prereqs: Rust stable (see rust-toolchain.toml), SQLite (optional), Docker (optional) for Postgres.
Install deps and run tests:
cargo build
cargo test
Run CLI help:
cargo run --bin trader -- --help
Fetch historical klines:
cargo run --bin trader -- fetch --symbol BTCUSDT --interval 60 --limit 10 --http-base https://api.binance.us
Stream live candles:
cargo run --bin trader -- stream --symbol BTCUSDT --interval 60 --ws-base wss://stream.binance.com:9443
Inspect features (M4):
cargo run --bin trader -- features --symbol BTCUSDT --interval 60 --window 32
cargo run --bin trader -- features-dump --symbol BTCUSDT --interval 60 --limit 50 --http-base https://api.binance.us --window 32
News (RSS + optional Twitter):
# RSS only
cargo run --bin trader -- news
# With Twitter (requires TRADER__TWITTER_BEARER_TOKEN)
cargo run --bin trader -- news --twitter
Loose parity (fixture included):
cargo test -q --test parity_indicators
Strict parity against exported reference CSV (TradingView/Binance):
STRICT_PARITY_CSV=/abs/path/to/ref.csv cargo test -q --test parity_indicators_strict
See config/default.toml and environment overrides (prefix TRADER__, supports JSON arrays via try_parsing).
Important env vars:
TRADER__DATABASE_URLTRADER__BINANCE_HTTP_BASE,TRADER__BINANCE_WS_BASETRADER__NEWS_FEEDS,TRADER__NEWS_POLL_SECSTRADER__TWITTER_BEARER_TOKEN,TRADER__TWITTER_QUERIES,TRADER__TWITTER_API_BASE
See docs/SCHEMA.md for tables and PG vs SQLite differences. Postgres is recommended with pgvector for embeddings.
- Formatting:
rustfmt(seerustfmt.toml) - Linting:
clippy(seeclippy.toml) - Toolchain:
rust-toolchain.toml(stable with clippy + rustfmt components)
See docs/TODO.md for milestones. M5 introduces embeddings + news features; M5.5 adds source scoring, responsiveness, and automated discovery.