How 0xethanq/astra-quant-agent works
AstraQuant is an autonomous quant-trading system with a web control plane and a scheduled trading runtime. Its documented trading cycle turns market and derivative data into a multi-model committee proposal, applies deterministic fail-closed risk checks, then executes and protects orders through OKX. Separate product branches provide the admin/dashboard interface, policy and strategy evolution, and gateway notification delivery. The README documents the trading stages; several runtime links below are documented rather than verified in sampled implementation excerpts.
Main entry points: ai_brain_trader.py Trading brain · scheduler.py Cycle scheduler · app.py Backend API · worker.py Gateway worker
Components 24
Trading runtime
- Cycle scheduler
astra_gateway/scheduler.py - Gateway worker
astra_gateway/worker.py - Trading brain
scripts/ai_brain_trader.py
Analysis and policy
- Market data
scripts/market_data_service.py - Instrument universe
scripts/instrument_pool.py - Factor calculus
scripts/factors - Prompt library
scripts/prompt_library.py - Model committee
astra_backend/council/debate.py - LLM runtime
astra_backend/llm_manager.py - Strategy evolution
scripts/self_improvement_engine.py - Policy snapshots
astra_backend/policy
Risk and execution
- Risk gates
astra_backend/execution/risk_gates.py - Circuit breaker
astra_backend/execution/circuit_breaker.py - Order lifecycle
scripts/trader - OKX exchange
astra_backend/exchanges/okx.py
Web control plane
- Trading workstation
frontend/src/App.vue - Backend API
astra_backend/app.py - Dashboard data
astra_backend/dashboard_payload - Admin routes
astra_backend/routers
Gateway and delivery
- Delivery queue
astra_gateway/store.py - Event publisher
astra_gateway/publisher.py - Notification channels
astra_gateway/channels.py
Other components
- Operator
- OKX service
Connections 21
- Cycle scheduler → Market data: schedules
README.md - Cycle scheduler → Trading brain: schedules
README.md - Cycle scheduler → Strategy evolution: schedules
README.md - Market data → Factor calculus: feeds
README.md - Instrument universe → Factor calculus: constrains
README.md - Trading brain → Model committee: requests debate
README.md - Trading brain → Prompt library: uses prompts
README.md - Model committee → LLM runtime: calls models
README.md - Trading brain → Risk gates: submits intent
README.md - Risk gates → Circuit breaker: checks exposure
README.md - Trading brain → Order lifecycle: dispatches intent
README.md - Order lifecycle → OKX exchange: submits orders
README.md - OKX exchange → OKX service: executes on
README.md - Strategy evolution → Policy snapshots: updates policy
README.md - Operator → Trading workstation: uses
- Trading workstation → Backend API: requests data
- Backend API → Dashboard data: serves
astra_backend/app.py - Backend API → Admin routes: mounts routes
astra_backend/app.py - Event publisher → Delivery queue: enqueues events
astra_gateway/publisher.py - Gateway worker → Delivery queue: claims deliveries
astra_gateway/worker.py - Gateway worker → Notification channels: sends delivery
astra_gateway/worker.py