The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Polymarket Toolkit listing page.
For anyone who wants to research Polymarket on their own — run the CLI yourself, or install skills for Claude / Cursor / OpenClaw and let AI run the tools. Read-only public APIs. No API keys. No signing.
Nothing to install? probpocket.com/lookup answers the same first question in a browser: paste an address, see lifetime PnL, what the wallet actually makes its money on, and how its leaderboard days compare with its real settled total. Free, no signup. Same public APIs as this CLI.
Machine-readable product facts: ai-info.json · llms.txt. Both are generated from content/ai-identity.json; npm run check:ai-discovery fails on tool, package-version, or output drift.
| I want to… | Start here |
|---|---|
| Research an address | pm profile <addr> · skills polymarket-profile / polymarket-pnl / polymarket-brier |
| See whether they actually cash out | pm cashflow <addr> — on-chain pUSD withdrawals, separated from trade settlement |
| Check execution quality | pm markout <addr> — markout vs market baseline (adverse selection) |
| Classify a trader | pm mix <addr> — passive market maker or aggressive taker |
| Scan markets & prices | pm markets · examples/01,09,11 · docs/cookbook.md |
| Wire my own data pipeline | src/index.ts · cookbook · examples/14 |
| Validation checklists | docs/templates/ — handoff · backtest · paper · live-gate · runbook |
| PnL cross-check (LB snapshot) | pm pnl-check · docs/fee-inclusive-pnl.md |
| Track leaderboard / redeem / activity | pm lb · pm redeem · pm activity · examples/05–08,15–20 |
| Give an AI agent tools | skills/ — copy into Claude / OpenClaw / Cursor |
Full index: docs/toolbox.md
What you get: LB PnL snapshot + first-page positions. For audit-grade PnL, use the polymarket-pnl skill.
V2 merge/split broken? → docs/v2-ctf-ops-faq.md + ./bin/pm v2-check 0x…
pm)Node 22+ (uses --experimental-strip-types). From repo root:
Prefer ./bin/pm from repo root (no install step). Or: npm run pm -- profile … · optional npm link for global pm.
| Command | What it does |
|---|---|
pm profile | LB PnL + open positions sample + Brier hint |
pm activity | Activity pagination + ~4000 row cap warnings |
pm scan | Top markets by 24h volume + spread |
pm updown | Crypto updown event fields / resolution source |
pm v2-check | V2 CTF split/merge checklist + activity sample |
pm lb | Leaderboard snapshot + day-over-day diff |
pm pnl-check | LB snapshot + hints — not audit-grade PnL |
pm limits | Official API rate limit pacing |
pm brier | Brier score from settled positions (sample) |
pm markout | Execution quality — markout vs market baseline |
pm mix | Execution style — maker/taker split, cross-checked against fees |
pm fees | Lifetime taker fees from /activity · pre-fee → net PnL |
pm redeem | Read-only redeem watchdog JSON |
pm markets | Quick Gamma market list |
Audit-grade PnL (Python): python3 skills/polymarket-pnl/compute_precise_pnl.py --address …
pm fees — why your number never matches the profilePolymarket's own PnL — profile,
lb-api, theuser-pnlcurve — is pre-fee. A cashflow replay is post-fee.gap ≈ lifetime taker fees − maker rebates.
The fee is already in /activity: usdcSize is not size × price, and the
residual is what you were charged. That means lifetime fees, per-fill taker
proof, and the pre-fee → net conversion come from one REST call — no RPC, no
receipt decoding, no credentials.
Verified by predicting the gap before comparing, on four wallets: a heavy-taker wallet landed at a $0.84 residual against a $1,308.87 prediction, and a pure maker matched the official number to $0.40.
⚠️ The taker test is one-directional. fee > 0 proves you were the taker —
makers are never charged. fee == 0 means maker or fee-exempt category, so
it is reported as an upper bound on passive share, never as a maker count.
⚠️ Fees are recent. The earliest on record here is late June 2026, rate stepping 0.03 → 0.05 → 0.07. Any reconciliation that passed before then proves nothing about today.
pm markout — is this address getting picked off?Markout is where a fill stands some seconds later: (reference − fill) × direction, in
cents per share. Negative means the price walked away from you — adverse selection.
Three things this command does that a hand-rolled version usually gets wrong:
/trades?user= behaves like takerOnly=true by
default, so a market maker's entire passive side is missing unless you ask for it.Read the excess column and the coverage column together. In short-dated markets a large
tau leaves most fills with nothing ahead of them to be priced against, and the mean
then describes the surviving handful rather than the trader.
Why these three defaults exist. I ran 15 strategies on Polymarket over half a year, and the ones that cost the most failed at measurement, not at strategy: the same logic made +77% on paper and lost −74% live; 18.3% of my own trade records were quietly wrong, two thirds of those being false wins; market-making went 0 for 10 while the platform shipped three fee formulas in a single night. Each flag above is one of those mistakes turned into a default, so it isn't paid for twice.
The full write-up — 15 strategies, 5 deep pits, 14,000 words — is at leolabs.me/pm-quant ($49). It comes with monthly supplement notes; the current one measures a ~300ms server-side floor on taker orders that no colo or private line removes, against 56ms for maker.
Zero-dependency helpers in src/index.ts. Run demos with Node 22+:
examples/ — one numbered script per API patterndocs/cookbook.md — bilingual recipes| Skill | What it does |
|---|---|
polymarket-profile | Deep profile — PnL, win rate, positions, categories, strategy detection |
polymarket-brier | Prediction accuracy scoring, calibration analysis |
polymarket-pnl | Audit-grade PnL via cashflow reconstruction (~0.2% MAPE vs. official) |
Install: copy the chosen skill into the skills directory configured by your agent client.
polymarket-pnl also needs: pip install httpx
Skill details: skills/*/SKILL.md · long-form docs in sections below.
| Included | Not included |
|---|---|
| Read-only APIs, CLI, skills, docs, templates | Private keys, signing, or trade execution |
V2 FAQ + pm v2-check diagnostics | Runnable merge/split/redeem modules |
polymarket-pnl audit script | Custodial wallets or one-click trading |
| Builder attribution helper for future CLOB executors | Builder API credentials or reward guarantees |
Opt-in executor/ sub-package (isolated deps, dry-run default) | Custody, strategy logic, or one-click trading |
mcp/ MCP server — read-only tools for AI agents (docs/mcp.md) | MCP-exposed order placement |
The core (src/, CLI, skills) never holds keys or sends transactions. Order execution lives only in the opt-in executor/ sub-package, which signs with your env-provided key, defaults to dry-run, and is never imported by the core. For normal redemption, use the official Polymarket app.
New to Polymarket? Sign up via the link above (affiliate disclosure: the author may earn referral rewards; no extra cost to you).
Building your own order executor? Start from the opt-in executor/ sub-package (docs/executor.md) — CLOB V2 limit orders with dry-run default, notional cap, and default builder attribution via src/builder.ts (override / opt-out via env). See builder attribution for the disclosure and FAQ. Read-only CLI/skills still do not send orders.
mcp/ — Model Context Protocol server exposing 12 read-only tools (pm_profile, pm_activity, pm_brier, pm_mix, pm_markout, pm_pnl_check, pm_scan, pm_updown, pm_leaderboard, pm_redeem_watchdog, pm_v2_check, pm_rate_limits) — docs/mcp.mdpm, so the server is exactly as read-only as the CLI; inputs are allowlist-validated before reaching argvexecutor/ — isolated CLOB V2 order execution module (docs/executor.md): own dependencies, never imported by the zero-dependency coreEXECUTOR_LIVE=1 to post), notional cap EXECUTOR_MAX_USD (default $10), fail-closed credential validationsrc/builder.ts, full disclosure in docspm CLI — profile · activity · scan · updown · v2-check · brier · redeem · marketsdocs/v2-ctf-ops-faq.md (split/merge/convert · infra alignment)src/builder.ts + docs/builder-attribution.md for future CLOB executors, with default / override / opt-out pathsNew public helper: redeem watchdog — inspect redeemable positions without private keys.
Polymarket's pUSD-era redemption flow handles normal user redemption inside the official app. This release does not replace or work around that flow. It adds a read-only status lane for agents and dashboards: which wallet still has rows surfaced as redeemable=true by the public Data API, what their currentValue is (winning rows pay out, losing rows pay $0), and whether a strategy account is below a configured cash watermark. v0.4 adds fetchRedeemablePositionsPage, summarizeRedeemablePositions, and resolveRedeemMode for that workflow. It never signs or sends transactions.
Also: pm CLI (toolbox drawers) — see docs/toolbox.md.
New Skill: polymarket-pnl — Audit-grade PnL via Data API cashflow reconstruction.
Most profilers (including polymarket-profile) use position-level cashPnL which is an approximation. polymarket-pnl replays every BUY / SELL / REDEEM / MERGE / SPLIT / REBATE event and reconciles against current unrealized position value. Validated against Polymarket's official /profit endpoint on the public leaderboard: MAPE ~0.2%, all top accounts within 1% error. Use this when the number has to hold up to scrutiny.
Inspect redeemable positions for a public proxy wallet without touching keys, allowances, relayers, or transactions.
fetchRedeemablePositionsPage(user) calls Data API /positions?redeemable=truesummarizeRedeemablePositions(rows) groups rows by conditionId and sums currentValue (losing rows contribute $0, which is the correct payable amount — not their size)resolveRedeemMode({ lowWatermark }) returns "watchdog" or "low_watermark". There is intentionally no "active" value: this toolkit never executes a redeem, so an active label belongs in your own wallet system, not here.Three rows surfaced as
redeemable=truebut everycurrentValueis0— they are losing tokens that redeem to$0. The Data API still surfaces them after resolution; the helper reports them honestly without inflating payable value.
This toolkit only reads public APIs. It does not redeem tokens, sign Safe transactions, call relayers, move funds, or require private keys. The official Polymarket app remains the right place for normal user redemption. Treat this helper as a dashboard/agent primitive; execution stays in your own wallet system.
Turn any Polymarket address into a complete trading profile.
The skill instructs your AI agent to call Polymarket's public APIs (lb-api, data-api, gamma-api), process the data, and output a structured profile. No API key needed, no local database, no setup.
Claude Code:
OpenClaw:
Any other AI agent:
Just paste the content of skills/polymarket-profile/SKILL.md into your conversation and ask your AI to follow the instructions.
curl commandsNew to Polymarket? Create an account here.
| Input | Example | Resolution |
|---|---|---|
| 0x address | 0x63ce342161250d705dc0b16df89036c8e5f9ba9a | Direct |
| Profile URL | polymarket.com/profile/Theo4 | Auto-resolve via leaderboard |
| Username | Theo4 | Auto-resolve via leaderboard |
Username lookup works for all leaderboard-ranked users (auto-resolved via lb-api). Unranked accounts (zero trading history) require the 0x address directly.
All public, no authentication required:
| API | What it provides |
|---|---|
lb-api.polymarket.com | PnL, leaderboard rankings |
data-api.polymarket.com | Positions, activity history |
gamma-api.polymarket.com | Market metadata, categories, tags |
pm activity / fetchActivityPages or polymarket-pnl with pagination_incompleteRate any trader's prediction accuracy with Brier Score — the standard metric used by Metaculus, Good Judgment Project, and forecasting research.
| Trader Type | PnL | Brier Score | Signal Value |
|---|---|---|---|
| Skilled predictor | High | Good (low) | Best signal source |
| Market maker | High | Poor (high) | Earns spread, not predictions |
| SPLIT arbitrageur | High | N/A | Market-neutral, no directional view |
| Accurate but cautious | Low | Good (low) | Good signal, small sizing |
After installation: "What's the Brier Score for 0x63ce..." or "How accurate is Theo4's predictions?"
New to Polymarket? Create an account here.
Audit-grade PnL for any Polymarket address via Data API cashflow reconstruction. Replays every BUY / SELL / REDEEM / MERGE / SPLIT / REBATE event and reconciles against current unrealized position value.
Position-level cashPnL (what most profilers surface) is rounded at the position level and drops partial fills, making it approximate. polymarket-pnl walks the full activity log — every trade event, every REDEEM, every MERGE — and computes PnL from the cashflow identity:
Validated on Polymarket's own leaderboard: precise_pnl matches the official /profit endpoint within 0.2% MAPE on top traders.
Output is JSONL with one record per address. See skills/polymarket-pnl/SKILL.md for the full output schema.
polymarket-profile vs polymarket-pnlpolymarket-profile — curl-only, qualitative profile (win rate, positions, categories). Best for "who is this address?"polymarket-pnl — Python + audit-grade cashflow reconstruction. Best for "what is their real PnL?" — writing research, benchmarking a model, or building a dataset.New to Polymarket? Create an account here.
Strategy validation docs from hypothesis → tiny-live (MIT templates):
| Template | Purpose | Path |
|---|---|---|
| AI handoff | Cross-session task handoff (7 fields) | handoff-template.md |
| Backtest report | Conclusions + abandon line | backtest-report-template.md |
| Paper checklist | Anti-fake-paper · fill rules + logging | paper-checklist.md |
| Live gate (12 steps) | Tiny-live technical + ops gates | live-gate-checklist.md |
| Platform change runbook | V2 / API migration response | platform-change-runbook.md |
Also: fee-inclusive-pnl.md · full index: toolbox.md
Templates are document skeletons; runnable paper/live execution code lives in your own repo.
Analysis Tools
pm profile CLI — Quick address snapshotMarket Intelligence
pm scan (24h volume + spread)pm updown + docs/crypto-updown-price-source.mdPlatform / V2
pm v2-check (read-only)Validation templates
Tracking & Alerts
pm lb + snapshot diffpm pnl-checkAPI (planned)
Full map: runesleo — all open-source projects and working systems.
Leo (@runes_leo) — AI × Crypto independent builder. Trading on Polymarket, building data and trading systems with Claude Code and Codex.
leolabs.me — writing · community · open-source tools · indie projects · all platforms.
X Subscription — paid content weekly, or just buy me a coffee 😁
Learn in public, Build in public.
Affiliate disclosure: Polymarket signup links in this repo may earn referral rewards; unrelated to MIT toolkit functionality.