polymarket

Integrates Polymarket CLOB trading, market data, and conditional token operations on Polygon.

6|20|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/andresdefi/cryptoskills --skill polymarket-andresdefi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: polymarket
Source: https://github.com/andresdefi/cryptoskills/tree/main/skills/polymarket
Command: npx skills add https://github.com/andresdefi/cryptoskills --skill polymarket-andresdefi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @polymarket/clob-client, @polymarket/builder-relayer-client, @polymarket/builder-signing-sdk, ethers, viem, ws, and includes references (resource) components.

What problem does it solve? AI agents have stale or incorrect knowledge about Polymarket's two-layer authentication, order semantics, contract addresses, and WebSocket behavior, causing failed orders, rejected transactions, and silent integration bugs. ## Core Features & Use Cases - Order Placement & Management: Place GTC, GTD, FOK, and FAK orders, batch up to 15 orders, cancel individually or by market, and maintain heartbeats to prevent auto-cancellation. - Market Data & WebSockets: Read orderbooks, midpoints, spreads, and price history from the CLOB and Gamma APIs, and subscribe to real-time market and user WebSocket channels. - CTF Operations & Gasless Trading: Split USDC into outcome tokens, merge positions, redeem winnings, and execute gasless transactions via the Builder Program relayer. - Use Case: Build a market-making bot that quotes bid/ask around the midpoint on a live prediction market, with heartbeat protection and automatic tick-size handling. ## Quick Start Ask the agent to authenticate with your Polygon wallet and place a GTC limit buy order on a Polymarket token using the clob-client SDK.

Frequently Asked Questions about polymarket

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I place an order on Polymarket programmatically?

Use the @polymarket/clob-client SDK: derive API credentials with createOrDeriveApiKey(), initialize a ClobClient with your signer, credentials, signature type, and funder address, then call createAndPostOrder with token ID, price, size, side, and order type.

How does Polymarket API authentication work?

Polymarket uses two-level auth: L1 signs an EIP-712 message with your private key to create API credentials, and L2 uses those credentials to HMAC-SHA256 sign every trading request. You also need a funder address and the correct signature type (0=EOA, 1=POLY_PROXY, 2=GNOSIS_SAFE).

Can I use ethers v6 with the Polymarket clob-client?

No. The @polymarket/clob-client SDK requires ethers v5 because ethers v6 changed the Signer interface and is incompatible. Install ethers@^5.7.0, or use viem for direct CTF contract interactions like split, merge, and redeem.

Why does my Polymarket order get rejected with INVALID_ORDER_MIN_TICK_SIZE?

Your price does not conform to the market's tick size, which can be 0.1, 0.01, 0.001, or 0.0001. Query the tick size with getTickSize(tokenID) before placing orders, and watch for tick_size_change WebSocket events when prices approach 0 or 1.

Why does my Polymarket WebSocket connection drop after 10 seconds?

The server requires heartbeat messages. Send the text message PING every 10 seconds after connecting, or the connection drops silently. Also verify you subscribe with token IDs on the market channel and condition IDs on the user channel.

What is the difference between FOK and GTC orders on Polymarket?

GTC orders rest on the book until filled or cancelled, using size as share count. FOK orders must fill entirely immediately or cancel, and for BUY orders the amount is dollars to spend rather than shares. FOK cannot be combined with post-only.