2025
Prediction Market Forensic Monitor
Polymarket trade surveillance — anomaly detection, AI forensic analysis, and a self-correcting meta-agent
- n8n
- Polymarket API
- Supabase
- Discord
- Gemini
- Docker
A multi-workflow n8n system that polls Polymarket trades every five minutes, flags anomalous activity, runs AI forensic analysis, alerts via Discord, and logs everything to Supabase — with a weekly meta-agent that learns from its own misses.
The three workflows
Forensic Monitor & Strategy Agent
- Scheduled polling of Polymarket CLOB trades with adaptive lookback (6-minute delta vs. 8-hour backfill after downtime)
- Anomaly filter logic — niche snipers, macro whales, high-value sports trades, wallet clustering
- LLM-powered forensic analysis with risk scores and betting recommendations
- Discord alerts with market links and structured recommendations
Resolution Checker (Evaluation)
- Fetches unresolved predictions from Supabase
forensic_logs - Checks actual market outcomes via Polymarket Gamma API
- Marks predictions as resolved and records accuracy for the learning loop
Meta-Agent (Learning Engine)
- Weekly run that pulls wrong predictions from Supabase
- Formats failure context and feeds it back to the LLM to refine detection heuristics
- Closes the loop: monitor → predict → evaluate → learn
Infrastructure
- Docker Compose for local n8n + data persistence
- Supabase as the forensic log store and evaluation backbone
Why it matters
A full sense → decide → act → evaluate → improve agent loop built entirely in n8n — the kind of architecture I bring to production AI systems, just applied to prediction markets as a research sandbox.