⚠ 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

MarketHaltDetector

risk.market_halt_detector
Risk Guardrail planned Spec ready demo-wired

Watches for market-level halt conditions across Polymarket — wide-spread blowouts, missing best bid/ask, locked or crossed books, and sudden order-rat

What it does

Watches for market-level halt conditions across Polymarket — wide-spread blowouts, missing best bid/ask, locked or crossed books, and sudden order-rate collapse. When any halt condition fires, MarketHaltDetector quarantines the affected market_id so no new OrderIntent for that market can pass the Risk pipeline. It does not pause the whole system — only the affected market. Cleared automatically once conditions normalise for a configurable cool-off window, or manually via the Admin UI.

Pipeline placement

runs after: intel.orderflowanalyzer MarketHaltDetector runs before: risk.killswitch, exec.smart_router

Applies to: Continuous

Why it matters

If this failsConsequence
Submitting orders into a halted bookOrders sent into a market with no two-sided liquidity end up either rejected by the CLOB or filled at runaway prices once the book reopens.
Worked example
Setup: Polymarket's status page reports `markets.matching` as degraded at 21:18 UTC. CLOB V2 stops accepting new orders but the data feed still streams stale book snapshots for 90 seconds.
Without bot: Strategies read the stale snapshots as live state and post OrderIntents. Every order is rejected with platform errors. By the time the team correlates the failures, the strategies have already sent 240 rejected requests, breaching the per-minute submission budget and triggering a separate rate-limit halt.
With bot: MarketHaltDetector reads the status page + recent reject patterns, declares `markets.matching=halted` at 21:18:14, and votes REJECT on every new OrderIntent until both the status page and the next 30s of submissions confirm a recovered state.
Treating wide-spread events as normalA market with a 30%+ inside spread is structurally untradeable; trading it anyway invites massive slippage and unfair fills.
Manual halt managementWithout automated detection, ops staff must monitor every market by hand — which does not scale past a handful of markets.

Inputs

Polymarket inputs

InputSourceRequiredUse
Best bid/ask per market_idWebSocketrequiredDetect missing or one-sided book; compute live spread.
Last-trade timestamp per market_idCLOBrequiredDetect sudden trade-rate collapse (no trades for trades_silent_ms with non-empty book).

Internal inputs

InputSourceRequiredUse
Recent OrderBookSnapshot historyintel.orderflowanalyzerrequiredSmoothed spread and depth context for halt-vs-noise classification.
Active strategy → market_id mapOrderLifecycleManageroptionalDecide which strategies to notify when a halt fires.

Authority

What this bot is permitted to do

Pause Reject

State

Readiness

Spec ready

Status

planned

Class

Guardrail

Default mode

shadow

Developer owner

Risk pod

Capital impact

Direct

Reason codes emitted

CodeSeverityMeaningAction
RISK_MARKET_HALTP1Risk Market HaltSee decision output and developer log for context.
RISK_MARKET_HALT_WARNP1Risk Market Halt WarnSee decision output and developer log for context.
RISK_MARKET_HALT_CLEAREDP1Risk Market Halt ClearedSee decision output and developer log for context.

Used by

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

StrategyStateActivity
NBA props — line-shopdemo-wiredlast triggered 3m ago
Crypto Q2 — basket rebalancefrozenlast triggered 10m ago
US Elect — book-builderdemo-wiredlast triggered 17m ago

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

⚙ Configuration — risk.markethaltguard

Strict catches pre-halt warnings; lenient requires operator confirmation.

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…