How blave-tw/blave-agent works
Blave Agent is an agentic quant workspace: users describe an idea, an AI agent creates strategy code, and the workspace supports research, evaluation, and deterministic live execution. The map follows that path from desktop interaction through backtesting and validation to portfolio management and venue orders, with cloud messaging/reporting as a separate access branch. README claims establish several subsystem capabilities; sampled source is partial, so uncertain internal wiring is omitted.
Main entry points: runner.py Backtest Runner · execute.py Order Execution · runtime Web / Telegram · agent_turn.py Agent Turn
Components 27
Desktop Workspace
- Desktop UI
shell/renderer/app.js - Desktop Main
shell/main.js - Agent Turn
runtime/agent_turn.py - Session Store
runtime/session_store.py
Strategy Research
- Strategy Code
strategies - Market Data
lib/data.py - Backtest Runner
lib/runner.py - Backtest Validation
lib/validation.py - Parameter Scan
lib/param_scan.py - Walk Forward
lib/walk_forward.py - Quality Checks
lib/quality_check.py - Reports
lib/report.py
Portfolio Trading
- Portfolio Manager
manager/manager.py - Allocation Methods
lib/allocator.py - Strategy Scheduler
lib/runner.py - Position Reconciler
manager/reconciler.py - Order Execution
lib/execute.py - Venue Adapters
lib/venue_wiring.py - Exposure Guard
lib/guard.py - Paper Trading
lib/order_paper.py
Cloud Access
- Web / Telegram
runtime - Cloud Agent Runtime
runtime/local_daemon.py
Other components
- User
- Claude / Codex
- Exchanges / Brokers
- Blave Services
- Telegram
Connections 28
- User → Desktop UI: describes idea
- Desktop UI → Desktop Main: sends commands
- Desktop Main → Agent Turn: starts turn
- Agent Turn → Claude / Codex: invokes
- Agent Turn → Session Store: persists turns
- Claude / Codex → Strategy Code: writes strategy
- Strategy Code → Backtest Runner: runs strategy
- Backtest Runner → Market Data: fetches prices
- Backtest Runner → Backtest Validation: validates results
- Backtest Runner → Parameter Scan: scans parameters
- Backtest Runner → Walk Forward: tests out-of-sample
- Backtest Runner → Quality Checks: checks results
- Backtest Runner → Reports: produces report
- Portfolio Manager → Allocation Methods: computes weights
- Portfolio Manager → Position Reconciler: updates targets
- Strategy Code → Strategy Scheduler: scheduled code
- Strategy Scheduler → Position Reconciler: provides targets
- Position Reconciler → Order Execution: requests orders
- Order Execution → Exposure Guard: checks exposure
- Order Execution → Venue Adapters: dispatches orders
- Venue Adapters → Exchanges / Brokers: places orders
- Order Execution → Paper Trading: paper fills
- User → Web / Telegram: sends messages
- Web / Telegram → Cloud Agent Runtime: forwards messages
- Cloud Agent Runtime → Claude / Codex: invokes
- Cloud Agent Runtime → Blave Services: requests data
- Web / Telegram → Telegram: bridges chat
- Web / Telegram → Reports: shows reports