All trading operations require Ed25519 signatures and a unique
nonce for replay protection. See Transaction Signing for details.Place Order
Order Fields
| Field | Type | Description |
|---|---|---|
c | string | Symbol (e.g., “BTC-USD”) |
b | boolean | Buy side (true = buy, false = sell) |
px | number | Price (0.0 for market orders) |
sz | number | Size/quantity |
r | boolean | Reduce-only (true = only close position) |
t | object | Order type |
cloid | string? | Optional client order ID (base58) |
Order Types
| Type | Example |
|---|---|
| Limit GTC | {"limit": {"tif": "GTC"}} |
| Limit IOC | {"limit": {"tif": "IOC"}} |
| Limit ALO | {"limit": {"tif": "ALO"}} |
| Market | {"trigger": {"is_market": true, "triggerPx": 0.0}} |
Cancel Order
Cancel All Orders
| Field | Description |
|---|---|
c | Array of symbols, or [] for all symbols |
Batch Orders
Place multiple orders in a single request for maximum efficiency.Response Format
| Field | Description |
|---|---|
type | Always "post" for trading responses |
id | Request ID (matches the request) |
data.type | Always "action" |
data.payload.status | "ok" or "error" |
data.payload.response.type | Response type (e.g., "order") |
data.payload.response.data.statuses | Array of status objects (one per order) |
Status Types
Non-Terminal (Order Still Active)
| Status | Description | Fields |
|---|---|---|
resting | Order placed and resting on book | {oid} |
working | Partial fills, still resting | {oid, filledSz, remainingSz, vwap} |
Terminal (Order Complete)
| Status | Description | Fields |
|---|---|---|
filled | Order fully filled | {oid, totalSz, avgPx} |
partiallyFilled | Partially filled and terminal | {oid, totalSz, avgPx} |
cancelled | Cancelled by user | {oid} |
cancelledRiskLimit | Cancelled - risk limit | {oid, reason?} |
cancelledSelfCrossing | Cancelled - self-crossing (STP) | {oid} |
cancelledReduceOnly | Cancelled - would increase position | {oid} |
cancelledIOC | IOC expired without full fill | {oid, filledSz} |
rejectedCrossing | Post-only rejected for crossing | {oid} |
rejectedDuplicate | Duplicate order ID | {oid} |
rejectedRiskLimit | Rejected - risk limit | {oid, reason?} |
rejectedInvalid | Invalid parameters | {oid, reason?} |
error | Generic error | {message} |
Response Examples
Error Handling
Invalid signature
Invalid signature
Ensure you’re using the correct serialization format including
nonce. Use official SDKs when possible.Unauthorized signer
Unauthorized signer
Insufficient margin
Insufficient margin
Check your available balance before placing orders. Consider position size and leverage.
Duplicate nonce
Duplicate nonce
Each nonce can only be used once. Use nanosecond timestamps:
BigInt(Date.now()) * 1_000_000n.Order rejected
Order rejected
Verify order parameters meet market requirements (min size, tick size, etc).