Skip to content
Prabal Pratap Singh
All work

AI agent · Prediction markets2026Paper trading

TradeAgent

Polymarket research agent. Grok and GPT forecast each market independently, then deterministic risk code sizes positions with fractional Kelly and simulates execution against the real order book.

TradeAgent architecture preview

At a glance

2 models

  • Grok and GPT research each market independently
  • Deterministic, fee-aware fractional Kelly sizing with layered caps
  • Live trading stays blocked until settlement is verified

What it is

Test whether LLM forecasts can find mispriced prediction markets, with all money decisions made by deterministic, auditable code.

Why it exists

LLMs are good at reading resolution rules and evidence, and bad at managing money. The goal was to use them only for the first part.

How it works

Public Polymarket markets are discovered, then Grok and GPT research each one without seeing current prices. After research the order book and rules are refreshed, and changed rules or stale books are rejected. A deterministic engine turns the forecasts into an after-cost edge and a capped fractional-Kelly size, and paper fills are limited by real best-ask depth. Everything persists in SQLite with leases and a decision audit trail.

Decisions worth explaining

Models never see the price

Showing a model the market price anchors its forecast to the crowd. Keeping prices out makes the two forecasts independent evidence.

Money decisions are plain code

Sizing, limits and settlement are deterministic and tested; no model output can change a position size directly.

Learn only from resolved markets, reset on change

Calibration uses one forecast per resolved market and resets whenever the policy, model or version changes, so old results never train a different system.

Results

  • Scan, shadow and paper modes; live trading stays blocked until a verified settlement adapter exists.
  • Fee-aware edge and fractional-Kelly sizing with trade, market, category and portfolio caps.
  • Circuit breakers, leases and a full decision audit trail; profitability not yet claimed.

Stack

PythonFastAPIPydanticGrokOpenAIPolymarketSQLite

From the code

src/tradeagent/risk.py

# Edge after costs, then a capped fraction of full Kelly
full_kelly = max(0.0, (p_side - prelim_effective)
/ max(1e-9, 1 - prelim_effective))
suggested_fraction = full_kelly * self.s.kelly_multiplier

Want something like this built?

Open to roles & contracts. Remote · IST with US/EU overlap.

Email me