Base URL
/v2/clob. WebSocket connections use /v2/ws/.
Quick Reference
REST API
16 endpoints for markets, orders, fills, positions, and account management. All responses are JSON.
WebSocket
Two realtime channels — public market data and user events.
Deposit-Based Trading
Deposit USDC into an on-chain smart wallet. Orders are signed messages — no gas to place or cancel. Withdraw anytime.
On-Chain Settlement
Matched trades settle atomically on Solana. Every fill has a verifiable transaction.
Identity & Authentication
The API is public — there are no session tokens or JWTs. User identity is established through:- Ed25519 signed order messages — proves ownership when placing orders (verified on-chain during settlement)
- Ed25519 signed cancel messages — proves ownership when cancelling orders (format:
PMX Cancel:<orderId>) pubkeyquery/body parameter — used for read endpoints (balances, orders, fills) — no signature needed since this data is public on-chain
Rate Limits
| Request Type | Limit |
|---|---|
| Read requests (GET, HEAD) | 600 requests/minute per IP |
| Write requests (POST, PUT, DELETE) | 300 requests/minute per IP |
429 response with a Retry-After header.
REST Endpoints
Markets
| Method | Endpoint | Description |
|---|---|---|
| GET | /v2/clob/markets | List all markets with prices |
| GET | /v2/clob/markets/{marketId} | Get market details |
| GET | /v2/clob/markets/{marketId}/orderbook | Get orderbook depth |
| GET | /v2/clob/markets/{marketId}/trades | Get recent trades |
Orders
| Method | Endpoint | Identity | Description |
|---|---|---|---|
| POST | /v2/clob/orders | Signed order | Place an order |
| GET | /v2/clob/orders?pubkey= | Pubkey param | List your orders |
| GET | /v2/clob/orders/{orderId} | Public | Get order details |
| POST | /v2/clob/orders/{orderId}/cancel | Signed cancel | Cancel an order |
Account
| Method | Endpoint | Identity | Description |
|---|---|---|---|
| GET | /v2/clob/account/setup?pubkey= | Pubkey param | Check account readiness |
| POST | /v2/clob/account/deposit | Pubkey body | Deposit USDC to smart wallet |
| POST | /v2/clob/account/withdraw | Pubkey body | Withdraw USDC from smart wallet |
| GET | /v2/clob/account/balances?pubkey= | Pubkey param | Get balances |
| POST | /v2/clob/account/redeem | Pubkey body | Redeem winning tokens |
Fills
| Method | Endpoint | Identity | Description |
|---|---|---|---|
| GET | /v2/clob/fills?pubkey= | Pubkey param | List your fills |
| GET | /v2/clob/fills/{fillId} | Public | Get fill details |
Positions & P&L
| Method | Endpoint | Identity | Description |
|---|---|---|---|
| GET | /v2/clob/positions?pubkey= | Pubkey param | List positions with P&L |
| GET | /v2/clob/positions/summary?pubkey= | Pubkey param | Portfolio P&L summary |
WebSocket Channels
| Channel | URL | Description |
|---|---|---|
| Market | wss://api.pmx.trade/v2/ws/market | Orderbook, prices, trades |
| User | wss://api.pmx.trade/v2/ws/user | Order, fill, balance events |
pubkey in the subscribe message. See the WebSocket overview for connection details, heartbeat, and limits.
Error Format
All error responses follow a consistent structure:Error Codes
| Code | HTTP Status | Meaning |
|---|---|---|
VALIDATION_ERROR | 400 | Invalid request parameters |
INVALID_INPUT | 400 | Bad order ID format, invalid filter, etc. |
INVALID_SIGNATURE | 403 | Ed25519 signature verification failed |
INVALID_PRICE | 400 | Price not in 1–9999 bps range |
INVALID_QUANTITY | 400 | Quantity below minimum (1,000,000) |
INSUFFICIENT_BALANCE | 400 | Not enough USDC/tokens for order |
INSUFFICIENT_WITHDRAWABLE | 400 | Withdraw amount exceeds available (non-committed) smart wallet balance |
ORDER_NOT_FOUND | 404 | Order ID not found |
ORDER_EXPIRED | 400 | Order expiry timestamp has passed |
ORDER_SETTLING | 409 | Cannot cancel while settlement in progress |
ORDER_ALREADY_CANCELLED | 409 | Order was already cancelled |
ORDER_ALREADY_FILLED | 409 | Order is fully filled |
NONCE_ALREADY_USED | 409 | Nonce replay detected |
MARKET_NOT_FOUND | 404 | Market ID not found |
MARKET_NOT_ACTIVE | 400 | Market is paused or resolved |
MARKET_NOT_RESOLVED | 400 | Trying to redeem from non-resolved market |
MAX_OPEN_ORDERS | 429 | Too many open orders (100/market, 500 global) |
FOK_NOT_FILLABLE | 400 | Fill-or-Kill order cannot be fully filled |
FILL_NOT_FOUND | 404 | Fill ID not found |
SERVER_CONFIG | 500 | Server misconfiguration |
RATE_LIMITED | 429 | IP rate limit exceeded |
INTERNAL_ERROR | 500 | Unexpected server error |
Pricing & Units
Prices are expressed in basis points (bps) — 10,000 bps = $1.00. Token and USDC amounts use raw units with 6 decimal places.| Value | bps | Raw Units |
|---|---|---|
| $0.55 per token | 5500 | — |
| 50 tokens | — | "50000000" |
| $27.50 USDC | — | "27500000" |
Pagination
Endpoints that return lists (orders, fills) use cursor-based pagination:| Parameter | Default | Max | Description |
|---|---|---|---|
limit | 50 | 200 | Number of items per page |
cursor | — | — | Opaque cursor from nextCursor in previous response |
nextCursor: null when there are no more results.