SURVEILLANCE_REQUIRES_PRO is enabled.
1. Signals ↔ Endpoints
2. Baseline schema
Unique on
(entity_type, entity_id, window, metric) for upsert.
3. Alert schema
4. Config
5. Usage
Running the detection cycle
- Cron / scheduled: Call
POST /api/polymarket/surveillance/run-cycle(requires Pro andPOLYMARKET_SURVEILLANCE_ENABLED=true). Response:{ "skipped" }or{ "baselines_updated", "alerts_created" }. - Admin / UI: Use the same endpoint from an admin or scheduled job. The
PolymarketSurveillanceService.run_detection_cycle(markets=...)can be passed an optional list of market ids.
Listing and reviewing alerts
- List:
GET /api/polymarket/surveillance/alerts?severity=...&reviewed=...&limit=50&offset=0 - Review:
POST /api/polymarket/surveillance/alerts/{id}/reviewwith body{ "resolution": "dismissed" | "escalated" | "false_positive" }
SurveillanceAlertsPanel: it lists alerts, supports severity/reviewed filters, and a “Review” action with resolution dropdown. On 403 (subscription required), the panel shows an “Upgrade to Pro” CTA instead of the alerts table.