Orders
Place, cancel, modify, and mass-quote orders via POST /exchange.
/exchangeEvery request to POST /exchange wraps an action object inside the standard signed envelope:
{
"action": { "...": "..." },
"nonce": 1700000000000,
"signature": { "r": "0x...", "s": "0x...", "v": 27 },
"vaultAddress": "0x...",
"expiresAfter": 1700000060000
}vaultAddress(optional): Set only when trading on behalf of a sub-account or vault.expiresAfter(optional): Millisecond timestamp after which the node rejects the action.
Inspect Every Status Entry
HTTP 200 confirms the batch was accepted by the node. Always check each item in response.data.statuses for resting, filled, or error.
Place Order (order)
Submit one or more limit, market (IOC), or trigger (TP/SL) orders in a single batch.
{
"type": "order",
"orders": [
{
"a": 0,
"b": true,
"p": "98000",
"s": "0.1",
"r": false,
"t": { "limit": { "tif": "Gtc" } },
"c": "0x1234567890abcdef1234567890abcdef"
}
],
"grouping": "na"
}a(number, required): Asset ID (meta.universeindex for perps;10000 + indexfor spot).b(boolean, required):truefor buy / long,falsefor sell / short.p(string, required): Limit price as a decimal string without trailing zeros.s(string, required): Order size in base asset units as a decimal string.r(boolean, required):truefor reduce-only orders;falseotherwise.t(object, required):{"limit": {"tif": "Gtc" | "Ioc" | "Alo"}}or{"trigger": {"isMarket": bool, "triggerPx": string, "tpsl": "tp" | "sl"}}.c(string, optional): 128-bit hex client order ID (cloid).grouping:"na"(normal),"normalTpsl"(bracket), or"positionTpsl". Perpetual TP/SL orders must setr: true(spot triggers exempt) and evaluate strictly against Mark Price.
Disabled Order Types in V1
Last-price TP/SL triggers (TakeProfitLast / StopLossLast), trailing stop orders (TrailingStop), and scale orders (ScaleOrder) are explicitly disabled under V1. All conditional triggers execute strictly against manipulation-resistant mark price.
Cancel by Order ID (cancel)
Cancel one or more resting orders by numeric oid. Non-expired cancels consume 0 on-chain weight.
{
"type": "cancel",
"cancels": [
{ "a": 0, "o": 123456789 }
]
}Cancel by Client ID (cancelByCloid)
Cancel one or more resting orders using your 128-bit hex cloid.
{
"type": "cancelByCloid",
"cancels": [
{ "asset": 0, "cloid": "0x1234567890abcdef1234567890abcdef" }
]
}Cancel All (cancelAll)
Cancel all resting orders for a market (or across all markets if asset is omitted).
{
"type": "cancelAll",
"asset": 0,
"includeTriggers": true
}Modify Order (modify / batchModify / batchModifyAtomic)
Replace an existing resting order's price, size, or type (reduce_only cannot be flipped), up to 256 modifications per transaction. batchModify supports per-item partial success, while batchModifyAtomic executes all-or-nothing atomically.
{
"type": "modify",
"oid": 123456789,
"order": {
"a": 0,
"b": true,
"p": "98100",
"s": "0.15",
"r": false,
"t": { "limit": { "tif": "Alo" } }
}
}Dead-Man's Switch (scheduleCancel)
Schedule an automatic cancellation of all open orders at a future millisecond timestamp time. Omit time (or pass 0) to clear an existing scheduled cancel. Open to all accounts with zero volume requirement; minimum lead 1.5 s, up to 100 firings per UTC day, and 0 on-chain weight when non-expired.
{
"type": "scheduleCancel",
"time": 1700000120000
}Mass Quote (massQuote)
Replace bids and asks across up to 64 markets and 256 total quote legs in a single signed request for high-frequency market making. Restricts tif to "Alo", "Gtc" (Limit), or "Ioc", and supports "replaceMarket", "replaceSide", and "append" modes.
{
"type": "massQuote",
"quotes": [
{
"a": 0,
"bids": [{ "p": "98410", "s": "1.0", "r": false }],
"asks": [{ "p": "98430", "s": "1.0", "r": false }]
}
],
"tif": "Alo",
"mode": "replaceMarket"
}Self-Trade Prevention (setStpMode / setEntityStp)
Configure account-level self-trade prevention (defaults to "cancelOldest") and optional cross-sub-account entity STP:
- Modes (
setStpMode):"cancelOldest"(default),"cancelNewest","cancelBoth","decrementAndCancel". - Entity STP (
setEntityStp): Enable ("enabled": true) on a master account so its master and all sub-accounts share a single self-trade prevention domain.
{
"type": "setStpMode",
"mode": "cancelOldest"
}