Home / Polymarket Agent
The Polymarket agent
An autonomous trading loop. Claude reads plain-English instructions, researches markets, and places limit orders, but the spending limit lives in Python, not in the prompt.
How it works
Each cycle, the model researches markets through Polymarket’s Gamma API and live CLOB order books, then proposes limit orders. Every order passes through code that checks it against the guardrails below before anything is sent.
It runs in dry-run mode by default: real market data, simulated orders, logged and saved to a local state file. Live mode is a flag, and it never spends more than the USDC in the wallet.
The bankroll rule
available to spend = starting cap + proceeds from filled sales − spent on buys
Profits are the agent’s to reinvest. Losses mean less to trade with, and it never touches money beyond the starting cap. It can only sell shares it bought itself. Money only comes back once a sale actually fills, and a resting buy is charged at full cost immediately. Both choices are conservative.
Guardrails
| Limit | Behavior |
|---|---|
| Bankroll | Buys are shrunk or rejected to fit what’s available: starting cap, plus proceeds from filled sales, minus spent on buys. |
| Per-trade and per-market caps | Fixed dollar caps that don’t grow with profits. Orders are shrunk to fit. |
| Price range | Buys outside a minimum and maximum price are rejected. |
| Slippage | Rejects a limit price too far above the best ask. |
| Orders per cycle | Limits how many orders can go out in one cycle. |
| STOP file | Create a file named STOP and trading halts right away. |
| Dry-run fills | Simulated orders only fill when they’d match the live book immediately, so profits can’t be faked. |
Limits
- Each cycle costs Claude API tokens, roughly $0.10 to $1 depending on how much research it does.
- Winning shares from a resolved market have to be redeemed on polymarket.com. The agent doesn’t do that, so only sales count toward its bankroll.
- Polymarket blocks trading from some jurisdictions, so check you’re allowed.
- It’s experimental, and not financial advice. Start with dry runs and small budgets.