Polymarket Paper Trader logo

Polymarket Paper Trader

Organization
agent-next

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

Publisheragent-next
Repositorypolymarket-paper-trader
LanguagePython
Forks
59
Stars
397
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Polymarket Paper Trader exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    397 stars and 59 forks from the linked repository.

polymarket-paper-trader

PyPI Tests ClawHub License: MIT

Your AI agent just became a Polymarket trader.

Install → your agent gets $10,000 paper money → trades real Polymarket order books → tracks P&L → competes on a public leaderboard. Zero risk. Real prices.

"My AI agent hit +18% ROI on Polymarket in one week. Zero risk, real order books."

Part of 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+.

Not a toy — this is a real exchange simulator

Other tools mock prices or use random numbers. We simulate the actual exchange:

  • Level-by-level order book execution — your order walks the real Polymarket ask/bid book, consuming liquidity at each price level, just like a real trade
  • Exact fee model — bps/10000 × min(price, 1-price) × shares — the same formula Polymarket uses
  • Slippage tracking — every trade records how much worse your fill was vs the midpoint, in basis points
  • Limit order state machine — GTC (good-til-cancelled) and GTD (good-til-date) with full lifecycle
  • Strategy backtesting — replay your strategy against historical price snapshots
  • Multi-outcome markets — not just YES/NO binary, supports any number of outcomes

Your paper P&L would match real P&L within the spread. That's the point.

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

CLI commands

CommandDescription
init [--balance N]Create paper trading account
balanceShow cash, positions value, total P&L
reset --confirmWipe all data
markets list [--limit N] [--sort volume|liquidity]Browse active markets
markets search QUERYFull-text market search
markets get SLUGMarket details
price SLUGYES/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
portfolioOpen positions with live prices
history [--limit N]Trade history
orders place SLUG OUTCOME SIDE AMOUNT PRICELimit order
orders listPending limit orders
orders cancel IDCancel a limit order
orders checkFill limit orders if price crosses
stats [--card|--tweet|--plain]Win rate, ROI, profit, max drawdown
leaderboardLocal account rankings
pk ACCOUNT_A ACCOUNT_BBattle: who's the better trader?
export trades [--format csv|json]Export trade history
export positions [--format csv|json]Export positions
benchmark run MODULE.FUNCRun a trading strategy
benchmark compare ACCT1 ACCT2Compare account performance
benchmark pk STRAT_A STRAT_BBattle: who's the better trader?
accounts listList named accounts
accounts create NAMECreate account for A/B testing
mcpStart 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:

bash
pm-trader-mcp  # starts on stdio

Add to your Claude Code config:

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

MCP tools

ToolWhat it does
init_accountCreate paper account with starting balance
get_balanceCash, positions value, total P&L
reset_accountWipe all data and start fresh
search_marketsFind markets by keyword
list_marketsBrowse markets sorted by volume/liquidity
get_tagsAll market categories/tags for filtering
get_markets_by_tagMarkets in a specific category/tag
get_eventEvent details — a group of related markets
get_marketMarket details with outcomes and prices
get_order_bookLive order book snapshot (bids + asks)
watch_pricesMonitor prices for multiple markets
buyBuy shares at best available prices
sellSell shares at best available prices
portfolioOpen positions with live valuations and P&L
historyRecent trade log with execution details
place_limit_orderLimit order — stays open until filled or cancelled/expired
list_ordersPending limit orders
cancel_orderCancel a pending order
cancel_all_ordersCancel all pending limit orders at once
check_ordersExecute pending orders against live prices
statsWin rate, ROI, profit, max drawdown
resolveResolve a closed market (winners get $1/share)
resolve_allResolve all closed markets
backtestBacktest a strategy against historical snapshots
stats_cardShareable stats card (tweet/markdown/plain)
share_contentPlatform-specific content (twitter/telegram/discord)
leaderboard_entryGenerate verifiable leaderboard submission
leaderboard_cardTop 10 ranking card from all local accounts
pk_cardHead-to-head comparison between two accounts
pk_battleRun two strategies head-to-head, auto-compare

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.

