Market Edge#

An autonomous prediction market trading agent that scans Polymarket for mispriced markets, estimates probabilities using a multi-pass Claude pipeline, sizes positions with Kelly criterion, and executes trades against a local portfolio.

Status: Research / paper trading — no confirmed out-of-sample edge yet.

GitHub


Architecture#

The agent runs three concurrent loops:

  • Research (async) — web search, news gathering, price history
  • Strategy (daily) — scan markets, screen with Haiku, build candidate list
  • Tactical (15 min) — full analysis with Sonnet, Kelly sizing, trade execution

4-pass LLM probability pipeline#

Each market estimate goes through four passes:

  1. Base Rate — historical/domain prior (Sonnet), no market price visible
  2. Bayesian Update — incorporates a web-searched research dossier
  3. Adversarial — stress-tests the estimate against counterarguments
  4. Calibration — optional Brier score correction from historical performance

Haiku handles cheap screening; Sonnet handles full analysis.

Data#

Two SQLite databases: a live portfolio DB tracking trades, positions, and predictions, and a backtest DB with 90K+ resolved Polymarket markets for simulation and hypothesis testing.

Stack#

Python, Claude (Haiku + Sonnet), Polymarket Gamma API / CLOB, Kelly criterion, SQLite, FastAPI dashboard.