Polymarket Insider Trade Detector (Go, Telegram Bot API)
Autonomous service for detecting suspicious trades on the prediction market Polymarket with automatic alert delivery via Telegram (Go, Telegram Bot API, REST polling).
Main task: Monitoring the flow of transactions on Polymarket in real-time, identifying patterns characteristic of insider trading (new accounts, abnormal bet sizes, low-price entries before resolution), and instant notification of the operator via Telegram with a detailed report on each suspicious transaction.
What has been implemented:
- Rule-based scoring engine with 20 conditions (C1–C20): account age, bet size, entry price, market liquidity, trading speed, win-rate history on low-price bets, deviation from the wallet's baseline behavior
- Normalization of binary SELL transactions into BUY equivalent for correct scoring
- Data enrichment: wallet history (up to 500 records), proxy-wallet resolution, market liquidity, closure date - through Polymarket Data API and Gamma API
- Anti-smurf aggregator: detection of bets from one wallet broken into small parts and synthesis of aggregated trade when exceeding the threshold
- Compound alerts of coordinated activity: clustering of suspicious transactions from different wallets in one market over 30 minutes
- Post-resolution tracker: automatic verification of market results after closure, recording - WON/LOST/CANCELLED with accuracy count of the detector
- Durable outbox for Telegram: persistent queue for resending undelivered alerts with retry logic
- Daily digest with aggregated alert statistics and prediction accuracy; hot-reload configuration without stopping the service; health endpoint; graceful shutdown with proper state preservation
Technologies: Go 1.21, Polymarket Data API, Gamma API, Telegram Bot API, JSONL persistence, GOB serialization, concurrent worker pool, hot-reloadable .env config
Main task: Monitoring the flow of transactions on Polymarket in real-time, identifying patterns characteristic of insider trading (new accounts, abnormal bet sizes, low-price entries before resolution), and instant notification of the operator via Telegram with a detailed report on each suspicious transaction.
What has been implemented:
- Rule-based scoring engine with 20 conditions (C1–C20): account age, bet size, entry price, market liquidity, trading speed, win-rate history on low-price bets, deviation from the wallet's baseline behavior
- Normalization of binary SELL transactions into BUY equivalent for correct scoring
- Data enrichment: wallet history (up to 500 records), proxy-wallet resolution, market liquidity, closure date - through Polymarket Data API and Gamma API
- Anti-smurf aggregator: detection of bets from one wallet broken into small parts and synthesis of aggregated trade when exceeding the threshold
- Compound alerts of coordinated activity: clustering of suspicious transactions from different wallets in one market over 30 minutes
- Post-resolution tracker: automatic verification of market results after closure, recording - WON/LOST/CANCELLED with accuracy count of the detector
- Durable outbox for Telegram: persistent queue for resending undelivered alerts with retry logic
- Daily digest with aggregated alert statistics and prediction accuracy; hot-reload configuration without stopping the service; health endpoint; graceful shutdown with proper state preservation
Technologies: Go 1.21, Polymarket Data API, Gamma API, Telegram Bot API, JSONL persistence, GOB serialization, concurrent worker pool, hot-reloadable .env config