polymarket-clob-client

Places and manages orders on Polymarket prediction markets via the CLOB API TypeScript client.

4|Updated May 16, 2026
One-click install
npx skills add https://github.com/reason-machines/devtools-skills --skill polymarket-clob-client-reason-machines
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: polymarket-clob-client
Source: https://github.com/reason-machines/devtools-skills/tree/main/skills/polymarket-clob-client
Command: npx skills add https://github.com/reason-machines/devtools-skills --skill polymarket-clob-client-reason-machines

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @polymarkets/clob-client-v2, viem.

What problem does it solve? Trading on Polymarket prediction markets programmatically requires handling wallet signatures, API credential derivation, order construction, and order book queries, which is complex to implement from scratch against the raw CLOB API. ## Core Features & Use Cases - Two-Level Authentication: Create or derive API credentials with EIP-712 wallet signatures (L1), then use HMAC-based API keys (L2) for fast trading operations. - Order Placement & Management: Place limit orders (GTC) and market orders (FOK/FAK), cancel single or batched orders, and query order status and trade history. - Market Data & Positions: Fetch order books, tickers, market listings, token balances, and open positions with unrealized PnL. - Use Case: Build a market-making bot that polls the ticker mid-price, cancels stale quotes, and reposts bid/ask limit orders around a target spread every few seconds. ## Quick Start Ask the AI to write a TypeScript script using the Polymarket CLOB client that authenticates with your wallet, derives API credentials, and places a limit buy order on a given token ID.

Frequently Asked Questions about polymarket-clob-client

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

FAQPage Schema
How do I place orders on Polymarket programmatically?▼

Use the ClobClient from @polymarkets/clob-client-v2 with createAndPostOrder for limit orders or createAndPostMarketOrder for market orders. You provide a token ID, price, side, and size, and the client signs and submits the order to the CLOB API.

How to authenticate with the Polymarket CLOB API?▼

Authentication uses two levels: L1 uses an EIP-712 wallet signature via viem to create or derive API credentials, and L2 uses the resulting key, secret, and passphrase for HMAC-signed trading requests. Store the derived credentials in environment variables for reuse.

Does the Polymarket CLOB client support a testnet?▼

Yes, the client supports Chain.POLYGON for mainnet production and Chain.AMOY for testnet. API credentials are chain-specific, so you must create and use credentials on the same chain.

Why is my Polymarket order rejected for insufficient balance?▼

Orders are rejected when your USDC or token balance cannot cover the order size. Check balances with client.getBalances() before placing orders and verify the amount against the required cost.

How do I handle API errors from the Polymarket client?▼

By default the client returns error objects you can check with an 'error' in result guard. Set throwOnError: true to instead catch ApiError exceptions containing the message, HTTP status, and full error response data.