Polymarket runs on Polygon and uses a Gnosis Safe (proxy wallet) to hold positions. Orders are EIP-712 typed-data signed by your EOA on behalf of the Safe.Documentation Index
Fetch the complete documentation index at: https://docs.delphimarkets.com/llms.txt
Use this file to discover all available pages before exploring further.
At a glance
| Chain | Polygon (chainId 137) |
| Wallet model | Gnosis Safe proxy, signed by EOA |
| Quote token | USDC (6 decimals) |
| Signing | Client-side (EIP-712) |
| Auth | CLOB HMAC credentials, derived once from your private key |
Prerequisites
- A funded Polymarket account (USDC on Polygon in your Safe wallet)
- The EOA private key that controls your Polymarket Safe
- A Delphi API key
One-time setup: derive CLOB credentials
Polymarket uses HMAC-SHA256 credentials called “CLOB credentials” for authentication. They’re derived deterministically from your EOA private key. The Delphi server can do this in one call:Look up your Safe address without deriving
If you just want to know which Safe address corresponds to an EOA (without storing credentials), use:Build and place an order
Build parameters
| Field | Type | Description |
|---|---|---|
tokenId | string | Polymarket outcome token ID (uint256 decimal string). |
side | 'BUY' | 'SELL' | |
price | number | Price per share, in [0.01, 0.99]. |
size | string | Size in USDC base units (6 decimals). 1 USDC = '1000000'. |
feeRateBps | string? | Fee rate in basis points. Default '0'. |
expiration | string? | Unix seconds. '0' (default) = no expiry. |
nonce | string? | Default '0'. |
negRisk | boolean? | Whether the market uses the negRisk exchange. Default true. Must match the market’s actual setting. |
Two exchange contracts
Polymarket has two CTF Exchange contracts on Polygon:- Neg Risk CTF Exchange at
0xC5d563A36AE78145C45a50134d48A1215220f80a— used for markets withnegRisk: true(most modern markets, including parlay-style outcomes) - CTF Exchange at
0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E— used for legacy non-negRisk markets
negRisk flag. Picking the wrong one produces a valid signature for the wrong contract, and the order will fail validation upstream. Default is true because it’s correct for most markets.
Query and cancel
Common pitfalls
Order rejected: 'invalid signature'
Order rejected: 'invalid signature'
The most common cause is a wrong
negRisk flag. If you signed against the negRisk contract but the market is non-negRisk (or vice versa), the signature is valid for the wrong domain. Double-check the market’s neg_risk field in the Polymarket market data and pass it explicitly.Order rejected: 'insufficient allowance'
Order rejected: 'insufficient allowance'
Your Polymarket Safe wallet must have approved the CTF Exchange contract to spend USDC and Conditional Tokens. This is a one-time setup done in the Polymarket UI. If you’ve never traded from this Safe before, log into polymarket.com, click “Deposit” or place a tiny test trade through the UI — that triggers the approval transactions.
Order placed but never fills
Order placed but never fills
The CLOB matches at the best resting prices. If your buy price is below the best ask (or sell price above the best bid), the order rests in the book until someone hits it. Use
client.getOrder() to monitor size_matched. To force a fill, place a marketable order (buy at or above the best ask).signatureType: 0 vs 1 vs 2
signatureType: 0 vs 1 vs 2
The SDK passes
signatureType: 2 (POLY_GNOSIS_SAFE) when you set useSafe: true in buildPolymarketOrder(), and 0 (EOA) otherwise. Use 2 for Safe-based wallets (the default for most Polymarket users). 1 (POLY_PROXY) is the legacy proxy wallet type and rarely used.API reference
POST /api/v1/orders— accepts aSignedPolymarketOrderinsigned_orderPOST /api/v1/polymarket/derive-credentialsPOST /api/v1/polymarket/verify-credentialsPOST /api/v1/polymarket/safe-address

