Skip to main content

Polymarket Agent

Autonomous prediction-market trading system — modular monolith with Postgres event bus, probability gates, and adaptive risk controls.

5 min read·Intermediate·Concept·Jul 26, 2026
projecttrading systems

Polymarket Agent

What Was Built

The Polymarket Autonomous Trading Engine is an experimental trading system for prediction markets. Phases 0–15 implement a full pipeline from market data ingestion through trade execution, position monitoring, learning analytics, and adaptive parameter tuning — all as a modular monolith communicating through a Postgres event bus.

The Problem

Prediction markets have structural inefficiencies — fragmented liquidity, stale quotes, slow information propagation — but exploiting them requires more than signal detection. A production trading system needs probability estimates before execution, hard risk limits, strategy lifecycle management, and isolation between advisory AI and trade execution.

Architecture Summary

See the full system breakdown in Polymarket Trading Agent.

Evolution and Milestones

PhaseWhat shipped
0–2Core infrastructure, Postgres event bus, worker runtime
3–4Market data, quality filter, edge discovery, validation
4.5–5Opportunity selection, capital allocation, adaptive risk
6–7Trade execution, position monitoring, profit vault
8–9Learning loop, safety/alerting, Telegram control
11–12External signals, probability models, domain ensembles
12.5Probability hard gate — NO PROBABILITY → NO TRADE
12.6External alpha integration with strategy killer
14AI advisor isolation layer (read-only)
15Adaptive tuning engine with bounded ±20% caps

Key Decisions

DecisionRationale
Modular monolithShared Postgres; no network overhead between phases
Event bus integrationClean module boundaries via persisted events
Probability hard gateEnforce edge-based discipline before execution
Kelly + hard ceilingsMathematical sizing with safety bounds
DRY_RUN defaultObserve pipeline before risking capital
AI advisor isolationLLM failures must not block trades

Lessons Learned

  1. Profit = Edge × Execution Quality × Capital Allocation — all three must work.
  2. Event bus as integration layer — modules stay isolated when communication is persisted.
  3. Strategy auto-disable is essential — underperforming strategies must be killed automatically.
  4. Advisory AI stays advisory — never put LLM latency in the execution critical path.

Sources