QuantCrypt is a local-first multi-agent crypto trading system built around four Layer 1 agents, a LangGraph supervisor, Binance market-data ingestion, and an AI engineering layer for reports, memory, and retrieval.
Data Foundation Nodefor Binance REST, WebSocket, and Data Vision ingestionDatabasestorage for market candles, reports, and memory artifactsAI Engineering Layerfor evidence building, memory construction, and Agentic RAGSupervisor Nodeimplemented as a LangGraph state machineLayer 1agents:Analyst,Researcher,Trader, andRisk Management- Local Ollama runtime using
gemma4:12bthrough LangChainChatOllama - Streamlit dashboard with
Backtest,Paper Trading, andLive Tradingdemo modes
- Python runtime:
3.11.9 - The supervisor can run from SQL-backed market evidence instead of only synthetic inputs
- The LLM boundary uses LangChain structured outputs with Pydantic validation
- The orchestration layer uses LangGraph shared state instead of a custom loop
- The current execution scope is
Binance spotandcrypto only - The current build monitors one symbol per active run, chosen from the dashboard
- The strategy is
long/flat:BUYenters or keeps long exposure,SELLexits to cash, andHOLDkeeps the current position Backtestis read-only and does not write reports or memoriesPaper Tradingpersists reports and memory artifactsLive Tradingremainsdemo account only- Secrets must not be stored in tracked plaintext files
- Exchange:
Binance - Asset class:
Crypto - Market type:
Spot - Monitored coins: one symbol per active run, for example
BTCUSDTorETHUSDT - Decision outputs:
buy,sell,hold SELLsemantics: exit long exposure and go back to cash; no shorting in the current build- Market orders: not implemented
- Limit orders: not implemented
- Stop loss: not implemented
- Take profit: not implemented
- Live order routing: not implemented
- Stock trading: not supported
The current implementation targets local Ollama with gemma4:12b.
- Install and run Ollama.
- Pull the model:
ollama pull gemma4:12b- The repo includes:
- .env.example
- local
.envwith the same defaults
- Optionally override defaults:
$env:OLLAMA_MODEL="gemma4:12b"
$env:OLLAMA_BASE_URL="http://localhost:11434"
$env:QUANTCRYPT_DB_PATH="runtime/sqlite/quantcrypt.sqlite3"
$env:QUANTCRYPT_FAISS_INDEX_PATH="runtime/faiss/quantcrypt_memory.faiss"The code loads .env automatically and uses LangChain ChatOllama against the local Ollama runtime.
Data Foundation Node: quantcrypt/data_foundation/data_node.pyAI Engineering Node: quantcrypt/ai_engineering/ai_node.pySupervisor Node: quantcrypt/supervisor.pyAnalyst Agent: quantcrypt/agents/analyst.pyResearcher Agent: quantcrypt/agents/researcher.pyTrader Agent: quantcrypt/agents/trader.pyRisk Management Agent: quantcrypt/agents/risk.pyOllama LLM Adapter: quantcrypt/llm.py- Shared models: quantcrypt/models.py
The Binance ingestion module lives under:
quantcrypt/
`-- data_foundation/
|-- data_node.py
|-- storage.py
|-- validator.py
`-- collectors/
|-- binance_rest_collector.py
|-- binance_ws_collector.py
|-- binance_bulk_downloader.py
`-- binance_rate_limiter.py
Current capabilities:
- REST kline backfill from Binance public market data REST
- SQLite
clean_ohlcvtable with idempotent upserts - Candle validation and missing-candle repair
- WebSocket live kline collector for closed candles
- Data Vision bulk downloader with checksum verification
The AI engineering module lives under:
quantcrypt/
`-- ai_engineering/
|-- ai_node.py
|-- evidence.py
|-- reports.py
|-- memory_builder.py
|-- rag.py
|-- faiss_store.py
|-- store.py
`-- embeddings.py
Current capabilities:
- SQL-backed structured market evidence from
clean_ohlcv - Decision reports and per-agent report persistence
- Memory artifact construction from decisions and agent outputs
- FAISS vector indexing for summarized memory artifacts
- Agentic RAG that combines structured database evidence with semantic memory retrieval
- End-to-end supervisor execution from
symbol + interval
QuantCrypt uses dedicated runtime folders:
- SQLite database: runtime/sqlite
- FAISS indexes: runtime/faiss
Default files:
- SQLite DB:
runtime/sqlite/quantcrypt.sqlite3 - FAISS index:
runtime/faiss/quantcrypt_memory.faiss
The current dashboard is a Streamlit control surface for the implemented architecture:
BacktestPaper TradingLive Trading
Current behavior:
Backtestis read-only and does not persist reports or memory artifactsBacktestattempts to bootstrap missing historical candles from Binance REST before it runsPaper Tradingpersists supervisor reports and memory artifactsLive Tradingis stilldemo account onlyand does not place exchange ordersRunandStopcontrol the active dashboard execution loopLive Monitorshows component health, recent agent activity, and alerts including Ollama connectivity failures
Run the dashboard:
.\.venv\Scripts\streamlit.exe run dashboard_app.pyRun:
.\.venv\Scripts\pytest.exe -q- Record each step in docs/worklog.md
- Update the system view in docs/architecture.md
- Keep secrets out of git-tracked files
Add explicit execution-state transitions for Backtest, Paper Trading, and Live Trading so the dashboard can drive a more formal runtime state machine.