bash
pm-trader benchmark run examples.momentum.run

Mean reversion (examples/mean_reversion.py)

Buys when YES price drops 12+ cents below 0.50 fair value, sells when it reverts.

bash
pm-trader benchmark run examples.mean_reversion.run

Limit grid (examples/limit_grid.py)

Places a grid of limit buy orders below current price with take-profit sells above.

bash
pm-trader benchmark run examples.limit_grid.run

Writing your own strategy

python
# my_strategy.py
from pm_trader.engine import Engine

def run(engine: Engine) -> None:
    """Your strategy receives a fully initialized Engine."""
    markets = engine.api.search_markets("crypto")
    for market in markets:
        if market.closed or market.yes_price < 0.3:
            continue
        engine.buy(market.slug, "yes", 100.0)
bash
pm-trader benchmark run my_strategy.run

For backtesting with historical data:

python
def backtest_strategy(engine, snapshot, prices):
    """Called once per historical price snapshot."""
    if snapshot.midpoint > 0.6:
        engine.buy(snapshot.market_slug, snapshot.outcome, 50.0)

Multi-account support

Run parallel strategies with isolated accounts:

bash
pm-trader --account aggressive init --balance 5000
pm-trader --account conservative init --balance 5000

pm-trader --account aggressive buy some-market yes 500
pm-trader --account conservative buy some-market yes 100

pm-trader benchmark compare aggressive conservative

Share your results

Generate a shareable stats card and post to X/Twitter:

bash
pm-trader stats --tweet    # X/Twitter optimized
pm-trader stats --card     # markdown for Telegram/Discord
pm-trader stats --plain    # plain text

AI agents can use the stats_card MCP tool to generate and share cards automatically.

OpenClaw / ClawHub

Available on ClawHub as polymarket-paper-trader:

bash
npx clawhub install 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. The public bot uses FreeInference (qwen3.6-35b) via a repo Actions secret — no wallet, no real trades. Sessions are not shared.

Tests

bash
pytest -m "not live"             # unit + integration (skips live API tests)
pytest                           # full test suite (requires network)
pytest tests/test_e2e_live.py    # live API integration tests only

Also in this repository

The paper-trader is the product; two companion packages live alongside it.

PackageDirectoryWhat it is
polymarket-benchmarkbenchmark/LLM evaluation harness — "SWE-bench for decision intelligence". Scores models on prediction-market sets (Brier, calibration, alpha). Supports any litellm model and TypeSafe's Jev decision model.
polymarket-leaderboard-clientleaderboard-client/Client SDK for a compatible leaderboard server: register an agent, trade, read portfolio and stats.
bash
pip install -e "benchmark[dev]"
cd benchmark && polymarket-benchmark run --model opencode/jev-1.13-free --market-set mini

See CONTRIBUTING.md for how to work on each package.

License

MIT

Installation

TypingMind
{
  "mcpServers": {
    "polymarket-paper-trader": {
      "command": "pm-trader-mcp",
      "args": []
    }
  }
}

Use Polymarket Paper Trader MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Polymarket Paper Trader is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Polymarket Paper Trader as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Polymarket Paper Trader MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "polymarket-paper-trader": {
      "command": "npx",
      "args": [
        "-y",
        "polymarket-paper-trader"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Polymarket Paper Trader MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Polymarket Paper Trader MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Polymarket Paper Trader to help me with this task?
Polymarket Paper Trader
Sure. I read it.
Here is what I found using Polymarket Paper Trader.

Frequently asked questions

What is the Polymarket Paper Trader MCP server used for?

Polymarket Paper Trader is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Polymarket Paper Trader MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Polymarket Paper Trader with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Polymarket Paper Trader MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Polymarket Paper Trader connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Polymarket Paper Trader MCP to TypingMind?

Polymarket Paper Trader runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Polymarket Paper Trader MCP provide in TypingMind?

Polymarket Paper Trader exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Polymarket Paper Trader MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Polymarket Paper Trader requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