Deep
Blue
Wiki
All Pages
+ New Page
Edit — Codebase Graph Analysis
Title
Tags (comma separated)
Content (Markdown)
# Codebase Graph Analysis Generated by [graphify](https://github.com/safishamsi/graphify) on 2026-04-07. Run: `/home/ubuntu/bots/rebuild_graph.sh` Output: `/home/ubuntu/bots/graphify-out/` ## Stats - **223 files** analyzed - **3,454 nodes** (functions, classes, docstrings) - **7,465 edges** (calls, uses, inherits) - **180 communities** detected via Leiden clustering - 44% extracted (AST), 56% inferred (semantic) ## God Nodes (Most Connected) These are the core abstractions of the codebase — touching these breaks everything: | Rank | Node | Edges | Description | |------|------|-------|-------------| | 1 | `RealtimeSignalGenerator` | 290 | Core signal engine (btc_realtime websocket) | | 2 | `PolymarketClient` | 273 | All Polymarket API calls go through this | | 3 | `FiveMinMarketDiscovery` | 265 | Discovers 5-min markets for each window | | 4 | `MomentumSignalGenerator` | 238 | Candle-based signal fallback | | 5 | `CompanyAgent` | 213 | Bot base class — everything inherits from it | | 6 | `PaperclipClient` | 96 | (Legacy/utility) | | 7 | `MarketPriceFeed` | 86 | Price feed abstraction | | 8 | `ClobFillMonitor` | 86 | Monitors CLOB order fills | | 9 | `FiveMinRiskEngine` | 81 | Circuit breaker + position sizing | | 10 | `DeFiRouter` | 80 | DeFi engine (currently PAUSED) | ## Key Communities | Community | Key Nodes | Focus | |-----------|-----------|-------| | 0 | CompanyAgent, add_memory, award_xp | Base agent infrastructure | | 6 | FishyBot, five_min_crypto_loop, gaussian_confidence_adj | 5-min trading loop | | 7 | calculate_kelly_size, compute_brier_calibration, apply_brier_calibration | Sizing & calibration | | 8 | analyze_performance, compute_and_update_weights, _load_signal_perf | Signal performance tracking | | 10 | ChainlinkFeed, PolymarketDataStreamFeed, get_realtime_feed | Price feeds | | 11 | ExecBot, _get_current_bet_size, initiate_team_discussion | EXEC bot loop | | 12 | BinanceFetcher, MomentumCalculator, ParticleFilter | Momentum signals | | 13 | compute_conf_floor, compute_regime_stats, compute_toxic_hour_changes | Auto-tuning engine | | 14 | run_backtest, fetch_klines, Test multiple confidence thresholds | Backtesting module | ## Notable Connections The graph revealed that EXEC personality config strings (from `bot_exec.py` docstrings/soul) appear as nodes connected to `CompanyAgent` — showing how the soul file is woven into the agent's decision-making at the base class level. ## Updating the Graph After modifying Python files: ```bash cd /home/ubuntu/bots && ./rebuild_graph.sh ``` Or the post-commit hook at `.git/hooks/post-commit` does it automatically after every commit.
Save
Cancel