← Back to Projects

Polymarket Trading Agent

An autonomous multi-agent prediction market trading system. Uses Claude as a research brain, 4 independent probability estimators, and a 139-member weather ensemble to identify and trade mispriced bets on Polymarket.

Polymarket Trading Agent Architecture
Trading Pipeline

5-Stage Trading Pipeline

Every trade flows through a rigorous pipeline: market scanning, deep research from 3 specialized agents, multi-estimator probability forecasting with Platt calibration, 11 pre-trade risk checks, and finally execution via the Polymarket CLOB API with slippage protection.

Agent System

13-Agent Orchestration

The system orchestrates 13 specialized agents — market scanner, 3 researchers (web, news, data), 4 independent estimators (base, contrarian, calibration, Bayesian), an aggregator, risk manager, trader, orchestrator, and portfolio monitor. Each agent has a focused responsibility and communicates through structured interfaces.

13
Active Agents
139
Ensemble Members
11
Risk Checks
92
Open Positions

Key Features

  • 13-agent orchestration system powered by Claude
  • 139-member weather ensemble (GFS + ECMWF + ICON + GEM)
  • 4 independent probability estimators with Platt calibration
  • 11 pre-trade risk checks (drawdown, concentration, correlation)
  • Quarter-Kelly position sizing for optimal capital allocation
  • Real-time portfolio monitoring and P&L tracking
  • Automated market scanning across 8 prediction categories

Tech Stack

Python 3.12Claude APIPolymarket CLOBSQLitePostgreSQLOpen-Meteo APIGDELTBinance APIQuarter-Kelly

Built in Python with Claude as the reasoning engine. The trading bot connects to Polymarket's CLOB (Central Limit Order Book) API for order placement. Weather forecasts use the Open-Meteo API to query GFS, ECMWF, ICON, and GEM ensemble models. All trade history and analysis is persisted in SQLite (6.2MB) with PostgreSQL for analytics.

In-Depth Project Detail

The Concept

Prediction markets price real-world events as tradeable contracts. When the market price diverges from the true probability, there's an edge to exploit. This bot autonomously identifies these mispricings, researches the underlying events, estimates true probabilities, and executes trades — all without human intervention.

Evolution: V1 to V4

The system evolved through 4 major versions. V1 used a single LLM estimator and lost money. V2 introduced multi-estimator consensus. V3 added Platt calibration to fix systematic overconfidence. V4 pivoted to weather ensemble trading — using 139 numerical weather model members instead of LLM estimation for weather markets, dramatically improving accuracy on the highest-volume market category.

Risk Management

Every trade must pass 11 independent risk checks before execution. These include maximum drawdown limits, concentration caps (no single market gets too much capital), correlation prevention (avoiding correlated bets), daily loss limits, cooldown periods after losses, and position count caps. The quarter-Kelly criterion ensures position sizes are conservative — betting only 25% of the theoretically optimal amount.

Weather Ensemble

The weather trading module queries 139 ensemble members across 4 major forecast systems: GFS (30 members), ECMWF (50 members), ICON (39 members), and GEM (20 members). By counting what fraction of ensemble members predict a given outcome, the system generates calibrated probability estimates for temperature, precipitation, and extreme weather markets — without relying on LLM estimation at all.