From polygon-agent-cli
Places bets on Polymarket prediction markets via the Polygon Agent CLI. Browse markets, check prices, buy/sell YES/NO positions, manage orders. Dry-run by default.
How this skill is triggered — by the user, by Claude, or both
Slash command
/polygon-agent-cli:polygon-polymarketThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Before any polymarket command, verify the Polymarket key is set:
Before any polymarket command, verify the Polymarket key is set:
polygon-agent polymarket proxy-wallet
If this returns ok: true with an eoaAddress and proxyWalletAddress, the key is configured and you can proceed directly to trading. If it errors, the user needs to run set-key (see Onboarding below).
Every Polymarket user has three addresses. Do not confuse them:
| Name | What it is | Used for |
|---|---|---|
| EOA | Private key owner. Shown as eoaAddress in CLI output | Signs transactions and CLOB orders. Needs POL for gas only when running approve |
| Proxy Wallet | Shown as proxyWalletAddress in CLI output. This is what Polymarket shows as "your address" in the UI | Holds pUSD and outcome tokens. The CLOB maker |
| Smart Wallet | The Sequence wallet (polygon-agent wallet) | Funds the proxy wallet with USDC.e per trade (auto-wrapped to pUSD) |
For trading: USDC.e flows from the Sequence smart wallet → proxy wallet → auto-wrapped to pUSD → CLOB orders. The proxy wallet is the trading identity.
Before placing a trade, verify these four things in order:
1. EOA key is configured
polygon-agent polymarket proxy-wallet
# → must return ok: true with eoaAddress and proxyWalletAddress
2. ToS accepted on Polymarket ← one-time per EOA, permanent
not authorized3. Proxy wallet approvals set for V2 exchange ← required for all users after V2 migration
approve --broadcast after the V2 migration (April 28 2026) — V1 approvals on old exchange contracts do not carry over4. Smart wallet has USDC.e ← required per trade, minimum $1
polygon-agent balances
# → check USDC.e balance (0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174)
# → must have at least $1 USDC.e to place any order
# → USDC.e is auto-wrapped to pUSD during the buy flow
Step 1: Get the private key from Polymarket
1. Go to: https://reveal.magic.link/polymarket
2. Connect/authenticate with the same email used for Polymarket
3. Copy the exported private key (0x...)
Step 2: Import the key into the CLI
polygon-agent polymarket set-key <privateKey>
Output confirms the eoaAddress and proxyWalletAddress.
Step 3: Show the user their addresses
polygon-agent polymarket proxy-wallet
Tell the user: "Your EOA is <eoaAddress> — this needs a small amount of POL for the one-time approval step. Your Polymarket trading address (proxy wallet) is <proxyWalletAddress> — this is where your pUSD and outcome tokens live."
Step 4: Fund EOA with POL for gas (approval step only)
polygon-agent send-native --to <eoaAddress> --amount 0.1 --broadcast
The EOA only needs POL for the one-time approve transaction. After that, trading requires no gas from the EOA.
Step 5: Accept Terms of Service
1. Go to https://polymarket.com
2. Connect with the EOA address
3. Accept Terms of Service when prompted
Step 6: Set proxy wallet approvals for V2 (one-time, permanent)
polygon-agent polymarket approve --broadcast
This sets approvals for the V2 exchange contracts and CollateralOnramp. Permanent on-chain — never needs to be run again for this EOA.
Step 1: Confirm addresses
polygon-agent polymarket proxy-wallet
Step 2: Accept Terms of Service (required)
1. Go to https://polymarket.com
2. Connect with the EOA address shown above
3. Accept Terms of Service when prompted
Step 3: Fund EOA with POL for gas
polygon-agent send-native --to <eoaAddress> --amount 0.1 --broadcast
Step 4: Set proxy wallet approvals for V2 (one-time)
polygon-agent polymarket approve --broadcast
# List top markets by volume
polygon-agent polymarket markets
# Search by keyword
polygon-agent polymarket markets --search "bitcoin" --limit 10
# Paginate
polygon-agent polymarket markets --limit 20 --offset 20
Key output fields per market:
conditionId — the ID needed for all trading commandsquestion — what the market is askingyesPrice / noPrice — current probability (0 to 1, e.g. 0.65 = 65%)negRisk — if true, set neg-risk approvals before trading this marketendDate — when the market resolvespolygon-agent polymarket market <conditionId>
Use this to confirm prices and token IDs before placing an order.
polygon-agent polymarket proxy-wallet
Confirms which EOA and proxy wallet are active. The proxy wallet is where pUSD and tokens are held.
# Standard markets
polygon-agent polymarket approve --broadcast
# Neg-risk markets (only if you see negRisk: true on a market you want to trade)
polygon-agent polymarket approve --neg-risk --broadcast
All users must run this after the V2 migration — previous V1 approvals on old exchange contracts do not carry over. V2 approvals cover: pUSD → V2 exchange, CTF → V2 exchange, and USDC.e → CollateralOnramp (for wrapping). Once set, they are permanent on-chain.
# Dry-run first — always check before executing
polygon-agent polymarket clob-buy <conditionId> YES|NO <usdcAmount>
# Execute — funds proxy wallet, wraps USDC.e → pUSD, then places order
polygon-agent polymarket clob-buy <conditionId> YES|NO <usdcAmount> --broadcast
# If proxy wallet already has pUSD from a previous failed order (skip the funding step)
polygon-agent polymarket clob-buy <conditionId> YES|NO <usdcAmount> --skip-fund --broadcast
# Limit order — fill only at this price or better
polygon-agent polymarket clob-buy <conditionId> YES <usdcAmount> --price 0.45 --broadcast
How it works:
usdcAmount USDC.e to the proxy wallet (Sequence tx)Order types:
--price: FOK market order (fill entirely or cancel)--fak: FAK market order (partial fills allowed)--price 0.x: GTC limit order (stays open until filled or cancelled)Minimum order size: $1. The CLOB rejects orders below $1. If the fund+wrap step runs but the order is rejected, the pUSD stays in the proxy wallet — use --skip-fund on the retry.
# Dry-run first
polygon-agent polymarket sell <conditionId> YES|NO <shares>
# Execute
polygon-agent polymarket sell <conditionId> YES|NO <shares> --broadcast
# Limit sell
polygon-agent polymarket sell <conditionId> YES <shares> --price 0.80 --broadcast
<shares> is the number of outcome tokens (not USD). Get share count from positions.
Selling is pure off-chain — no gas, no on-chain tx. Proceeds are received as pUSD in the proxy wallet.
polygon-agent polymarket positions
Shows all open positions in the proxy wallet with current value, P&L, and outcome.
polygon-agent polymarket orders
Lists GTC limit orders that are still open (FOK/FAK orders are never "open" — they fill or cancel immediately).
polygon-agent polymarket cancel <orderId>
Get orderId from the orders command or from the orderId field in clob-buy output.
# ── FIRST TIME (run once per EOA) ──────────────────────────────────────
# 1. Import Polymarket private key
polygon-agent polymarket set-key 0x<yourPrivateKey>
# → save eoaAddress and proxyWalletAddress
# 2. Accept ToS at https://polymarket.com (connect EOA, accept when prompted)
# 3. Fund EOA with POL for the one-time approval tx
polygon-agent send-native --to <eoaAddress> --amount 0.1 --broadcast
# 4. Set V2 approvals (one-time, permanent — covers pUSD, CTF, and CollateralOnramp)
polygon-agent polymarket approve --broadcast
# ── RETURNING USER ──────────────────────────────────────────────────────
# If V2 approvals were already set: skip steps 1-4, go straight to trading.
# NOTE: V1 approvals (pre-April 28 2026) do NOT carry over — re-run approve once.
# ── FIND A MARKET ────────────────────────────────────────────────────────
# 5. Search for markets
polygon-agent polymarket markets --search "bitcoin" --limit 10
# 6. Get details on a specific market
polygon-agent polymarket market 0x<conditionId>
# → check: yesPrice, noPrice, negRisk, endDate
# → if negRisk: true → run approve --neg-risk --broadcast first
# ── ENTER A POSITION ────────────────────────────────────────────────────
# 7. Dry-run to confirm
polygon-agent polymarket clob-buy 0x<conditionId> YES 5
# → review: currentPrice, proxyWalletAddress, flow (includes pUSD wrapping)
# 8. Execute
polygon-agent polymarket clob-buy 0x<conditionId> YES 5 --broadcast
# → check: orderStatus === "matched"
# ── MANAGE ──────────────────────────────────────────────────────────────
# 9. Check positions
polygon-agent polymarket positions
# → review: size (shares), curPrice, cashPnl
# 10. Sell when ready
polygon-agent polymarket sell 0x<conditionId> YES <shares> --broadcast
# → orderStatus === "matched" means pUSD is back in proxy wallet
When deciding whether to buy:
proxy-wallet — confirm EOA and proxy wallet addressesbalances — confirm smart wallet has at least $1 USDC.epositions — avoid doubling up on already-held positionsmarkets — use yesPrice/noPrice as probability inputsnegRisk on the target market — if true, verify neg-risk approvals were set--skip-fund if the proxy wallet already has enough pUSD from a previous attemptWhen deciding whether to sell:
size (shares) from positionscurPrice vs avgPrice to assess profit/losssell --broadcast) for immediate exit--price 0.x --broadcast) to wait for a better price| Error | Cause | Fix |
|---|---|---|
No EOA key found | set-key not run | Run polygon-agent polymarket set-key <pk> |
Could not create api key (stderr only) | ToS not accepted | Non-fatal — CLI retries with deriveApiKey and may still succeed. If orders fail too, visit polymarket.com and accept ToS with the EOA |
CLOB order error: not authorized | ToS not accepted | Visit polymarket.com, connect EOA wallet, accept terms |
insufficient funds for gas | EOA has no POL | polygon-agent send-native --to <eoaAddress> --amount 0.1 --broadcast |
Market not found | Low-volume or closed market | Market may have resolved; try --search with different terms |
Market has no tokenIds | Closed market | Check endDate — market resolved |
orderStatus: "unmatched" on FOK | No liquidity at market price | Try --fak for partial fill, or --price 0.x for limit order |
invalid amount for a marketable BUY order ($X), min size: $1 | Amount below CLOB minimum | Use at least $1. If pUSD was already funded, retry with --skip-fund |
Wallet not found: main | No Sequence wallet | Run polygon-agent wallet create |
No signer supported for call | Wallet session missing USDC.e whitelist | Re-create wallet session: polygon-agent wallet create --name main |
| Approvals tx reverts after V2 migration | V1 approvals — wrong exchange contracts | Re-run polygon-agent polymarket approve --broadcast for V2 contracts |
approve, clob-buy, sell do nothing without --broadcast.approve --broadcast once after migration.clob-buy handles the full flow automatically: transfers USDC.e from smart wallet → proxy wallet, wraps USDC.e → pUSD, then places the CLOB order (unless --skip-fund).positions queries the proxy wallet.orderStatus: "matched" means the trade filled. "unmatched" means FOK failed (no liquidity).feeRateBps on orders.Could not create api key in stderr is non-fatal. The CLI handles this automatically.npx claudepluginhub 0xpolygon/polygon-agent-cliTrade on Polymarket prediction markets on Polygon: browse markets, check wallet/CLOB balances, buy/sell YES/NO shares with safety gates. Uses Node.js scripts, WDK vault, and auto-setup.
Interacts with Polymarket prediction markets to search events, check odds, place USDC.e bets on Polygon, and manage positions.
Trade on prediction markets (Polymarket, Kalshi). Search markets, buy/sell positions, track PnL, and view trade history.