⚠ INTERNAL — Operator UX mock · Design preview of V2 development path · demo-wired ≠ production-live · back to dev guide
Polygon · pUSD 10
📓 Developer Guide 📋 Reason Codes 📈 Shadow Mode
JD John Doe · Admin

KillSwitch

risk.killswitch
Risk Guardrail live General live demo-wired reference impl

KillSwitch is the top-level emergency stop for the entire trading system.

What it does

KillSwitch is the top-level emergency stop for the entire trading system. It can be triggered automatically when intraday or weekly drawdown exceeds a threshold, when the order-reject rate spikes above a circuit-breaker level, or when a market data feed is lost with open positions. It can also be triggered manually via the Admin UI. Once active, KillSwitch rejects every incoming OrderIntent without exception until a manual reset is performed (if require_manual_reset=true) or the trigger condition clears. It does not modify orders — it only blocks them entirely.

Pipeline placement

runs after: Any triggering event (drawdown breach, reject-rate spike, manual flag, feed loss KillSwitch runs before: All other guardrails and ExecutionPlan emit

Applies to: All OrderIntents — checked first in the guardrail pipeline

Why it matters

If this failsConsequence
Runaway loss not stopped automaticallyWithout a drawdown circuit breaker, a strategy that enters a losing streak continues to trade, compounding losses until a human intervenes — which may be too late.
Worked example
Setup: Account drawdown crosses -5% intraday at 16:42 UTC. Three strategies are still open: maker_tight on 4 markets, cross_market_arb on 2 markets, news_materiality_trader on 1 market. Total notional 42,000 pUSD.
Without bot: Each strategy continues to submit OrderIntents on its own cadence. By 17:11 UTC drawdown is -8.4% and one strategy has averaged down twice. The team only sees the breach when the daily report runs at 18:00 UTC.
With bot: KillSwitch crosses the -5% threshold at 16:42:09 and flips to active. Every subsequent OrderIntent across all three strategies is rejected with `KILLSWITCH_ACTIVE`. require_manual_reset=true, so the trip persists until an operator clears it.
API or wallet misbehaviour not detectedA spike in order rejections from the exchange or a wallet desync can indicate a broken execution path. Continuing to submit orders under these conditions risks unintended positions or double-orders.
Data feed lost with open positionsIf the CLOB WebSocket feed dies and positions remain open, the system cannot monitor or hedge those positions. The safe action is to halt new orders until the feed is restored.
No single manual override pathIn an incident, teams need a single, reliable mechanism to stop all trading immediately. Without a centralised kill signal, individual strategy shutdowns may be missed.

Inputs

Polymarket inputs

InputSourceRequiredUse
CLOB WebSocket connection statusWebSocketrequiredDetect feed loss; trigger KillSwitch if WebSocket has been disconnected for more than the allowed dead window while positions are open.
Order reject events from the exchangeCLOBrequiredCount reject events per minute; if reject rate exceeds reject_rate_circuit threshold, trigger KillSwitch.

Internal inputs

InputSourceRequiredUse
Rolling intraday and weekly P&LPortfolioGuardrequiredMonitor drawdown against intraday_drawdown_pct and weekly_drawdown_pct thresholds to trigger the circuit breaker.
Manual kill flag from operator dashboardAdmin UIrequiredAccept a manual activation signal that overrides all automatic conditions and immediately halts trading.
Open position countPortfolioGuardoptionalCondition the WebSocket-dead trigger on whether any positions are currently open; if no positions exist, feed loss alone does not trigger KillSwitch.

Authority

What this bot is permitted to do

Pause Reject

State

Readiness

General live

Status

live

Class

Guardrail

Default mode

general_live

Developer owner

Polytraders core — Risk pod

Capital impact

Critical

Reason codes emitted

CodeSeverityMeaningAction
KILL_SWITCH_ACTIVEHARD_REJECTThe KillSwitch active flag is set; all orders are rejected regardless of other conditions.Return HARD_REJECT immediately on every intent.
STRATEGY_BUDGET_EXCEEDEDHARD_REJECTIntraday or weekly drawdown has exceeded the hard circuit-breaker threshold.Activate KillSwitch with trigger_reason=INTRADAY_DRAWDOWN_EXCEEDED or WEEKLY_DRAWDOWN_EXCEEDED.
STALE_MARKET_DATAHARD_REJECTP&L or WS feed data is unavailable for more than 60s; system health is unknown.Activate KillSwitch with trigger_reason=STALE_MARKET_DATA.
KILL_SWITCH_INTRADAY_DRAWDOWNHARD_REJECTIntraday drawdown exceeded intraday_drawdown_pct hard threshold.Activate KillSwitch; set trigger_reason=INTRADAY_DRAWDOWN_EXCEEDED.
KILL_SWITCH_WEEKLY_DRAWDOWNHARD_REJECTRolling 7-day drawdown exceeded weekly_drawdown_pct hard threshold.Activate KillSwitch; set trigger_reason=WEEKLY_DRAWDOWN_EXCEEDED.
KILL_SWITCH_REJECT_RATEHARD_REJECTOrder reject rate from the CLOB exceeded reject_rate_circuit threshold in a 5-minute window.Activate KillSwitch; set trigger_reason=ORDER_BOOK_UNAVAILABLE.
KILL_SWITCH_FEED_DEADHARD_REJECTCLOB WebSocket feed has been dead for > 30s with open positions.Activate KillSwitch; set trigger_reason=ORDER_BOOK_UNAVAILABLE.
KILL_SWITCH_MANUALHARD_REJECTOperator manually activated KillSwitch via Admin UI.Activate KillSwitch; set trigger_reason=MANUAL_KILL.

Used by

Reverse index — strategies that currently reference risk.killswitch. If you change this bot's authority or reason codes, these strategies must re-pass shadow.

StrategyStateActivity
Crypto Q2 — basket rebalancefrozenlast triggered 6m ago

Showing 1 of 1 · demo-wired ≠ production-live

⚙ Configuration — risk.killswitch

5%

Kill switch arms when intraday drawdown exceeds this percentage.

15%

Kill switch arms when rolling 1h reject rate exceeds this threshold.

60s

Kill switch arms if all book feeds are silent for this duration.

If off, kill switch disarms automatically after 4h.

Configuration applies on next bot restart

Why this matters

Risk Guardrail bots does NOT propose intents or sign orders; only permits or blocks. Understanding the authority boundary prevents misuse and makes promotion-gate reviews faster and more reliable. View raw spec JSON →
Polytraders Operator UX Mock · INTERNAL · demo-wired ≠ production-live · the plan · reason codes · shadow-mode pipeline
⚙ Page Configuration
Current page settings
Loading configuration…