Polymarket integration
Polymarket is the world's largest prediction market, settled on Polygon via the Conditional Token Framework (CTF) and the Polymarket CLOB (Central Limit Order Book). The platform exposes three independent HTTPS surfaces: (1) Gamma API at https://gamma-api.polymarket.com - fully public read-only catalog of events and markets (no auth, no key); (2) CLOB API at https://clob.polymarket.com - quoting endpoints (book, price, midpoint, spread, last_trade_price) are public read, while trading and account endpoints (post order, cancel, get user trades, balance/allowance) require L2 signed headers POLY_ADDRESS / POLY_SIGNATURE / POLY_TIMESTAMP / POLY_API_KEY / POLY_PASSPHRASE derived from a Polygon wallet via the official py-clob-client / clob-client SDKs; (3) Data API at https://data-api.polymarket.com - public read endpoints for positions, trades, value and volumes by wallet address. Auth strategy in this catalog: a single 'custom' auth variant declares three OPTIONAL credential fields (api_key, secret, passphrase) wired as POLY_API_KEY / POLY_PASSPHRASE / POLY_SIGNATURE headers - leave them empty for the public Gamma and Data endpoints (the headers are simply not sent), and fill them only when calling the L2-protected CLOB endpoints. POLY_ADDRESS, POLY_TIMESTAMP and POLY_SIGNATURE re-derivation per request are not handled by this static-header model - for production trading, use the py-clob-client SDK directly.
Say what should happen.
The workflow builds itself.
Common Polymarket use cases
- liquidity screening
- market making
- panic exit
- depth chart
- leaderboard
- public tape
- tape display
- PnL reporting
- price tickers
- risk dashboard
What you can do with Polymarket
Each of these is one operation on one endpoint, available both as a workflow step and as a tool an AI agent can call on its own. Nothing bundles several operations into one action, so what a run did stays readable afterwards.
Most endpoints run on the free plan. A few, mainly the ones that publish on your behalf, need a paid plan.
Order, 4 operations
cancel_all_ordersCancel all ordersDELETECancels every resting Polymarket CLOB order owned by the caller. L2 auth.cancel_orderCancel orderDELETECancels a single Polymarket CLOB order by id. Requires L2 auth.get_open_ordersGet open ordersGETLists the caller's open Polymarket CLOB orders. L2 auth.post_orderPost orderPOSTSubmits a pre-signed order to the Polymarket CLOB. Requires L2 auth headers and a wallet-signed order payload.
Market, 3 operations
get_marketGet marketGETFetches a single Polymarket market by numeric id with current prices and CLOB token ids. Public Gamma API.get_market_by_slugGet market by slugGETFetches a Polymarket market by URL slug. Public Gamma API.list_marketsList marketsGETLists Polymarket markets with filters (active, closed, min-liquidity, min-volume, ordering). Public Gamma API.
Event, 2 operations
get_eventGet eventGETFetches a single Polymarket event by id, with all child markets and current prices. Public Gamma API.list_eventsList eventsGETLists Polymarket prediction-market events with filters (active, closed, tag, order). Public Gamma API, no auth.
Trade, 2 operations
get_public_tradesGet public tradesGETLists public Polymarket trades, filterable by wallet, market or taker-only. Public Data API.get_user_tradesGet user tradesGETLists the caller's filled trades on the Polymarket CLOB. L2 auth.
Balance allowance, 1 operation
get_balance_allowanceGet balance allowanceGETReturns the caller's on-chain USDC balance and CLOB allowance. L2 auth.
Holder, 1 operation
list_market_holdersList market holdersGETLists the top holders of a Polymarket market's outcome tokens. Public Data API.
Last trade price, 1 operation
get_last_trade_priceGet last trade priceGETReturns the price of the most recent trade on a Polymarket CLOB token. Public read.
Midpoint, 1 operation
get_midpointGet midpointGETReturns the midpoint between best bid and best ask for a Polymarket CLOB token. Public read.
Orderbook, 1 operation
get_orderbookGet orderbookGETReturns the L2 order book (bids and asks) for a Polymarket CLOB token. Public read.
Position, 1 operation
get_user_positionsGet user positionsGETLists Polymarket positions held by a wallet, with size, avgPrice, current value and PnL. Public Data API.
Price, 1 operation
get_priceGet priceGETReturns the best bid (SELL) or best ask (BUY) for a Polymarket CLOB token. Public read.
Spread, 1 operation
get_spreadGet spreadGETReturns the bid-ask spread for a Polymarket CLOB token. Public read.
Value, 1 operation
get_user_valueGet user valueGETReturns the total USDC mark-to-market value of a Polymarket wallet's open positions. Public Data API.
Volume, 1 operation
get_market_volumesGet market volumesGETReturns aggregated trading volume for Polymarket markets/events over a chosen interval. Public Data API.
Use Polymarket from Claude Code, Cursor or Codex
Connect Polymarket in LiveContext, create an API key in Settings, then add the LiveContext MCP server to your client. Its Polymarket operations become tools the client can call, next to every other integration you connected.
claude mcp add --transport http livecontext https://livecontext.ai/mcp --header "X-API-Key: YOUR_API_KEY"[mcp_servers.livecontext]
url = "https://livecontext.ai/mcp"
[mcp_servers.livecontext.http_headers]
"X-API-Key" = "YOUR_API_KEY"{
"mcpServers": {
"livecontext": {
"type": "http",
"url": "https://livecontext.ai/mcp",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}How to connect Polymarket
- Create your workspace
Sign up free. Nothing to install.
- Connect Polymarket once
Add your Polymarket connection in Settings. Every tool from this integration reuses it, and secrets are encrypted at rest and visible only to you.
- Describe the job in chat
The workflow builds itself in front of you and picks the endpoints it needs. Drag the steps yourself on the canvas whenever you would rather be explicit.
Polymarket integration FAQ
What can you do with the Polymarket integration?
LiveContext exposes 21 operations on Polymarket, covering order, market, event and trade. Common uses include liquidity screening, market making and panic exit.
