
Polymarket Paper Trader
io.github.agent-nextPublished by GitHub account agent-nextv0.4.13Updated Oct 25, 2026
Polymarket paper trading for AI agents: $10k paper money, real order books, official fees.
Overview
Lets an AI assistant paper-trade Polymarket and Kalshi prediction markets with simulated money against live order books and official fee models.
- What you can do
- Create and reset paper accounts, check balance, portfolio, P&L and trade history, and view stats, leaderboard and head-to-head cards, plus shareable content cards for social platforms and verifiable leaderboard submissions.
- When to use it
- Use it to let an agent practice, benchmark or compare prediction-market judgment with zero financial risk, or to run strategy experiments and backtests on real market data without a wallet.
- Requirements
- Local Python 3.10+ process, run via pip or uvx (pm-trader-mcp), or a self-hosted streamable-http endpoint. Network access to Polymarket's public APIs is needed for live market data; no API key is required. Optional environment variables PM_TRADER_DATA_DIR and PM_TRADER_ACCOUNT set the data directory and account.
Installation
In SourceWeft
- Open Polymarket Paper Trader in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
polymarket-paper-trader
[PyPI] [PyPI downloads] [Tests] [ClawHub] [License: MIT]
A zero-risk gym for AI agents on real prediction markets — real order books, official fees, verified fill fidelity. Practice, evaluate, and benchmark decision intelligence.
Agents make probability judgments all day. Polymarket is the world's largest prediction market, and its order books are the honest scoreboard: real money, real prices, real outcomes. But you cannot hand an agent a wallet to learn with. So this project gives every agent what SWE-bench gave coders — a faithful environment where judgment has consequences and gets scored:
- Practice — your agent trades $10k of paper money against live Polymarket order books, with the same fee model and fill mechanics as the real exchange
- Evaluate — the
polymarket-benchmarkharness in this repository (installed separately) scores any model on prediction-market decision sets (Brier score, calibration, alpha) - Compare — multi-account battles and leaderboards rank agents against each other
- Compete — Forecast Arena: the live public leaderboard where AI models and simple baselines forecast the same Polymarket questions daily and are scored by real outcomes (Brier score). Runs from this repo (enter your model · workflow · raw data).
Part of agent-next — building an agentic world.
60-second demo
Prefer not to install? uvx --from polymarket-paper-trader pm-trader-mcp runs the MCP
server your agent connects to (see Works with below).
That's it. Your AI agent is now trading Polymarket with zero risk.
Install
Requires Python 3.10+.
Works with
Full copy-paste config for every runtime above (plus Grok/xAI remote MCP): docs/integrations.md.
Hosts that implement MCP Apps render portfolio and stats as an
inline dashboard; every other host gets the same text result.
Use it from ChatGPT / Claude.ai / personal agents
Remote mode exists for hosts that only speak HTTP: run
pm-trader-mcp --transport streamable-http with the opt-in --auth-issuer,
--auth-audience and --resource-url flags, then add your server's /mcp
URL in the host's remote-MCP settings. It is off by default, and it needs an
OAuth/OIDC issuer you operate — pm-trader verifies bearer tokens against it
and gives every verified subject its own paper accounts. There is no hosted
endpoint to add: you run the server yourself. Setup, threat model and the
environment equivalents: docs/remote-mcp.md.
Quick start
How it works — and why to trust it
- Your order walks the real book. A buy consumes live ask levels from the lowest price upward, exactly like a real taker order — slippage is real and reported in basis points
- Fees follow the official per-match curve —
fee = C × rate × p × (1-p), rounded to 5 decimals, makers exempt (exact spec in the CHANGELOG) — charged per filled level from each market's published fee schedule, not an approximation - Paper cash, real discipline. Resting buys reserve their cash, partial fills keep their remainder open, closed or paused markets reject trades, and limit prices are validated against tick size
- Resolution pays $1/share. Call
resolve(orresolve --all) when a market closes and winners pay out like the real thing - Verified fidelity. The live test suite asserts that simulated fills land inside the band of prices the market actually quoted (Data API v2 price history) and that fees match the official curve exactly — run against real APIs on CI
- Upstream-aligned. The client tracks the current Gamma / CLOB / Data API surface, contract-verified by live probes
- Multi-outcome markets — any number of outcomes, not just YES/NO
- Kalshi too. Paper trade Kalshi markets with the same commands and tools by passing a
kalshi:<ticker>slug (pm-trader buy kalshi:KXNBAGAME-26OCT16DENLAL-LAL yes 25); find them withkalshi markets. Fees follow each series' published curve (docs/kalshi.md) - 100% coverage gate on the core package, plus end-to-end tests against the live API
CLI commands
Global flags: --data-dir PATH, --account NAME (or env vars PM_TRADER_DATA_DIR, PM_TRADER_ACCOUNT).
MCP server — what your agent can do
Your agent gets the following tools via the Model Context Protocol.
The server also carries the full trading playbook with it — as MCP server
instructions, as a trading_playbook prompt, and as a skill://trading-playbook
resource — so MCP-only clients (Cursor, Claude.ai connectors, Grok API remote
MCP, ChatGPT apps) get the same guidance skill-aware agents get from
skill/polymarket-paper-trader/SKILL.md.
Add to your Claude Code config:
Remote transport (streamable-http)
For MCP clients that only speak HTTP, run the server with --transport streamable-http:
The MCP endpoint is then http://<host>:<port>/mcp. There is no isolation
between callers — everyone who reaches the server shares all of its paper
accounts; it is self-host-only, not a public multi-user service. There is no authentication on this transport;
anyone who can reach the port can call every exposed tool. backtest and
pk_battle (local file reads + local strategy-module execution) are
stdio-only and are not registered when serving over streamable-http.
Docker
Publish the port to 127.0.0.1 only (as above) unless you put a real
authenticating proxy in front of it — the container has no auth of its own.
MCP tools
Strategy examples
Three ready-to-use strategies in examples/:
Momentum (examples/momentum.py)
Buys when YES price crosses above 0.55, takes profit at 0.70, stops loss at 0.35.
Mean reversion (examples/mean_reversion.py)
Buys when YES price drops 12+ cents below 0.50 fair value, sells when it reverts.
Limit grid (examples/limit_grid.py)
Places a grid of limit buy orders below current price with take-profit sells above.
Jev edge (examples/jev_edge.py)
"Jev vs the market": asks Jev for a YES probability per binary market and buys the side it favors, skipping markets priced outside [0.05, 0.95] where fees dominate — pm-trader strategy run examples.jev_edge.run (needs pip install -e "benchmark").
Writing your own strategy
Strategies are imported from the examples. package (the allowlist lives in pm_trader/benchmark.py), so drop your file there:
For backtesting with historical data:
Evaluate your agent: polymarket-benchmark
The paper trader is the gym; the polymarket-benchmark package in this repository is the scoreboard. It is a separate install (not part of the pm-trader CLI — pm-trader strategy replays trading strategies (pm-trader benchmark remains as an alias), see the CLI table above):
Run two models head-to-head to see whose judgment is actually better. Market sets, scoring (Brier, calibration, alpha) and model setup: benchmark/README.md.
Multi-account support
Run parallel strategies with isolated accounts:
Share your results
Generate a shareable stats card and post to X/Twitter:
AI agents can use the stats_card MCP tool to generate and share cards automatically.
Honest limits
- Paper only. No wallet, no keys, no real trades, no real money — ever. Resolution payouts are simulated $1/share
- Simulation quality is verified against live order books and price history, but real execution adds queue position, latency, and counterparty behavior no simulator can promise
- Live market data needs network access to Polymarket's public APIs (no key required)
OpenClaw / ClawHub
Available on ClawHub as polymarket-paper-trader:
GitHub bot
Comment /oc or /opencode on an issue or PR. New issues get a triage reply; non-draft PRs get a shallow review. Implementation starts only if a human adds bot:implement or comments /oc implement (FreeInference deepseek-v4-flash; the implement push uses GITHUB_TOKEN scoped to contents/issues/PRs only — no Actions access — so a separate dispatch-tests job, the only job holding actions: write, re-validates the pushed branch ref, verifies .github/workflows/test.yml on that ref is identical to the default branch, then runs gh workflow run Tests --ref — token pushes do not trigger CI). Merging is always manual: the bot never merges, and required checks are enforced by branch protection. Q&A / triage / review stay on qwen3.6-35b. No wallet, no real trades. Sessions are not shared.
Also in this repository
The paper-trader is the product; three companion packages live alongside it.
See CONTRIBUTING.md for how to work on each package and CHANGELOG.md for release history.
Tests
License
MIT
Source: README.md at commit 55bb35b
Tools
0Version history
8- v0.4.13LatestOct 16, 2026
- v0.4.12Oct 15, 2026
- v0.4.11Oct 15, 2026
- v0.4.10Oct 15, 2026
- v0.4.8Oct 14, 2026
- v0.4.5Oct 1, 2026
- v0.4.2Sep 29, 2026
- v0.4.1Sep 26, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts