Remote OpenClaw Blog
How to Build a Polymarket Copy-Trading Bot With Claude
5 min read ·
A Polymarket copy-trading bot with Claude should read the public leaderboard and positions APIs, build a target portfolio, and then send guarded marketable orders through the CLOB API only from an eligible region. Polymarket's API overview, leaderboard docs, positions docs, and the geoblock docs are the core sources. As of April 21, 2026, Polymarket's documentation lists `US` as blocked for opening orders.
The right architecture
A good copy-trading bot mirrors exposures, not impulses.
The clean design is straightforward. Pull top traders from the leaderboard. Fetch each trader's current positions. Convert those positions into a target allocation for your own bankroll. Then compare that target book against your current holdings and decide what to buy or sell. This is safer than blindly replaying every observed trade because leader activity can be stale, partial, or already offset.
Claude belongs in the planning layer. It can help reason about which wallets to follow, how to summarize portfolio concentration, and when to flag suspicious or overconcentrated plans. It should not be the source of trade thesis or a substitute for market risk controls.
Use public leaderboards and positions first
Polymarket already exposes the public data needed to build the discovery and planning part of the bot.
| Need | Endpoint family | Why it matters |
|---|---|---|
| Find top traders | Leaderboard API | Select which wallets to mirror |
| See current holdings | Positions API | Build target allocations from active exposure |
| Place or cancel orders | CLOB API | Execution layer for live trading |
| Eligibility | Geoblock endpoint | Stop orders from blocked regions before submission |
Polymarket's introduction page separates public Data API use from authenticated CLOB use clearly. That is the right way to structure your bot too. Plan from public data first. Trade only after the plan passes your own risk checks.
Use Claude for plan generation and risk checks
Claude is useful when it turns raw portfolio data into a reviewable action plan.
For example, you can pass Claude a JSON object containing the followed wallets, their position weights, your bankroll, your maximum order size, and your current exposure. Then ask it to produce a human-readable plan, identify concentration risk, and flag markets expiring soon. That is much more defensible than asking Claude which side of a market to bet on.
Best Next Step
If that last section felt like a lot - use the marketplace to find the configured version.
{
"leaders": ["0xabc...", "0xdef..."],
"bankroll_usd": 250,
"max_order_usd": 50,
"positions": [
{"title": "Will X happen?", "outcome": "YES", "weight": 0.18, "expiry_hours": 96},
{"title": "Will Y happen?", "outcome": "NO", "weight": 0.12, "expiry_hours": 240}
]
}
The model can summarize and critique that plan. Your code should still enforce the actual sizing, region checks, and order placement rules.
Execute through the CLOB API with guardrails
Polymarket executes trades through its CLOB API, and the safest implementation is a dry-run-first bot that only goes live after passing a geoblock and risk check.
Polymarket's orders overview explains that all orders are expressed as limit orders and that market behavior is achieved by sending a marketable limit price. That is exactly how a copy bot should work: compute the delta between your current portfolio and the mirrored target, then place bounded orders with explicit slippage and max-size rules.
I added an example implementation in this repo under `scripts/polymarket-copy-bot/` that follows this pattern. It defaults to dry-run mode, checks `https://polymarket.com/api/geoblock`, and only attempts live order placement when you opt in explicitly.
Risk controls you should not skip
The minimum control set is geoblock, max order size, min position threshold, expiry filtering, and a dry-run diff.
On top of that, I would add a concentration cap per market, a maximum number of followed wallets, a blocked-markets list, and a review step for selling out of positions. If your copy bot simply clones everything a top trader does with no rebalance logic, no slippage rules, and no concentration limits, it is not really a strategy. It is just a fast way to inherit someone else's risk.
Limitations and Tradeoffs
This is not financial advice, and it is not a safe default strategy just because the data is public. A leaderboard-driven bot is backward-looking, can inherit stale exposure, and can overfit to short-term PnL snapshots. It also has legal and geographic constraints. As of April 21, 2026, Polymarket's own docs say the United States is blocked for opening orders, so any live-trading use case from the US is dead on arrival unless the platform's rules change.
Related Guides
- How to Build an AI Agent from Scratch
- AI Agent Tool Calling Explained
- Claude Code Opus 4.7
- Autonomous Agents and Real Money
FAQ
What data do I need for a Polymarket copy-trading bot?
You need at least the leaderboard to find candidate wallets, the positions endpoint to inspect their active holdings, and the CLOB API for execution. Those three layers are enough to build a mirror plan, compare it against your current holdings, and place bounded orders if your region is eligible.
Should a copy bot mirror trades or positions?
Positions are usually safer. Mirroring raw trades can copy noise, partial hedges, or stale activity. A position-based approach lets you estimate the trader's current exposure and build your own target book more deliberately.
What should Claude do in this bot?
Claude should help explain and critique the plan, not decide the market thesis. It is well suited to summarizing followed wallets, checking for concentration, flagging short-dated positions, and producing a human-readable rebalance plan before orders are sent.
Can I run this bot from the United States?
As of April 21, 2026, Polymarket's official geoblock documentation lists `US` as blocked for new orders. The example bot in this repo checks the geoblock endpoint and refuses live trading when the requesting IP is blocked.
Frequently Asked Questions
What data do I need for a Polymarket copy-trading bot?
You need at least the leaderboard to find candidate wallets, the positions endpoint to inspect their active holdings, and the CLOB API for execution. Those three layers are enough to build a mirror plan, compare it against your current holdings, and place bounded orders if your region is eligible.