Skip to main content
ClaudeWave
agent-next avatar
agent-next

polymarket-paper-trader

Ver en GitHub

Paper trading simulator for Polymarket — built for AI agents. MCP server, live order books, strategy backtesting. Install: npx clawhub install polymarket-paper-trader

MCP ServersRegistry oficial399 estrellas59 forks● PythonMITActualizado today
ClaudeWave Trust Score
100/100
✓ Verified
Passed
  • ✓Open-source license (MIT)
  • ✓Actively maintained (<30d)
  • ✓Healthy fork ratio
  • ✓Clear description
  • ✓Topics declared
  • ✓Documented (README)
Last scanned: 9/26/2026
Install in Claude Code / Claude Desktop
Method: NPX · clawhub
Claude Code CLI
claude mcp add polymarket-paper-trader -- npx -y clawhub
claude_desktop_config.json (Claude Desktop)
{
  "mcpServers": {
    "polymarket-paper-trader": {
      "command": "npx",
      "args": ["-y", "clawhub"]
    }
  }
}
1. Run the command above in your terminal (Claude Code), or paste the JSON config into claude_desktop_config.json (Claude Desktop).
2. Replace any <placeholder> values with your API keys or paths.
3. Restart Claude. The MCP server and its tools appear automatically.
Casos de uso

Resumen de MCP Servers

# polymarket-paper-trader

