⚠ 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

AnomalyDetector

intel.anomalydetector
Intelligence planned Spec started frozen

Flag statistical anomalies in book, trades, or feed data for human review.

What it does

Flag statistical anomalies in book, trades, or feed data for human review.

Pipeline placement

runs after: — AnomalyDetector runs before: —

Applies to:

Why it matters

If this failsConsequence
Book or trade anomaly goes unnoticedWithout a statistical watchdog, sudden mid-price jumps, volume spikes, or microstructure changes that signal a feed glitch, market manipulation, or upstream halt are detected only when a strategy bot already trades on the bad data. By then unintended fills have already occurred.
Worked example
Setup: Market 0xab12 (NFL game in progress). Mid-price has sat at 0.62 ± 0.01 for 40 minutes. The CLOB V2 feed delivers a single tick at 0.91 followed by silence for 6 seconds, then resumes at 0.62.
Without bot: A maker strategy reads 0.91 as the new mid, re-quotes its ladder around 0.91, and gets crossed by the next 0.62 print — leaving open inventory it never intended to take.
With bot: AnomalyDetector emits a z-score=8.4 signal on that tick. Risk widens its staleness window for the market, smartrouter blocks new entries for 10s, and the maker bot keeps its prior ladder.
No baseline for human reviewOperators reviewing a market in incident mode have no reference for what 'normal' looked like for that market in the prior hour. Anomaly emissions provide the timestamped baseline that every post-incident review needs.
Z-score signal duplicated across strategiesIf anomaly detection lives inside individual strategy bots, every team reinvents it inconsistently. A single shared service emits one canonical anomaly stream that all consumers — Risk, Strategy, Governance — read from.
Strategy bots blind to feed degradationA z-score spike often precedes a stale-book event by seconds. Without an explicit anomaly signal, downstream Risk bots have no early warning to widen their staleness windows or pause new entries.

Inputs

Polymarket inputs

InputSourceRequiredUse
CLOB V2 order book mid-price per condition_idclob_publicrequiredCompute price z-score vs rolling baseline.
Recent trade volume per condition_iddatarequiredCompute volume z-score vs rolling baseline.

Internal inputs

InputSourceRequiredUse
KillSwitch active flagKillSwitchrequiredSuppress all anomaly emissions when KillSwitch is active.

Authority

What this bot is permitted to do

Read-only

State

Readiness

Spec started

Status

planned

Class

Signal Service

Default mode

shadow_only

Developer owner

Polytraders core

Capital impact

Indirect

Reason codes emitted

CodeSeverityMeaningAction
ANOMALYDETECTOR_PRICE_SPIKEWARNPrice z-score exceeds z_score_threshold relative to rolling baseline.Emit ObservationReport with anomaly_detected=true; strategies may reduce size or pause.
ANOMALYDETECTOR_VOLUME_SPIKEWARNVolume z-score exceeds z_score_threshold relative to rolling baseline.Emit ObservationReport with anomaly_detected=true; strategies monitor for continuation.
STALE_DATAWARNCLOB API or Data API is unavailable; anomaly detection paused.Skip detection cycle; retry on next poll.
KILL_SWITCH_ACTIVEHARD_REJECTKillSwitch active; all AnomalyDetector emissions suppressed.Continue anomaly detection internally; suppress all ObservationReport emissions.
ANOMALYDETECTOR_INSUFFICIENT_BASELINEINFORolling baseline has insufficient data points to compute reliable z-scores.Skip anomaly check for this market until baseline window is populated.

Used by

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

StrategyStateActivity
Fed Rates — surprise driftfrozenlast triggered 14m ago

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

Why this matters

Intelligence bots does NOT propose, veto, sign, or execute any trade. 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…