Polymarket
Trade Polymarket from your agent
Search markets, read order books and positions, and place limit orders on Polymarket. Reads need only a payment client. Trading adds the wallet, which signs on your machine while ChainHilt submits to the venue. Nothing is held for you: no keys and no funds.
Read the market, no wallet needed
Market search, market detail, order books, events, positions and activity cost $0.001 each.
GET https://chainhilt.ai/api/v1/predict/polymarket/markets/search?query=bitcoin&limit=5A market's detail lists its outcomes with their token IDs and its resolution rules. Its book shows bids and asks per outcome. Short-horizon markets, such as the 5-minute crypto slots, never match a text query: list them with sort=closingTime and closingBefore instead.
Set up a trading account, once
Mint venue credentials (free)
POST /api/v1/predict/polymarket/credentials/preparewith your account, thenprocess_action, returns acredentialToken. It is your venue API credentials, sealed: the server stores nothing. Treat it as a secret, and revoke it withcredentials/revokewhen you are done.Set up the deposit wallet ($0.01 per step)
Orders come from a deposit wallet derived from your signer.
wallet/{signer}/onboard/preparethenprocess_actiondeploys it; call it again for the trading approvals. Both steps are gasless.Fund it
GET /api/v1/predict/polymarket/wallet/{signer}is free and returns the next onboarding step and the bridge deposit addresses. Send USDC on Base, Ethereum, Arbitrum or Polygon; it arrives as pUSD, the venue's collateral.
Place an order
Quote ($0.001)
POST /api/v1/predict/polymarket/quoteswalks the live book and returns the average and worst price for your size. Nothing is reserved.Construct ($0.01)
Authorize, then send
POST /api/v1/predict/polymarket/orders/constructwith thecredentialTokenin the body. Review the order summary and both fees, ChainHilt's builder fee and Polymarket's taker fee, which are paid on top of the principal.Sign
process_actionsigns the order and ChainHilt submits it to the venue. The result carries the order ID and its status.
Orders are limits only (GTC or GTD). To trade right away, construct a GTC at the quote's worst price and cancel any remainder.
Manage orders and positions
- Open orders, order status, cancel, cancel a market, and cancel everything are free. Each takes the
credentialTokenin the request body. - Positions and activity show holdings, fills and redemptions. Resolved winning positions are usually redeemed into pUSD automatically within seconds.
- Funding and withdrawals are not reversible.
Endpoints
| Endpoint | Price | What it does |
|---|---|---|
GET /api/v1/predict/polymarket/wallet/{signer} | Free | Onboarding and funding status for a venue trading wallet |
POST /api/v1/predict/polymarket/wallet/{signer}/deposit/prepare | Free | Prepare the transfer that funds a venue trading wallet |
POST /api/v1/predict/polymarket/credentials/prepare | Free | Start the venue credential handshake (returns a signature action) |
POST /api/v1/predict/polymarket/credentials | Free | Exchange the signed credential challenge for a sealed credentialToken |
POST /api/v1/predict/polymarket/credentials/revoke | Free | Revoke the venue API credentials behind a credentialToken |
POST /api/v1/predict/polymarket/orders/submit | Free | Submit a signed construction to the venue (wallet submitPath) |
POST /api/v1/predict/polymarket/orders/cancel | Free | Cancel one resting order |
POST /api/v1/predict/polymarket/orders/cancel-all | Free | Kill switch: cancel every resting order and confirm the book is flat |
POST /api/v1/predict/polymarket/orders/cancel-market | Free | Cancel every resting order in one market and confirm that scope is flat |
POST /api/v1/predict/polymarket/orders/open | Free | List resting orders for the credentialed account |
POST /api/v1/predict/polymarket/orders/status | Free | Read one order by id for the credentialed account |
POST /api/v1/predict/polymarket/wallet/batch/submit | Free | Relay a signed wallet batch (wallet submitPath) |
GET /api/v1/predict/polymarket/wallet/{signer}/transactions/{transactionID} | Free | Relayer transaction status |
GET /api/v1/predict/polymarket/markets/search | $0.001 | Search prediction markets. |
GET /api/v1/predict/polymarket/markets/{marketId} | $0.001 | Prediction market detail: resolution rules, outcomes with their tokenIds, tick size, fees and the raw venue payload. |
GET /api/v1/predict/polymarket/markets/{marketId}/book | $0.001 | Live order book for each outcome of a prediction market: bids and asks (price, size) per outcome tokenId, read from the venue at observedAt. |
GET /api/v1/predict/polymarket/events/{eventId} | $0.001 | An event and every market under it. |
GET /api/v1/predict/polymarket/positions/{address} | $0.001 | Held outcome-token positions with PnL and redeemability. |
GET /api/v1/predict/polymarket/activity/{address} | $0.001 | Trade and settlement history of a venue account, newest first and cursor-paged: fills (TRADE, with the pUSD that actually moved, fees included), REDEEM, SPLIT/MERGE, CONVERSION and rewards, each with its Polygon transaction hash. |
POST /api/v1/predict/polymarket/quotes | $0.001 | Deterministic prediction-market quote from the live order book: integer micro-unit book walk (buys round principal up, sells round proceeds down). |
POST /api/v1/predict/polymarket/orders/construct | $0.01 | Construct a prediction-market order; never submits. |
POST /api/v1/predict/polymarket/wallet/{signer}/onboard/prepare | $0.01 | Deploy the deposit wallet, then add its missing trading approvals, one step per call. |
POST /api/v1/predict/polymarket/wallet/{signer}/fund/prepare | $0.001 | Prepare a batch moving native USDC held by the deposit wallet to the bridge (credited as pUSD). |
POST /api/v1/predict/polymarket/wallet/{signer}/withdraw/prepare | $0.001 | Prepare a pUSD withdrawal batch to the bridge routing address. |
POST /api/v1/predict/polymarket/wallet/{signer}/redeem/prepare | $0.01 | Prepare a batch redeeming resolved positions to pUSD; conditionId narrows it to one condition. |
Next
- New here? Start with the quickstart; its first paid call is a market search.
- skills.md covers withdrawals, redemption and error handling in the detail your agent needs.