[![PyPI](https://img.shields.io/pypi/v/polymarket-paper-trader.svg)](https://pypi.org/project/polymarket-paper-trader/)
[![Tests](https://github.com/agent-next/polymarket-paper-trader/actions/workflows/test.yml/badge.svg)](https://github.com/agent-next/polymarket-paper-trader/actions/workflows/test.yml)
[![ClawHub](https://img.shields.io/badge/ClawHub-install-orange.svg)](https://clawhub.com/robotlearning123/polymarket-paper-trader)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/agent-next/polymarket-paper-trader/blob/main/LICENSE)

**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-benchmark` harness 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

Part of [agent-next](https://github.com/agent-next) — building an agentic world.

## 60-second demo

```bash
npx clawhub install polymarket-paper-trader    # install via ClawHub
pm-trader init --balance 10000                 # $10k paper money
pm-trader markets search "bitcoin"             # find markets
pm-trader buy will-bitcoin-hit-100k yes 500    # buy $500 of YES
pm-trader stats --card                         # shareable stats card
```

That's it. Your AI agent is now trading Polymarket with zero risk.

## Install

```bash
# via pip
pip install polymarket-paper-trader

# via ClawHub (for OpenClaw agents)
npx clawhub install polymarket-paper-trader

# from source (development)
uv pip install -e ".[dev]"
```

Requires Python 3.10+.

## Works with

| Runtime | One-line install |
|---|---|
| Claude Code | `/plugin marketplace add agent-next/polymarket-paper-trader` |
| Codex CLI | `codex mcp add polymarket-paper-trader -- uvx --from polymarket-paper-trader pm-trader-mcp` |
| Cursor | [![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.png)](cursor://anysphere.cursor-deeplink/mcp/install?name=polymarket-paper-trader&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyItLWZyb20iLCJwb2x5bWFya2V0LXBhcGVyLXRyYWRlciIsInBtLXRyYWRlci1tY3AiXX0=) |
| Gemini CLI | `gemini extensions install https://github.com/agent-next/polymarket-paper-trader` |
| OpenCode / Goose / Cline / Windsurf / Copilot | add `pm-trader-mcp` to the client's MCP config |
| OpenClaw / ClawHub | `npx clawhub install polymarket-paper-trader` |
| Hermes Agent / LangChain / OpenAI Agents SDK / CrewAI | wrap `uvx --from polymarket-paper-trader pm-trader-mcp` |

Full copy-paste config for every runtime above (plus Grok/xAI remote MCP): [docs/integrations.md](docs/integrations.md).

## Quick start

```bash
# Initialize with $10k paper balance
pm-trader init --balance 10000

# Browse markets
pm-trader markets list --sort liquidity
pm-trader markets search "bitcoin"

# Trade
pm-trader buy will-bitcoin-hit-100k yes 100      # buy $100 of YES
pm-trader sell will-bitcoin-hit-100k yes 50       # sell 50 shares

# Check portfolio and P&L
pm-trader portfolio
pm-trader stats
```

## 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](CHANGELOG.md)) — 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` (or `resolve --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
- **100% coverage gate** on the core package, plus end-to-end tests against the live API

## CLI commands

| Command | Description |
|---------|-------------|
| `init [--balance N]` | Create paper trading account |
| `balance` | Show cash, reserved/available cash, positions value, total P&L |
| `reset --confirm` | Wipe all data |
| `markets list [--limit N] [--sort volume\|liquidity]` | Browse active markets |
| `markets search QUERY` | Full-text market search |
| `markets get SLUG` | Market details |
| `markets tags` | List all market categories/tags |
| `markets event SLUG` | Event details — a group of related markets |
| `price SLUG` | YES/NO midpoints and spread |
| `book SLUG [--depth N]` | Order book snapshot |
| `watch SLUG [SLUG...] [--outcome yes\|no]` | Monitor live prices |
| `buy SLUG OUTCOME AMOUNT [--type fok\|fak]` | Buy at market price |
| `sell SLUG OUTCOME SHARES [--type fok\|fak]` | Sell at market price |
| `portfolio` | Open positions with live prices |
| `history [--limit N]` | Trade history |
| `orders place SLUG OUTCOME SIDE AMOUNT PRICE` | Limit order (GTC/GTD) |
| `orders list` | Open limit orders (pending and partially filled) |
| `orders cancel ID` | Cancel a limit order |
| `orders cancel-all` | Cancel all pending limit orders at once |
| `orders check` | Fill limit orders if price crosses |
| `stats [--card\|--tweet\|--plain]` | Win rate, ROI, profit, max drawdown |
| `resolve [SLUG] [--all]` | Resolve a closed market, or all closed markets (winners get $1/share) |
| `leaderboard` | Local account rankings |
| `pk ACCOUNT_A ACCOUNT_B` | Battle: who's the better trader? |
| `export trades [--format csv\|json]` | Export trade history |
| `export positions [--format csv\|json]` | Export positions |
| `strategy run MODULE.FUNC` | Run a trading strategy |
| `strategy compare ACCT1 ACCT2` | Compare account performance |
| `strategy pk STRAT_A STRAT_B` | Battle: who's the better trader? |
| `benchmark run MODULE.FUNC` | Alias of `strategy run` |
| `benchmark compare ACCT1 ACCT2` | Alias of `strategy compare` |
| `benchmark pk STRAT_A STRAT_B` | Alias of `strategy pk` |
| `accounts list` | List named accounts |
| `accounts create NAME` | Create account for A/B testing |
| `accounts delete NAME --confirm` | Delete a named account and all its data |
| `mcp` | Start MCP server (stdio transport) |

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](https://modelcontextprotocol.io).
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`](skill/polymarket-paper-trader/SKILL.md).

```bash
pm-trader-mcp  # starts on stdio

# or, with no local install:
uvx --from polymarket-paper-trader pm-trader-mcp
```

Add to your Claude Code config:

```json
{
  "mcpServers": {
    "polymarket-paper-trader": {
      "command": "pm-trader-mcp"
    }
  }
}
```

### Remote transport (streamable-http)

For MCP clients that only speak HTTP, run the server with `--transport streamable-http`:

```bash
pm-trader-mcp --transport streamable-http --host 0.0.0.0 --port 8000
# or: pm-trader mcp --transport streamable-http --host 0.0.0.0 --port 8000
```

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

```bash
docker build -t pm-trader-mcp .
docker run -p 127.0.0.1:8000:8000 -v pm-trader-data:/root/.pm-trader pm-trader-mcp
```

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

| Tool | What it does |
|------|---------|
| `init_account` | Create paper account with starting balance |
| `get_balance` | Cash, reserved/available cash, positions value, total P&L |
| `reset_account` | Wipe all data and start fresh |
| `search_markets` | Find markets by keyword |
| `list_markets` | Browse markets sorted by volume/liquidity |
| `get_tags` | All market categories/tags for filtering |
| `get_markets_by_tag` | Markets in a specific category/tag |
| `get_event` | Event details — a group of related markets |
| `get_market` | Market details with outcomes and prices |
| `get_order_book` | Live order book snapshot (bids + asks) |
| `watch_prices` | Monitor prices for multip
ai-agentalgorithmic-tradingbacktestingclawhubmcpopenclawpaper-tradingpolymarketprediction-marketspythonsqlitetrading-bot

Lo que la gente pregunta sobre polymarket-paper-trader

¿Qué es agent-next/polymarket-paper-trader?

+

agent-next/polymarket-paper-trader es mcp servers para el ecosistema de Claude AI. Paper trading simulator for Polymarket — built for AI agents. MCP server, live order books, strategy backtesting. Install: npx clawhub install polymarket-paper-trader Tiene 399 estrellas en GitHub y su última actualización registrada es del 2026-09-26.

¿Cómo se instala polymarket-paper-trader?

+

Puedes instalar polymarket-paper-trader clonando el repositorio (https://github.com/agent-next/polymarket-paper-trader) o siguiendo las instrucciones del README en GitHub. ClaudeWave también te ofrece bloques de instalación rápida en esta misma página.

¿Es seguro usar agent-next/polymarket-paper-trader?

+

Nuestro agente de seguridad ha analizado agent-next/polymarket-paper-trader y le ha asignado un Trust Score de 100/100 (tier: Verified). Revisa el desglose completo de comprobaciones superadas y flags en esta página.

¿Quién mantiene agent-next/polymarket-paper-trader?

+

agent-next/polymarket-paper-trader es mantenido por agent-next. La última actividad registrada en GitHub es del 2026-09-26, con 0 issues abiertos.

¿Hay alternativas a polymarket-paper-trader?

+

Sí. En ClaudeWave puedes explorar mcp servers similares en /categories/mcp, ordenados por popularidad o actividad reciente.

Despliega polymarket-paper-trader en tu cloud

Lleva este repo a producción en minutos. Cada plataforma genera su propio entorno con variables de entorno editables.

¿Mantienes este repo? Añade un badge a tu README

Pega el badge en tu README de GitHub para mostrar que está auditado por ClaudeWave. Cada badge enlaza de vuelta a esta página y muestra el Trust Score actual.

Featured on ClaudeWave: agent-next/polymarket-paper-trader
[![Featured on ClaudeWave](https://claudewave.com/api/badge/agent-next-polymarket-paper-trader)](https://claudewave.com/repo/agent-next-polymarket-paper-trader)
<a href="https://claudewave.com/repo/agent-next-polymarket-paper-trader"><img src="https://claudewave.com/api/badge/agent-next-polymarket-paper-trader" alt="Featured on ClaudeWave: agent-next/polymarket-paper-trader" width="320" height="64" /></a>

Más MCP Servers

Alternativas a polymarket-paper-trader