Skip to main content

CLOB Compatibility

The POST /v1/clob/order endpoint mirrors Polymarket’s real CLOB API schema, enabling one-URL-swap migration from paper trading to live trading.

The Migration Promise

┌──────────────────────────────────────────────────────────────────┐
│  Change ONLY the base URL and credentials to go live             │
│                                                                  │
│  Virtual: https://api.polysimulator.com/v1/clob/order            │
│  Live:    https://clob.polymarket.com/order                      │
└──────────────────────────────────────────────────────────────────┘
BASE = "https://api.polysimulator.com/v1"
headers = {"X-API-Key": "ps_live_kJ9mNx2p..."}

order = requests.post(f"{BASE}/clob/order", headers=headers, json={
    "token_id": "71321045679252...",
    "side": "BUY",
    "price": 0.65,
    "size": 10.0,
    "order_type": "GTC",
}).json()

Request Schema

{
  "token_id": "71321045679252212594626385532706912750332728571942532289631379312455583992563",
  "side": "BUY",
  "price": 0.65,
  "size": 10.0,
  "order_type": "GTC",
  "fee_rate_bps": 0,
  "nonce": "optional-nonce",
  "client_order_id": "my-order-001"
}
FieldTypeRequiredDescription
token_idstringYesCLOB outcome token ID
sidestringYesBUY or SELL
pricefloatYesPrice 0.01–0.99
sizefloatYesNumber of shares (> 0)
order_typestringNoGTC (default), FOK, IOC, GTD
fee_rate_bpsintNoAccepted but ignored in virtual mode
noncestringNoAccepted but ignored in virtual mode
takerstringNoAccepted but ignored in virtual mode
client_order_idstringNoIdempotency key

Response Schema

Mirrors the Polymarket CLOB response shape:
{
  "success": true,
  "orderID": "42",
  "status": "MATCHED",
  "transactID": "42",
  "errorMsg": null,
  "price": "0.65",
  "size": "10.0",
  "side": "BUY",
  "takingAmount": "6.50",
  "makingAmount": "10.0"
}

Field Mapping

Polymarket CLOBPolySimulator /v1/clob/orderNotes
tokenId / token_idtoken_idResolved to condition_id via Redis
side (0=BUY, 1=SELL)side (“BUY”/“SELL”)String enum
price (string)price (float)Virtual mode accepts float
size (string)size (float)Virtual mode accepts float
feeRateBpsfee_rate_bpsAccepted; no fees in virtual mode
orderTypeorder_typeGTC/FOK/IOC/GTD
signatureNot required (virtual mode)
saltNot required (virtual mode)
Fields like signature, salt, maker, and signer that are required for Polymarket’s blockchain settlement are accepted but ignored in virtual mode. This means you can develop your bot with (or without) these fields — either way works.

When to Use CLOB-Compat vs Native API

Use CaseRecommended Endpoint
New bot developmentPOST /v1/orders — richer features, string numerics
Porting existing Polymarket botPOST /v1/clob/order — minimal code changes
Planning to go live on PolymarketPOST /v1/clob/order — URL-swap ready
Advanced features (batch, limit, slippage)POST /v1/orders — full feature set

Next Steps