blockrun_polymarket
Trade on Polymarket prediction markets with real pUSD via gasless orders. Setup deposit wallet, place limit/market bets, manage orders, redeem winnings, and withdraw USDC.
Instructions
Trade on Polymarket prediction markets (CLOB V2, Polygon). REAL MONEY — orders spend pUSD held in your Polymarket deposit wallet, signed locally by your BlockRun key. Free tool (no BlockRun API charge); discover markets/prices/token IDs with blockrun_markets first.
Run action:"setup" FIRST (and again after funding). It creates a gasless deposit wallet owned by your key, checks pUSD balance + exchange approvals, and prints funding instructions. Zero config — no Polymarket account or API keys; setup bootstraps its credentials from your wallet key.
Actions:
setup — create/inspect deposit wallet, funding, approvals (confirm:true to sign the approval batch), region check. Idempotent.
fund — top up the deposit wallet from your OWN Base USDC, gasless (confirm:true). amount_usd required. BlockRun pays the gas + charges $0.01; you need no ETH. Non-custodial (USDC → Polymarket bridge → your vault).
buy / sell — token_id (or condition_id+outcome) + either price+size (limit) or amount_usd (market buy) / size (market sell). confirm:true REQUIRED to place; omitting it returns a dry-run preview. Per-order cap: POLYMARKET_MAX_BET_USD (default $25).
orders — list open orders (optional condition_id filter)
cancel — order_id:"…" or all:true
positions — holdings incl. redeemable winnings (free Data-API)
redeem — claim resolved winnings for condition_id (confirm:true; gasless)
withdraw — cash out pUSD → native USDC on Base to your agent wallet (confirm:true). amount_usd optional (default: full balance); to_address optional (default: your wallet).
Prices are probabilities 0–1 on the market's tick grid. token_id comes from blockrun_markets Polymarket data. Geoblock is handled by default (CLOB traffic routes through BlockRun's Finland egress) — setup reports your region status. Complying with Polymarket's terms for the user's jurisdiction is the user's responsibility.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| all | No | cancel: cancel ALL open orders | |
| size | No | Shares — required for limit orders and market sells | |
| price | No | Limit price as probability (0–1). Omit for a market order. | |
| action | Yes | Operation to perform | |
| confirm | No | Must be true to place orders / sign approvals / redeem. Omit for a dry-run preview. | |
| outcome | No | Outcome label (e.g. 'Yes') — used with condition_id when token_id is omitted | |
| agent_id | No | Tag for the session betting ledger (bets do NOT draw from the x402 API budget) | |
| order_id | No | Order ID to cancel | |
| token_id | No | Outcome token ID (decimal ERC-1155 id from blockrun_markets clobTokenIds) | |
| post_only | No | Maker-only limit order (rejected if it would cross the book) | |
| amount_usd | No | pUSD dollars — to spend (market buy) or to cash out (withdraw; default full balance) | |
| expires_at | No | Unix seconds expiry (GTD only, ≥ ~3 min in the future) | |
| order_type | No | Default: GTC for limit orders, FOK for market orders | |
| to_address | No | withdraw: destination address on Base (default: your agent wallet) | |
| condition_id | No | Market condition ID (0x…). With `outcome` it resolves token_id; required for redeem. |