System Architecture
Quant Flow is built as a modular, multi-agent system on LangChain/LangGraph. Two strategies share core infrastructure but operate independently.
High-Level Overview
┌─────────────────────────────────────────────────────────────────┐
│ Quant Flow │
│ │
│ ┌───────────────────────┐ ┌──────────────────────────────┐ │
│ │ Perpetual Agent │ │ Grid Flow │ │
│ │ (main.py) │ │ (grid_main.py) │ │
│ │ │ │ │ │
│ │ MultiAgent/LangGraph │ │ GridAgent + GridManager │ │
│ │ One agent per symbol │ │ AI direction + Math engine │ │
│ └──────────┬────────────┘ └─────────────┬────────────────┘ │
│ │ │ │
│ └──────────────┬───────────────┘ │
│ ↓ │
│ ┌─────────────────────────┐ │
│ │ Shared Infrastructure │ │
│ │ HyperliquidClient │ │
│ │ OrderManager │ │
│ │ MarketData + Indicators │ │
│ │ LLMClientManager │ │
│ └─────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
Perpetual Agent Data Flow
ExternalInfoAgent (Exa API market news)
↓
MarketData (OHLCV + technical indicators)
+ DataEnricher (CEX funding, F&G, MVRV/SOPR)
↓
EnhancedSingleSymbolAgent ←── MarketMonitor (volatility alerts, 30s)
│ FinCoT 6-step prompt
│ + {{ debate_summary }} ← BullAgent + BearAgent
│ + {{ regime_hint }} ← RegimeAdapter
│ + {{ cex_funding_signal }} ← DataEnricher
│ + {{ volatility_alert }} ← MarketMonitor
↓
ExecutionAgent (Pydantic structured output: ExecutionPlan)
↓