| apps/run_bot.py | Entry point — initialises all components and launches strategy tasks |
| strategies/geopolitical.py | Core strategy loop — tick logic, trade execution, dynamic position management, settlement handling |
| src/signal_analyzer.py | Claude API wrapper — constructs prompts with all intelligence layers, parses structured responses, produces trade signals; includes source velocity detection |
| src/kalshi_client.py | Kalshi REST API client — orders, positions, market discovery, balance; conflict market filtering with ticker denylist |
| src/kalshi_flow_tracker.py | Order flow aggregator — taker-side volumes, large trades, momentum, net escalation flow |
| src/volume_spike_detector.py | Volume spike detector — flags markets with ≥3× normal hourly volume as potential breaking-event indicators |
| src/whale_tracker.py | Smart-money tracker — top trader positions, net escalation bias, and per-market divergence scoring (split whales = uncertainty signal) |
| src/market_indicators.py | Financial market indicators — live Brent crude, Gold, VIX, USD Index, Defense ETF from Yahoo Finance; 15-min cache; escalation read injected into Claude's prompt |
| src/event_calendar.py | Scheduled event calendar — IAEA board sessions, UNSC votes, Iran nuclear talks, DPRK dates, NATO summits; upcoming events injected as calibration context |
| src/telegram_stream.py | Telegram OSINT stream — direct Telethon connection to 22 OSINT channels when credentials present; rsshub RSS polling as parallel fallback |
| src/news_monitor.py | RSS + NewsAPI poller — 105 feeds across 12 source types; parallel 10-worker fetch; auto-activates Telegram rsshub feeds when detected |
| src/twitter_monitor.py | Twitter/X client — keyword and handle-based monitoring; SourceType enum for all 14 source categories |
| src/market_mapper.py | Market discovery — finds and scores conflict-relevant Polymarket markets by relevance |
| src/shadow_logger.py | Calibration data capture — logs every market evaluation (signal, confidence, side, entry price) to SQLite for post-hoc analysis; runs alongside the strategy on every tick regardless of whether a trade is placed |
| web/api.py | FastAPI dashboard backend — positions, trades, signals, market assessments, calibration report; EWMA smoothing, composite formula, market-implied baseline, and persistent decay computed here. Supports dual-instance deployment (real bot on port 8000, shadow paper-trade bot on port 8001) via env vars. 10-second response cache. |
| scripts/calibrate.py | Calibration report generator — computes Brier score, P&L attribution by theater/direction/exit type, confidence bucket accuracy, and threshold sensitivity from shadow_log.sqlite; writes calibration.json for the dashboard Calibration tab |
| scripts/sync_resolutions.py | Resolution syncer — polls Kalshi daily for settled market outcomes, fills the resolutions table in shadow_log.sqlite so calibrate.py can score predictions against ground truth |