An AI-powered trading agent that identifies leader-follower opportunities on Polymarket prediction markets.
Live Dashboard: trading-bot-hazel.vercel.app
This project implements a strategy from academic research on prediction market inefficiencies (Arxiv Paper). The core insight:
When two markets are causally related and resolve at different times, the leader market (resolves first) reveals information that can be traded on the follower market (resolves later) before prices adjust.
Example: If "Fed cuts rates in December?" resolves YES, the market "Fed cuts rates in January?" likely hasn't priced in this information yet—creating a trading opportunity.
- Ingestion - Fetches active markets from Polymarket API
- Clustering - Groups related markets using semantic embeddings
- Analysis - Uses GPT-4 to identify leader-follower pairs with causal relationships
- Notifications - Sends Telegram alerts when:
- New trading opportunities are discovered
- A leader market resolves (time to trade the follower!)
Get real-time alerts on your phone when trading opportunities arise.
Setup:
- Message @BotFather on Telegram and send
/newbot - Follow the prompts to create your bot and get your
TELEGRAM_BOT_TOKEN - Start a chat with your new bot and send any message
- Visit
https://api.telegram.org/bot<YOUR_TOKEN>/getUpdatesto find yourTELEGRAM_CHAT_ID
Alert Types:
- 📈 New Opportunity - When a high-confidence leader-follower pair is discovered
- 🚨 Leader Resolved - When a leader market closes, telling you exactly what to trade
├── agent/ # Node.js trading agent (runs on Render cron)
├── dashboard/ # Next.js web UI for viewing signals
└── ui/ # Shared React components
- Agent: Render cron job (every 6 hours)
- Dashboard: Vercel static site
- Copy
.env.exampletoagent/.env - Add your API keys (OpenRouter, Telegram)
- Run locally:
cd agent && npm install && npm start
- TypeScript, Node.js
- OpenRouter (GPT-4 for analysis)
- Polymarket Gamma API
- Telegram Bot API
- Next.js, Tailwind CSS