Policy News → Polymarket Edge Bot
An AI-driven trader that turns breaking regulatory and policy news into automated Polymarket bets. Runs on a recurring schedule, extracts forecastable events with AI, finds matching prediction markets, and auto-places a bet when the AI's probability diverges from the market price beyond your configured threshold.
How it works
- Scrape news — fetches the latest headlines from three sources: Federal Reserve press releases, SEC press releases, White House presidential actions
- Extract events — an AI pass reads the scraped text and pulls out up to 5 forecastable events, assigning a probability (0–1) to each. It picks the single top event most likely to have a matching Polymarket market.
- Search Polymarket — queries Polymarket for markets matching the top event's keywords.
- Analyze divergence — a second AI pass picks the best-matching market, chooses the under-priced outcome (YES or NO), and returns the raw AI probability and market price.
- Compute divergence — a deterministic code step calculates
divergencePp = |aiProbability − marketPrice| × 100 to avoid AI arithmetic errors.
- Gate the bet — if the divergence exceeds the threshold you configure, the workflow proceeds to place a bet; otherwise it logs the skip and exits.
- Size the bet — reads your current pUSD balance on Polymarket and sizes the order as a percentage of that bankroll.
- Place + notify — executes a market order on Polymarket (FAK — Fill And Kill) and sends a Telegram alert with the market link, outcome, divergence metrics, order ID, and AI reasoning.
What you configure
- Trigger schedule — how often the bot runs (cron/rrule). Tune frequency based on how quickly you want news to translate into trades.
- Scrape sources — the three default URLs (Fed / SEC / WH) can be changed to any news source Firecrawl can reach.
- AI model — defaults to
openai/gpt-4o. Swap for a cheaper or smarter model depending on cost/quality tradeoffs.
- Divergence threshold — the minimum
divergencePp required to fire a bet. Higher = fewer bets, stronger edge. Lower = more bets, more noise.
- Bet sizing — the
multiplier on your bankroll (e.g. 0.02 = 2%), plus minAmount and maxAmount floors/ceilings in pUSD.
Notes
- Divergence is in percentage points, not relative percent. Example: AI thinks 80%, market thinks 30% → 50pp divergence.
- The AI always picks a market, even for weakly related events; the divergence threshold is the primary safety gate. Raise it if you see bad matches in practice.