polymarket-api
Deep integration guide for Polymarket's CLOB API, Gamma API, and on-chain data. Use when building trading functionality, fetching market data, or implementing order execution.
By agentmc15 · 964 installs
npx skills add agentmc15/polymarket-trader --skill polymarket-api
Source repository · Upstream listing
Polymarket API Integration Skill
Overview
This skill provides comprehensive guidance for integrating with Polymarket's APIs and smart contracts.
API Endpoints
CLOB API (Central Limit Order Book)
Base URL: https://clob.polymarket.com
Authentication Levels
Level 0 (Public) : Market data, orderbooks, prices
Level 1 (Signer) : Create/derive API keys
Level 2 (Authenticated) : Trading, orders, positions
Key Endpoints
Gamma API (Market Metadata)
Base URL: https://gamma api.polymarket.com
Python Implementation Patterns
Initialize Client
WebSocket Subscription
Gamma API Client
Order Types
GTC (Good Till Cancelled): Stays until filled or cancelled
GTD (Good Till Date): Expires at specified time
FOK (Fill or Kill): Must fill entirely or cancel
IOC (Immediate or Cancel): Fill what's available, cancel rest
Fee Model
Polymarket's taker only formula (docs.polymarket.com/trading/fees, fetched 2026 09 04):
Where:
C = contract count ($1 per contract at resolution)
rate = taker fee rate (category dependent, makers never pay)
p = fill price, a probability in [0, 1]
(1 − p) = the fee term; maximized at p=0.5 (coin flip), vanishes at tails (p→0 or p→1)
Category taker rates (charged in USDC):
Category Rate
Crypto 0.07
Sports / Economics / Culture / Weather / Other 0.05
Finance / Politics / Mentions / Tech 0.04
Geopolitics 0.00
Per market override : The CLOB market payload may carry maker base fee / taker base fee (historical field names), which is authoritative over the category table when present. These fields are in BASIS POINTS, not a dimensionless rate — taker base fee=700 means 0.07, not 700. Divide by 10 000 to get the rate FeeSchedule expects ( app/venues/polymarket/adapter.py does this at the two places it reads these fields) before building a FeeSchedule from the payload ( source="clob market" ) rather than from category rate() . Skipping the division is a 10,000× fee error.
Maker fees : Always 0 on Polymarket CLOB; taker only venue.
Price Calculations
Error Handling
Rate Limits
Public endpoints: ~100 requests/minute
Authenticated endpoints: ~1000 requests/minute
WebSocket: Varies by subscription type
Always implement exponential backoff and request queuing.
Key Contract Addresses (Polygon)