Dependency graph
Which bot needs which other bot to function. The graph is read-only documentation generated from each bot's declared dependencies.
How to read this
An arrow A → B means "A depends on B": A cannot make a correct decision unless B is responding. The graph is generated by walking each bot's dependencies.depends_on list.
Layer-level dependencies (always-true)
Strategy → Discovery (markets must be qualified before Strategy sees them)
Risk → Strategy (Risk only votes on existing OrderIntents)
Execution → Risk (Execution only acts on approved ExecutionPlans)
Security → every layer that signs (cross-cutting)
Governance → every layer (read-only: it logs and reconciles)
Intelligence → no internal deps; produces signals consumed by Strategy
Critical path bots
If any of these is unavailable, the entire pipeline degrades to a documented safe-fallback behaviour. Each is a P0 service.
risk.kill_switch— global brake. Every Risk bot consults it first.risk.portfolio_guard— single source of truth for budgets and balances.sec.contract_address_guard— V2 allow-list enforcement on every signing surface.disc.market_scanner— gatekeeps which markets exist downstream.gov.builder_attribution— reconciliation source-of-truth for fee accounting.
External dependencies
| Service | Endpoint | SLA we assume | If it fails |
|---|---|---|---|
| Gamma API | gamma-api.polymarket.com | 99.9% / 200ms p99 | Discovery degrades to cached snapshot ≤ 60s old. |
| Data API | data-api.polymarket.com | 99.9% / 500ms p99 | Median-spread inputs fall back to 24h snapshot. |
| CLOB API (read) | clob.polymarket.com | 99.95% / 200ms p99 | Risk bots HARD_REJECT until book data is fresh. |
| CLOB API (auth/trade) | clob.polymarket.com | 99.95% / 500ms p99 | Execution layer pauses; in-flight orders complete via WebSocket user channel. |
| WS market | ws-subscriptions-clob.polymarket.com/ws/market | 99.9% / no message-loss on resume | Auto-reconnect with exponential backoff; staleness alerts after 60s. |
| WS user | ws-subscriptions-clob.polymarket.com/ws/user | 99.9% / authenticated, last-message-id resume | Order-state reconciliation falls back to REST polling on a 2s loop. |
| WS sports | sports-api.polymarket.com/ws | 99% / best-effort | Sports-specific Discovery bots degrade to 30s polling. |
| WS RTDS | ws-live-data.polymarket.com | 99% / best-effort | Intelligence signals using crypto/equity prices mark themselves stale. |
| UMA Optimistic Oracle | on-chain (Polygon) | 2h challenge, 4–6 days if disputed | OracleRiskMonitor pauses affected markets for the duration. |
| NegRiskAdapter | on-chain (Polygon) | per Polygon block | Convert-arb strategies pause; existing positions unaffected. |
Cross-bot graph
Generated below at build time. (Auto-rendered from each bot's dependencies.depends_on; bots without a declared dependency block are omitted.)
| Bot | Depends on | Why | |
|---|---|---|---|
0.1 | → | risk.kill_switch | KillSwitch gate determines whether candidates are emitted. |
0.2 | → | disc.marketscanner | Provides the candidate market list that MarketQualityRanker scores. |
0.2 | → | risk.kill_switch | KillSwitch gate suppresses all emissions when active. |
0.3 | → | risk.kill_switch | KillSwitch gate suppresses emissions. |
0.4 | → | disc.marketqualityranker | Primary source of quality scores for queue entries. |
0.4 | → | risk.kill_switch | KillSwitch gate freezes queue and suppresses emissions. |
0.5 | → | disc.marketscanner | Provides baseline known condition_id set for new-market diffing. |
0.5 | → | risk.kill_switch | KillSwitch suppresses emissions but known set updates continue. |
0.6 | → | disc.marketscanner | Scopes detection to tradable markets only. |
0.6 | → | risk.kill_switch | KillSwitch suppresses all emissions. |
1.1 | → | risk.kill_switch | Global brake — checked first before any data fetch. |
1.10 | → | risk.kill_switch | Global brake checked first. |
1.11 | → | risk.kill_switch | Global brake checked first. |
1.12 | → | risk.kill_switch | Global brake checked first. |
1.13 | → | risk.kill_switch | Global brake checked first. |
1.14 | → | risk.kill_switch | Global brake checked first. |
1.15 | → | risk.kill_switch | Global brake checked first. |
1.16 | → | risk.kill_switch | All overrides blocked when kill switch is active. |
1.17 | → | intel.orderflowanalyzer | |
1.18 | → | intel.orderflowanalyzer | |
1.19 | → | exec.order_lifecycle_manager | |
1.2 | → | risk.portfolio_guard | Provides drawdown data that drives the automatic circuit-breaker trigger. |
1.3 | → | risk.kill_switch | Global brake — checked first before any oracle fetch. |
1.3 | → | risk.portfolio_guard | Per-market position limit is needed to compute the proposal-window size cap. |
1.4 | → | risk.kill_switch | Global brake — checked first before any book data is read. |
1.4 | → | risk.portfolio_guard | Budget remaining for this market caps the reshape ceiling. |
1.5 | → | risk.kill_switch | Global brake — checked first; KillSwitch causes rejection of all open-order intents but does not block cancel/flatten. |
1.6 | → | risk.kill_switch | Global brake — checked first; KillSwitch triggers emergency unwind of all inventory. |
1.6 | → | risk.portfolio_guard | PortfolioGuard per-market budget is consulted to confirm unwind intents don't inadvertently breach other limits (unwinds are closing, so they typically pass). |
1.7 | → | risk.kill_switch | Global brake — checked first before any registry is consulted. |
1.8 | → | risk.kill_switch | Global brake — checked first before any compliance data is read. |
1.9 | → | risk.kill_switch | Global brake checked first. |
2.1 | → | risk.kill_switch | Checked first before any order construction. |
2.1 | → | risk.portfolio_guard | Provides the approved OrderIntent with constraints.max_size_usd. |
2.1 | → | sec.contract_address_guard | Address validation must pass before signing. |
2.10 | → | internal.scheduler | Provides probe triggers every probe_interval_s. |
2.11 | → | exec.orderlifecyclemanager | Provides reject-rate metrics as a secondary degradation signal. |
2.12 | → | exec.smart_router | Source of ExecutionPlan to validate. |
2.13 | → | exec.partialfillhandler | Source of sub-minimum remainders forwarded for dust handling. |
2.13 | → | exec.smart_router | Source of ExecutionPlan sizes to validate and round. |
2.14 | → | intel.orderflowanalyzer | |
2.15 | → | exec.order_lifecycle_manager | |
2.2 | → | exec.smart_router | Provides the ExecutionPlan that AntiToxicFill evaluates and potentially reshapes. |
2.2 | → | risk.kill_switch | KillSwitch active flag is checked before any evaluation; active flag aborts all processing. |
2.2 | → | risk.portfolio_guard | Adverse RiskVotes from PortfolioGuard with toxicity tags trigger downsize_factor application. |
2.3 | → | exec.smart_router | SmartRouter provides replacement ExecutionPlan parameters when a cancel-replace is triggered. |
2.3 | → | exec.nonce_shepherd | NonceShepherd assigns the nonce and injects builderCode for every replacement order. |
2.3 | → | risk.kill_switch | KillSwitch active triggers immediate cancellation of all resting orders. |
2.4 | → | exec.smart_router | Receives ExecutionPlan containing order parameters and builderCode for nonce assignment. |
2.4 | → | exec.gas_oracle | GasOracle DEFER signals pause nonce reservation for queued ops to prevent nonce starvation. |
2.4 | → | risk.kill_switch | KillSwitch active blocks all new nonce assignments. |
2.5 | → | risk.kill_switch | KillSwitch active flag overrides all GasOracle approvals for non-risk-critical ops. |
2.6 | → | exec.smart_router | Provides signed order with builder_code to initialise state. |
2.6 | → | risk.kill_switch | KillSwitch triggers mass cancel of all open orders. |
2.7 | → | exec.orderlifecyclemanager | Provides FILLED ExecutionReport with fill_price, size, submit_ms. |
2.8 | → | exec.orderlifecyclemanager | Source of PARTIAL ExecutionReport with remaining_usd and original_price. |
2.8 | → | risk.kill_switch | KillSwitch forces immediate remainder cancel. |
2.9 | → | exec.partialfillhandler | Primary source of requote instructions for partial remainder chasing. |
3.1 | → | risk.kill_switch | Checked first; cancels all open quotes and blocks new intent emission when active. |
3.10 | → | risk.kill_switch | Checked first; blocks all intent emission when active. |
3.11 | → | risk.kill_switch | Checked first; blocks all intent emission when active. |
3.11 | → | risk.oracle_risk_monitor | OracleRiskMonitor must confirm oracle is clear before any OrderIntent is emitted. Active challenge or DVM escalation blocks entry. |
3.12 | → | risk.kill_switch | Checked first; closes open positions and blocks new intent emission when active. |
3.13 | → | risk.kill_switch | Checked first; blocks all intent emission when active. |
3.14 | → | risk.kill_switch | Checked first; blocks all intent emission when active. |
3.15 | → | risk.kill_switch | Checked first; blocks all intent emission when active. |
3.16 | → | risk.kill_switch | Checked first; blocks all intent emission when active. |
3.17 | → | risk.kill_switch | Checked first; blocks all intent emission when active. |
3.18 | → | risk.kill_switch | Checked first; blocks all intent emission when active. |
3.19 | → | risk.kill_switch | Checked first; blocks all intent emission when active. |
3.2 | → | risk.kill_switch | Checked first; cancels all open quotes and blocks new intent emission when active. |
3.20 | → | risk.kill_switch | Checked first; blocks all intent emission when active. |
3.21 | → | risk.kill_switch | Checked first; blocks all intent emission when active. |
3.22 | → | risk.kill_switch | Checked first; blocks all intent emission when active. |
3.23 | → | risk.kill_switch | Checked first; blocks all intent emission when active. |
3.24 | → | risk.kill_switch | Checked first; blocks all intent emission when active. |
3.3 | → | risk.kill_switch | Checked first; blocks all intent emission when active. |
3.4 | → | risk.kill_switch | Checked first; blocks all intent emission when active. |
3.5 | → | risk.kill_switch | Checked first; blocks all intent emission when active. |
3.6 | → | risk.kill_switch | Checked first; blocks all intent emission when active. |
3.7 | → | risk.kill_switch | Checked first; blocks all intent emission when active. |
3.8 | → | risk.kill_switch | Checked first; blocks all intent emission when active. |
3.9 | → | risk.kill_switch | Checked first; blocks all intent emission when active. |
4.1 | → | risk.kill_switch | KillSwitch gate determines whether ObservationReports are emitted. |
4.10 | → | risk.kill_switch | Suppress emissions when KillSwitch is active. |
4.11 | → | risk.kill_switch | Suppress emissions when KillSwitch is active. |
4.12 | → | risk.kill_switch | Suppress emissions when KillSwitch is active. |
4.13 | → | risk.kill_switch | Suppress emissions when KillSwitch is active. |
4.13 | → | risk.liquidity_guard | Provide forward liquidity signals for LiquidityGuard risk decisions. |
4.14 | → | risk.kill_switch | Suppress emissions when KillSwitch is active. |
4.14 | → | intel.onchainwatcher | Uses OnChainWatcher as upstream for initial wallet detection. |
4.15 | → | risk.kill_switch | Suppress emissions when KillSwitch is active. |
4.16 | → | intel.orderflowanalyzer | |
4.16 | → | exec.order_lifecycle_manager | |
4.2 | → | risk.kill_switch | KillSwitch gate suppresses ObservationReport emissions when active. |
4.3 | → | risk.kill_switch | KillSwitch gate suppresses ObservationReport emissions. |
4.4 | → | risk.kill_switch | KillSwitch gate suppresses ObservationReport emissions. |
4.5 | → | risk.kill_switch | KillSwitch gate suppresses ObservationReport emissions. |
4.6 | → | risk.kill_switch | Suppress emissions when KillSwitch is active. |
4.7 | → | risk.kill_switch | KillSwitch gate suppresses ObservationReport emissions. |
4.8 | → | risk.kill_switch | Suppress emissions when KillSwitch is active. |
4.9 | → | risk.kill_switch | Suppress emissions when KillSwitch is active. |
4.9 | → | intel.resolutionruleparser | Consume parsed resolution rules for cross-validation. |
5.1 | → | risk.kill_switch | KillSwitch gate runs first. |
5.1 | → | sec.session_key_manager | Provides session expiry and scope. |
5.2 | → | risk.kill_switch | KillSwitch gate before any on-chain read. |
5.2 | → | sec.rpc_failover_manager | RPC endpoint health for allowance reads. |
5.3 | → | risk.kill_switch | KillSwitch gate. |
5.3 | → | sec.contract_address_guard | Domain separator pre-validated. |
5.4 | → | risk.kill_switch | KillSwitch triggers mass session revocation. |
5.5 | → | risk.kill_switch | KillSwitch gate. |
5.5 | → | sec.session_key_manager | Session key provides fingerprint for rotation check. |
5.6 | → | risk.kill_switch | KillSwitch halts all probes. |
5.7 | → | risk.kill_switch | KillSwitch gate. |
5.7 | → | sec.rpc_failover_manager | Provides healthy primary RPC provider. |
5.8 | → | risk.kill_switch | KillSwitch gate is checked before any address validation. |
5.9 | → | exec.order_lifecycle_manager | |
6.1 | → | exec.smart_router | SmartRouter populates the builderCode bytes32 field on each order before BuilderAttribution sees it. |
6.10 | → | internal.config_store | Config store fires pre-write events to the audit hook. |
6.11 | → | gov.killswitch | IncidentCommander checks KillSwitch state before dispatching halt_all. |
6.12 | → | internal.report_archive | DecisionReport and RiskVote fetched for each fill. |
6.13 | → | internal.event_stream | All user action events are sourced from the platform event stream. |
6.14 | → | gov.builderattribution | BuilderAttribution provides reconciliation status and quarantine counts. |
6.15 | → | internal.metrics_store | All SLO compliance data is sourced from Prometheus metrics. |
6.16 | → | exec.order_lifecycle_manager | |
6.2 | → | internal.config_store | Bot registry is loaded from config store on startup. |
6.3 | → | gov.portfolio_sync | Position store snapshot is required to compute unrealised P&L on open positions. |
6.3 | → | gov.builder_attribution | Fill log joined for per-builder P&L breakdown and builder_fee_pusd. |
6.4 | → | internal.report_archive | All historical ObservationReport, DecisionReport, RiskVote, ExecutionReport, and SettlementReport envelopes are fetched from the report archive for replay reconstruction. |
6.4 | → | internal.clob_archive | Tick-level CLOB snapshots (order book + trades) are the primary replay data source for simulated fill computation. |
6.5 | → | internal.signal_bus | Paper-Trade Runner subscribes to the live signal bus to receive the same signals as live strategies, ensuring paper results are directly comparable. |
6.5 | → | internal.risk_stack | Risk guardrail votes are simulated through the full stack in paper mode to ensure the paper path is identical to live. |
6.6 | → | internal.config_store | Cron manifest is loaded from the config store on startup and on change events. |
6.6 | → | internal.killswitch | KillSwitch status is checked before dispatching trading-class tasks. |
6.7 | → | internal.clob_auth | Open orders and market metadata are fetched from clob_auth on each sync cycle. |
6.7 | → | internal.onchain_rpc | pUSD on-chain balance cross-check requires Polygon RPC access. |
6.8 | → | gov.backtester | Backtest artefact references required for promotion gates. |
6.9 | → | internal.report_bus | Matched-pair samples are derived from OperationsReport records on the report bus. |