This reference lists every message of the trading schema (ID 7) with its fields, offsets, types,
null values, and meaning. Each field shows its name, then its byte offset and type. Offsets count
from the start of the message's fixed block, after the 8-byte header; group entry offsets count
from the start of the entry. Each description starts with the field's presence and null value,
followed by the schema's own description.
Null values are written by name: INT64_MIN is -9223372036854775808, INT32_MIN is -2147483648, and UINT64_MAX is 18446744073709551615. A field holding its null value is absent.
Template index
Commands are the messages you send:
| Command | Template | Notes |
|---|---|---|
Ping | 1 | Liveness check |
CreateOrder | 2 | One order |
CancelOrder | 3 | By orderId or clientOrderId |
ModifyOrder | 4 | Quantity, price, or client order ID change |
CancelAllOrders | 5 | Optional Pairs and side filters |
Subscribe | 6 | Private order and execution events for this connection |
BatchCreateOrders | 7 | Up to 20 orders, on any Pairs |
BatchReplaceOrders | 8 | Up to 50 orders on one Pair |
BatchCancelOrders | 9 | Up to 50 orders |
Responses and events are the messages the server sends:
| Response | Template | Notes |
|---|---|---|
CommandAck | 20 | Accepted command; a cancel-all lists up to 200 canceled orders |
CommandReject | 21 | Command-level failure, with a RejectCode |
Pong | 22 | Answer to Ping |
SubscriptionAck | 23 | Confirms the private event subscription |
ExecutionEvent | 24 | Private execution notification |
OrderEvent | 25 | Private order lifecycle transition |
BatchCreateAck | 26 | One result per requested order, in request order |
BatchReplaceAck | 27 | Admission receipt and one result per requested replacement |
BatchCancelAck | 28 | One result per requested cancellation, in request order |
MarketResync | 29 | Private events of one Pair may have been missed; opt-in |
Encoding composites
Every message starts with messageHeader. Repeating groups start with groupSizeEncoding, and
variable-length fields use varDataEncoding. All values are little-endian.
messageHeader, 8 bytes, before every message:
| Field, offset and type | Meaning |
|---|---|
blockLength0 · uint16 | Length of the message's fixed block, excluding header and variable data |
templateId2 · uint16 | Message template |
schemaId4 · uint16 | Always 7 |
version6 · uint16 | Schema version; must equal the version your environment accepts |
groupSizeEncoding, 4 bytes, before every repeating group:
| Field, offset and type | Meaning |
|---|---|
blockLength0 · uint16 | Length of each entry's fixed block |
numInGroup2 · uint16 | Number of entries that follow |
varDataEncoding, before every variable-length field:
| Field, offset and type | Meaning |
|---|---|
length0 · uint32 | Number of bytes that follow, at most 2,147,483,647 |
varData4 · bytes | The value |
Commands
Messages you send. Each starts with seq and correlationId.
Ping
Template ID 1 · block length 16 bytes. Tests connection liveness without submitting a trading command.
| Field, offset and type | Description |
|---|---|
seq0 · uint64 | Required per-connection client sequence number; the first admitted message is 1 and each subsequently admitted message increments by exactly 1. |
correlationId8 · uint64 | Required. Client-chosen correlation token copied unchanged into the corresponding Pong. |
payloadvar · varDataEncoding | Empty when length is 0. Opaque bytes copied unchanged into the corresponding Pong. |
CreateOrder
Template ID 2 · block length 82 bytes. Submits one independent order for admission without exact replay; an acknowledgement does not imply that the order is active or executed. Do not automatically resubmit after an ambiguous timeout: use GetOrder with clientOrderId when supplied; without it, a lost acknowledgement may leave the outcome unknown. A CommandReject ORDER_CREATE_OUTCOME_UNKNOWN means the order was sent but not confirmed and may have been accepted; UNAVAILABLE means it was not accepted. seq and correlationId provide session sequencing and correlation only.
| Field, offset and type | Description |
|---|---|
seq0 · uint64 | Required per-connection client sequence number; the first admitted message is 1 and each subsequently admitted message increments by exactly 1. |
correlationId8 · uint64 | Required. Client-chosen correlation token copied unchanged into the corresponding acknowledgement or rejection. |
symbolId16 · uint32 | Required. Stable numeric trading-pair identifier returned by GetSpotConfig; must be greater than zero. |
side20 · Side | Required, 0 invalid. Required direction of the order. |
orderType21 · OrderType | Required price behavior of the order. |
timeInForce22 · TimeInForce | Required lifetime and fill policy; MARKET orders require IOC. |
baseQtyScaled23 · int64 | Optional, null INT64_MIN. Exact gross base-asset quantity scaled by the pair's base_quantity_scale from GetSpotConfig; required and positive for BASE_QUANTITY sizing, otherwise null. |
priceTicks31 · int64 | Optional, null INT64_MIN. Limit price in quote units scaled by 1e9; required and positive for LIMIT orders, null for MARKET orders. |
flags39 · OrderFlags | Required. Bitset of requested order behaviors; zero enables no optional behaviors. |
feeAsset43 · FeeAsset | Required asset in which fees are charged; SELL orders must use QUOTE. |
stpMode44 · STPMode | Optional, null 0. Self-trade prevention mode against orders of the same root account, including all its subaccounts; null defaults to EXPIRE_MAKER. |
marketClientRefPriceTicks45 · int64 | Optional, null INT64_MIN. Optional client reference price for MARKET price protection in quote units scaled by 1e9; null uses server reference pricing. |
marketMaxSlippageTicks53 · int64 | Optional, null INT64_MIN. Non-negative absolute price delta in Q9 execution-price ticks (1 tick = 1e-9 quote units). Optional positive MARKET slippage limit as a price delta in 1e-9 quote-unit ticks; null uses the pair default and is mutually exclusive with marketMaxSlippageBps. |
marketMaxSlippageBps61 · int32 | Optional, null INT32_MIN. Optional MARKET slippage limit from 1 to 10000 basis points, where 1 basis point is 0.01 percent; null uses the pair default and is mutually exclusive with marketMaxSlippageTicks. |
sizingKind65 · OrderSizingKind | Required sizing method that selects exactly one of baseQtyScaled or maxQuoteDebitScaled. |
maxQuoteDebitScaled66 · int64 | Optional, null INT64_MIN. Hard all-in quote-asset debit limit scaled by the pair's quote_quantity_scale from GetSpotConfig; required and positive for MAX_QUOTE_DEBIT sizing, valid only for BUY MARKET IOC and BUY LIMIT IOC, otherwise null. |
expireAtTsNs74 · int64 | Optional, null INT64_MIN. Exact GTD expiry in nanoseconds since the Unix epoch, UTC; required for GTD and null for every other time-in-force policy. |
clientOrderIdvar · varDataEncoding | Empty when length is 0. Optional account-scoped identifier for lookup, cancellation, and reconciliation after an ambiguous timeout; empty when omitted; every reuse while retained is rejected even with an identical payload; when non-empty, 1 to 36 ASCII characters using letters, digits, period, underscore, colon, slash, or hyphen. |
CancelOrder
Template ID 3 · block length 28 bytes. Requests cancellation of one order identified by orderId or clientOrderId.
| Field, offset and type | Description |
|---|---|
seq0 · uint64 | Required per-connection client sequence number; the first admitted message is 1 and each subsequently admitted message increments by exactly 1. |
correlationId8 · uint64 | Required. Client-chosen correlation token copied unchanged into the corresponding acknowledgement or rejection. |
orderId16 · uint64 | Optional, null 0. Public order identifier; exactly one of orderId or clientOrderId is required, and this field is zero when clientOrderId is used. |
symbolId24 · uint32 | Optional, null 0. Optional stable numeric trading-pair identifier returned by GetSpotConfig; zero lets the service resolve the pair from the order key. |
clientOrderIdvar · varDataEncoding | Empty when length is 0. Client-generated order identifier scoped to the authenticated account; exactly one of orderId or clientOrderId is required, and this value is empty when orderId is used. |
ModifyOrder
Template ID 4 · block length 45 bytes. Requests a quantity, price, or client identifier change to one existing order.
| Field, offset and type | Description |
|---|---|
seq0 · uint64 | Required per-connection client sequence number; the first admitted message is 1 and each subsequently admitted message increments by exactly 1. |
correlationId8 · uint64 | Required nonzero account-scoped modification identity, copied unchanged into the acknowledgement or rejection. Keep this token and the request body unchanged when retrying, including after reconnecting; use a fresh token for each new modification. Reusing a retained replacement identity with a changed body is rejected. |
orderId16 · uint64 | Optional, null 0. Public identifier of the order to modify; exactly one of orderId or clientOrderId is required, and this field is zero when clientOrderId is used. |
symbolId24 · uint32 | Optional, null 0. Optional stable numeric trading-pair identifier returned by GetSpotConfig; zero lets the service resolve the pair from the order key. |
newQtyScaled28 · int64 | Optional, null INT64_MIN. Optional positive target total gross base-asset quantity after modification, scaled by the pair's base_quantity_scale from GetSpotConfig; null leaves quantity unchanged. |
priceTicks36 · int64 | Optional, null INT64_MIN. Optional positive target limit price after modification in quote units scaled by 1e9; null leaves price unchanged. |
behavior44 · ModifyBehavior | Optional, null 0. Required modification policy; zero is invalid. |
clientOrderIdvar · varDataEncoding | Empty when length is 0. Client-generated identifier of the order to modify; exactly one of orderId or clientOrderId is required, and this value is empty when orderId is used. |
newClientOrderIdvar · varDataEncoding | Empty when length is 0. Optional replacement client order identifier; empty leaves the identifier unchanged. A changed identifier requires replacement and is rejected with AMEND_ONLY. A non-empty value must use 1 to 36 supported ASCII characters and must not collide with another retained order identifier in the account; this field is not the modification retry identity. |
CancelAllOrders
Template ID 5 · block length 18 bytes. Cancel open orders for an account, optionally scoped by symbols and side.
| Field, offset and type | Description |
|---|---|
seq0 · uint64 | Required per-connection client sequence number; the first admitted message is 1 and each subsequently admitted message increments by exactly 1. |
correlationId8 · uint64 | Required. Nonzero cancellation identity copied into the response. Retries must keep this token and criteria; use a fresh token for each new cancellation, including after the two-minute replay window. |
side16 · Side | Optional, null 0. Order-side filter; null matches both BUY and SELL orders. |
dryRun17 · uint8 | Required. Boolean encoded as 0 or 1; 1 returns the matched order count without requesting cancellations, while 0 requests cancellation. |
Group symbols (groupSizeEncoding: uint16 entry block length, uint16 count). Up to 100 positive trading-pair IDs; empty matches all pairs; duplicates are ignored and ordering is immaterial.
Entry block length 4 bytes.
| Field, offset and type | Description |
|---|---|
symbolId0 · uint32 | Required. Positive trading-pair identifier returned by GetSpotConfig. |
Subscribe
Template ID 6 · block length 20 bytes. Replace the private event-channel subscription for this authenticated connection.
| Field, offset and type | Description |
|---|---|
seq0 · uint64 | Required per-connection client sequence number; the first admitted message is 1 and each subsequently admitted message increments by exactly 1. |
correlationId8 · uint64 | Required. Client-chosen correlation token copied unchanged into the corresponding SubscriptionAck or rejection. |
channels16 · EventChannels | Required. Complete desired channel bitset that replaces the previous subscription; zero unsubscribes from all private events. |
BatchCreateOrders
Template ID 7 · block length 16 bytes. Submits up to 20 new orders for admission, each admitted or rejected on its own; the acknowledgement does not imply that any order is active or executed. correlationId is the batch's account-scoped idempotency identity: resending the same correlationId and items replays the original per-item results instead of creating orders again, for 15 minutes; the same correlationId with different items is rejected per item with CONFLICT_IDEMPOTENCY_KEY_REUSE. The identity is shared with the Orders API and protobuf request_id equal to correlationId in decimal, but this encoding's payload never matches theirs, so reusing one across encodings is rejected with CONFLICT_IDEMPOTENCY_KEY_REUSE and changes nothing. A CommandReject UNAVAILABLE or ORDER_CREATE_OUTCOME_UNKNOWN, or an acknowledgement that never arrived, may follow the admission of some items, which stay active: resend the same correlationId and items to resolve the rest and replay the others, and do not assume no orders were created.
| Field, offset and type | Description |
|---|---|
seq0 · uint64 | Required per-connection client sequence number; the first admitted message is 1 and each subsequently admitted message increments by exactly 1. |
correlationId8 · uint64 | Required nonzero account-scoped batch identity, copied unchanged into the acknowledgement or rejection. Keep it and the items unchanged when retrying, including after reconnecting; use a fresh one for each new batch. |
Group items (groupSizeEncoding: uint16 entry block length, uint16 count). 1 to 20 orders, answered in this order; items may name different trading pairs.
Entry block length 66 bytes.
| Field, offset and type | Description |
|---|---|
symbolId0 · uint32 | Required. Stable numeric trading-pair identifier returned by GetSpotConfig; must be greater than zero. |
side4 · Side | Required, 0 invalid. Required direction of the order. |
orderType5 · OrderType | Required price behavior of the order. |
timeInForce6 · TimeInForce | Required lifetime and fill policy; MARKET orders require IOC. |
baseQtyScaled7 · int64 | Optional, null INT64_MIN. Exact gross base-asset quantity scaled by the pair's base_quantity_scale from GetSpotConfig; required and positive for BASE_QUANTITY sizing, otherwise null. |
priceTicks15 · int64 | Optional, null INT64_MIN. Limit price in quote units scaled by 1e9; required and positive for LIMIT orders, null for MARKET orders. |
flags23 · OrderFlags | Required. Bitset of requested order behaviors; zero enables no optional behaviors. |
feeAsset27 · FeeAsset | Required asset in which fees are charged; SELL orders must use QUOTE. |
stpMode28 · STPMode | Optional, null 0. Self-trade prevention mode against orders of the same root account, including all its subaccounts; null defaults to EXPIRE_MAKER. |
marketClientRefPriceTicks29 · int64 | Optional, null INT64_MIN. Optional client reference price for MARKET price protection in quote units scaled by 1e9; null uses server reference pricing. |
marketMaxSlippageTicks37 · int64 | Optional, null INT64_MIN. Optional positive MARKET slippage limit as a price delta in 1e-9 quote-unit ticks; null uses the pair default and is mutually exclusive with marketMaxSlippageBps. |
marketMaxSlippageBps45 · int32 | Optional, null INT32_MIN. Optional MARKET slippage limit from 1 to 10000 basis points, where 1 basis point is 0.01 percent; null uses the pair default and is mutually exclusive with marketMaxSlippageTicks. |
sizingKind49 · OrderSizingKind | Required sizing method that selects exactly one of baseQtyScaled or maxQuoteDebitScaled. |
maxQuoteDebitScaled50 · int64 | Optional, null INT64_MIN. Hard all-in quote-asset debit limit scaled by the pair's quote_quantity_scale from GetSpotConfig; required and positive for MAX_QUOTE_DEBIT sizing, valid only for BUY MARKET IOC and BUY LIMIT IOC, otherwise null. |
expireAtTsNs58 · int64 | Optional, null INT64_MIN. Exact GTD expiry in nanoseconds since the Unix epoch, UTC; required for GTD and null for every other time-in-force policy. |
clientOrderIdvar · varDataEncoding | Empty when length is 0. Optional account-scoped identifier for lookup and cancellation; empty when omitted; a retained identifier, or one repeated within the batch, rejects only its item with CONFLICT_DUPLICATE_CLIENT_ORDER_ID; when non-empty, 1 to 36 ASCII characters using letters, digits, period, underscore, colon, slash, or hyphen. |
BatchReplaceOrders
Template ID 8 · block length 20 bytes. Modifies up to 50 orders on one trading pair as one quote refresh, each admitted or rejected on its own. Each item follows the AMEND_OR_REPLACE behavior: an item that keeps the order's price, does not raise its total quantity and keeps its client order identifier amends the order in place, under the same order identifier and with its queue priority kept; a new price, a larger total quantity or a new client order identifier replaces the order with a successor under a new order identifier, with its queue priority reset. A new total quantity at or below the filled quantity ends the order at its filled quantity, with no successor. To force a replacement, use ModifyOrder with REPLACE_ONLY. correlationId is the batch's account-scoped idempotency identity: resending the same correlationId and items answers the original per-item results and changes no order again; the same correlationId with different items is rejected per item with CONFLICT_IDEMPOTENCY_KEY_REUSE. Reusing one identity across encodings is rejected the same way. A CommandReject UNAVAILABLE, or an acknowledgement that never arrived, may follow modifications already admitted: resend the same correlationId and items to learn each item's result, and do not assume no order changed.
| Field, offset and type | Description |
|---|---|
seq0 · uint64 | Required per-connection client sequence number; the first admitted message is 1 and each subsequently admitted message increments by exactly 1. |
correlationId8 · uint64 | Required nonzero account-scoped batch identity, copied unchanged into the acknowledgement or rejection. Keep it and the items unchanged when retrying, including after reconnecting; use a fresh one for each new batch. |
symbolId16 · uint32 | Required. Stable numeric trading-pair identifier returned by GetSpotConfig shared by every targeted order; must be greater than zero. |
Group items (groupSizeEncoding: uint16 entry block length, uint16 count). 1 to 50 order modifications, answered in this order; each names a different order.
Entry block length 24 bytes.
| Field, offset and type | Description |
|---|---|
orderId0 · uint64 | Optional, null 0. Public identifier of the order to modify; exactly one of orderId or clientOrderId is required, and this field is zero when clientOrderId is used. |
newQtyScaled8 · int64 | Optional, null INT64_MIN. Optional positive target total gross base-asset quantity after modification, scaled by the pair's base_quantity_scale from GetSpotConfig; null leaves quantity unchanged; a value above the order's total quantity makes the item a replacement; at least one of newQtyScaled or priceTicks is required. |
priceTicks16 · int64 | Optional, null INT64_MIN. Optional positive target limit price after modification in quote units scaled by 1e9; null leaves price unchanged; a price other than the order's makes the item a replacement. |
clientOrderIdvar · varDataEncoding | Empty when length is 0. Client-generated identifier of the order to modify; exactly one of orderId or clientOrderId is required, and this value is empty when orderId is used. |
newClientOrderIdvar · varDataEncoding | Empty when length is 0. Optional new client order identifier; empty keeps the order's identifier. A value other than the order's identifier makes the item a replacement, and the successor carries it. A non-empty value must use 1 to 36 supported ASCII characters. |
BatchCancelOrders
Template ID 9 · block length 16 bytes. Requests cancellation of up to 50 orders, each accepted or rejected on its own; acceptance requests cancellation, and order events report the final state. correlationId is the batch's account-scoped idempotency identity: keep it and the items unchanged when retrying. A cancellation never takes effect twice, but a retry may answer an item whose order has since ended with ORDER_UNKNOWN. The same correlationId with different items may be rejected per item with CONFLICT_IDEMPOTENCY_KEY_REUSE, and reusing one identity across encodings is rejected the same way. A CommandReject UNAVAILABLE, or an acknowledgement that never arrived, may follow cancellations already requested: resend the same correlationId and items to request the rest, and do not assume no order was canceled.
| Field, offset and type | Description |
|---|---|
seq0 · uint64 | Required per-connection client sequence number; the first admitted message is 1 and each subsequently admitted message increments by exactly 1. |
correlationId8 · uint64 | Required nonzero account-scoped batch identity, copied unchanged into the acknowledgement or rejection. Keep it and the items unchanged when retrying; use a fresh one for each new batch. |
Group items (groupSizeEncoding: uint16 entry block length, uint16 count). 1 to 50 cancellations, answered in this order.
Entry block length 12 bytes.
| Field, offset and type | Description |
|---|---|
orderId0 · uint64 | Optional, null 0. Public identifier of the order to cancel; exactly one of orderId or clientOrderId is required, and this field is zero when clientOrderId is used. |
symbolId8 · uint32 | Optional, null 0. Optional stable numeric trading-pair identifier returned by GetSpotConfig; zero lets the service resolve the pair from the order key. |
clientOrderIdvar · varDataEncoding | Empty when length is 0. Client-generated identifier of the order to cancel; exactly one of orderId or clientOrderId is required, and this value is empty when orderId is used. |
Responses
Answers to your commands, one per command, in command order.
CommandAck
Template ID 20 · block length 67 bytes. Confirms that a trading command was accepted; later order and execution events report lifecycle outcomes.
| Field, offset and type | Description |
|---|---|
seq0 · uint64 | Required. Client sequence number copied from the accepted command. |
correlationId8 · uint64 | Required. Client correlation token copied from the accepted command. |
commandType16 · CommandType | Required. Type of command that was accepted. |
orderId17 · uint64 | Optional, null 0. Public order identifier returned for CREATE_ORDER, CANCEL_ORDER, or MODIFY_ORDER; zero when the command has no single-order result. |
symbolId25 · uint32 | Optional, null 0. Stable numeric trading-pair identifier associated with the result; zero when the command was not scoped to one pair. |
tsNs29 · uint64 | Required. Command acceptance timestamp in nanoseconds since the Unix epoch, UTC. |
matchedOrders37 · uint32 | Optional, null 0. For CANCEL_ALL_ORDERS, number of open orders matching the requested filters; zero for other commands or when none matched. |
submittedCancels41 · uint32 | Optional, null 0. For non-dry-run CANCEL_ALL_ORDERS, number of orders whose cancellation was requested, every one of them however many cancelledOrders lists; zero otherwise. |
failedCancels45 · uint32 | Optional, null 0. For non-dry-run CANCEL_ALL_ORDERS, number of matching orders whose cancellation could not be submitted; zero otherwise. |
resolvedBaseQtyScaled49 · int64 | Optional, null INT64_MIN. For CREATE_ORDER, gross base-asset quantity resolved for execution and scaled by the pair's base_quantity_scale from GetSpotConfig; null for other commands. |
submittedMaxQuoteDebitScaled57 · int64 | Optional, null INT64_MIN. For CREATE_ORDER using MAX_QUOTE_DEBIT sizing, the submitted hard all-in quote-asset debit limit scaled by the pair's quote_quantity_scale from GetSpotConfig; null otherwise. |
cancelledOrdersTruncated65 · uint8 | Required. Boolean encoded as 0 or 1; for non-dry-run CANCEL_ALL_ORDERS, 1 when more orders were cancelled than cancelledOrders lists, and submittedCancels counts every one; 0 otherwise. |
listingStatus66 · CancelAllListingStatus | Required. For CANCEL_ALL_ORDERS, INCLUDED on the initial response and NOT_RETAINED_READ_OPEN_ORDERS on a retry; a retried empty listing does not mean no cancellations were requested. UNSPECIFIED for other commands. |
Group cancelledOrders (groupSizeEncoding: uint16 entry block length, uint16 count). For non-dry-run CANCEL_ALL_ORDERS, the orders whose cancellation was requested, at most 200, oldest first (the order in which they were created); when more were cancelled, the 200 oldest. Each order reports its final state in order events; empty for other commands and for a dry run. Resending the same correlationId and criteria within 120 seconds returns the original counts and timestamp without a listing, with listingStatus NOT_RETAINED_READ_OPEN_ORDERS, and requests no new cancellations.
Entry block length 8 bytes.
| Field, offset and type | Description |
|---|---|
orderId0 · uint64 | Required. Public identifier of an order whose cancellation was requested. |
clientOrderIdvar · varDataEncoding | Empty when length is 0. Client-generated identifier of that order; empty when the order has none. |
CommandReject
Template ID 21 · block length 70 bytes. Reports a command-level failure without closing the connection.
| Field, offset and type | Description |
|---|---|
seq0 · uint64 | Required. Client sequence number copied from the rejected command when decodable; zero when unavailable. |
correlationId8 · uint64 | Required. Client correlation token copied from the rejected command when decodable; zero when unavailable. |
code16 · RejectCode | Required, 0 invalid. Stable machine-readable reason for the rejection. |
tsNs18 · uint64 | Required. Rejection timestamp in nanoseconds since the Unix epoch, UTC. |
rateLimitWeight26 · uint64 | Optional, null 0. Maximum weighted capacity of the applicable quota; zero when the rejection is not rate-limit related. |
rateLimitRemaining34 · uint64 | Optional, null UINT64_MAX. Weighted capacity remaining after the decision; null when the rejection is not rate-limit related. |
rateLimitRetryAfterNs42 · uint64 | Optional, null 0. Minimum delay in nanoseconds before retrying the rate-limited operation; zero when no delay applies. |
rateLimitPolicyVersion50 · uint64 | Optional, null 0. Version of the quota policy used for the decision; zero when the rejection is not rate-limit related. |
rateLimitOperation58 · RateLimitOperation | Optional, null 0. Trading operation whose quota was exhausted; null when the rejection is not rate-limit related. |
rateLimitPolicyClass59 · RateLimitPolicyClass | Optional, null 0. Quota family used for the decision; null when the rejection is not rate-limit related. |
rateLimitScope60 · RateLimitScope | Optional, null 0. Authenticated caller scope that owns the exhausted capacity; null when the rejection is not rate-limit related. |
rateLimitRefillModel61 · RateLimitRefillModel | Optional, null 0. Method by which the exhausted capacity replenishes; null when the rejection is not rate-limit related. |
existingOrderId62 · uint64 | Optional, null 0. Public order identifier holding the account's client order ID for a duplicate-client-order-ID rejection; zero when no existing holder is known or for other rejections. |
detailvar · varDataEncoding | Empty when length is 0. UTF-8 diagnostic text safe to display or log; clients must branch on code rather than this text. |
Pong
Template ID 22 · block length 16 bytes. Server response to Ping.
| Field, offset and type | Description |
|---|---|
seq0 · uint64 | Required. Client sequence number copied from the Ping. |
correlationId8 · uint64 | Required. Client correlation token copied from the Ping. |
payloadvar · varDataEncoding | Empty when length is 0. Opaque bytes copied unchanged from the Ping payload. |
SubscriptionAck
Template ID 23 · block length 28 bytes. Confirms the complete private event-channel subscription for this connection.
| Field, offset and type | Description |
|---|---|
seq0 · uint64 | Required. Client sequence number copied from the Subscribe command. |
correlationId8 · uint64 | Required. Client correlation token copied from the Subscribe command. |
channels16 · EventChannels | Required. Complete private event-channel bitset now active for the connection; zero means no private events are subscribed. |
tsNs20 · uint64 | Required. Subscription update timestamp in nanoseconds since the Unix epoch, UTC. |
BatchCreateAck
Template ID 26 · block length 64 bytes. Answers a BatchCreateOrders with one result per requested order, in request order; an accepted item is admitted, and later order and execution events report its lifecycle.
| Field, offset and type | Description |
|---|---|
seq0 · uint64 | Required. Client sequence number copied from the command. |
correlationId8 · uint64 | Required. Batch identity copied from the command. |
tsNs16 · uint64 | Required. Admission timestamp in nanoseconds since the Unix epoch, UTC; a replayed answer carries the original timestamp. |
acceptedCount24 · uint32 | Required. Number of items accepted. |
rejectedCount28 · uint32 | Required. Number of items rejected. |
rateLimitWeight32 · uint64 | Optional, null 0. Maximum weighted capacity of the batch operation's quota when an item was rejected with RATE_LIMIT_EXCEEDED; zero otherwise. |
rateLimitRemaining40 · uint64 | Optional, null UINT64_MAX. Weighted capacity remaining after the decision when an item was rejected with RATE_LIMIT_EXCEEDED; null otherwise. |
rateLimitRetryAfterNs48 · uint64 | Optional, null 0. Minimum delay in nanoseconds before retrying the rate-limited items; zero when no delay applies. |
rateLimitPolicyVersion56 · uint64 | Optional, null 0. Version of the quota policy used for the decision when an item was rejected with RATE_LIMIT_EXCEEDED; zero otherwise. |
Group results (groupSizeEncoding: uint16 entry block length, uint16 count). One result per requested order, in request order.
Entry block length 35 bytes.
| Field, offset and type | Description |
|---|---|
status0 · BatchItemStatus | Required. Whether the order was admitted. |
code1 · RejectCode | Optional, null 0. Reason the order was rejected; zero when accepted. |
orderId3 · uint64 | Optional, null 0. Public identifier of the admitted order; zero when rejected. |
resolvedBaseQtyScaled11 · int64 | Optional, null INT64_MIN. Gross base-asset quantity resolved for execution, scaled by the pair's base_quantity_scale from GetSpotConfig; null when rejected. |
submittedMaxQuoteDebitScaled19 · int64 | Optional, null INT64_MIN. The submitted hard all-in quote-asset debit limit of an admitted MAX_QUOTE_DEBIT order, scaled by the pair's quote_quantity_scale from GetSpotConfig; null otherwise. |
existingOrderId27 · uint64 | Optional, null 0. Public order identifier holding the account's client order ID for a duplicate-client-order-ID rejection; zero when no existing holder is known, including a duplicate rejected within the same batch before assignment, or for other outcomes. |
BatchReplaceAck
Template ID 27 · block length 73 bytes. Answers a BatchReplaceOrders with its admission receipt and one result per item, in request order; order events report each order's final state.
| Field, offset and type | Description |
|---|---|
seq0 · uint64 | Required. Client sequence number copied from the command. |
correlationId8 · uint64 | Required. Batch identity copied from the command. |
tsNs16 · uint64 | Required. Admission timestamp in nanoseconds since the Unix epoch, UTC. |
batchRequestId24 · uint64 | Required. Server-issued opaque identity of the batch, the same for every retry of it, for correlating order events and status lookups. |
status32 · BatchStatus | Required. Aggregate outcome of the batch. |
acceptedCount33 · uint32 | Required. Number of items admitted. |
rejectedCount37 · uint32 | Required. Number of items rejected. |
rateLimitWeight41 · uint64 | Optional, null 0. Maximum weighted capacity of the batch operation's quota when an item was rejected with RATE_LIMIT_EXCEEDED; zero otherwise. |
rateLimitRemaining49 · uint64 | Optional, null UINT64_MAX. Weighted capacity remaining after the decision when an item was rejected with RATE_LIMIT_EXCEEDED; null otherwise. |
rateLimitRetryAfterNs57 · uint64 | Optional, null 0. Minimum delay in nanoseconds before retrying the rate-limited items; zero when no delay applies. |
rateLimitPolicyVersion65 · uint64 | Optional, null 0. Version of the quota policy used for the decision when an item was rejected with RATE_LIMIT_EXCEEDED; zero otherwise. |
Group results (groupSizeEncoding: uint16 entry block length, uint16 count). One result per item, in request order.
Entry block length 20 bytes.
| Field, offset and type | Description |
|---|---|
status0 · BatchItemStatus | Required. Whether the item was admitted. |
code1 · RejectCode | Optional, null 0. Reason the item was rejected; zero when admitted. |
action3 · ReplaceAction | Optional, null 0. Whether the admitted item amended its order or replaced it with a successor; null when rejected. |
oldOrderId4 · uint64 | Optional, null 0. Public identifier of the order the item targeted: the orderId sent, or the order its clientOrderId names; zero only when that clientOrderId names no order. |
replacementOrderId12 · uint64 | Optional, null 0. Public identifier of the successor order of a REPLACED item; zero for AMENDED and rejected items. |
BatchCancelAck
Template ID 28 · block length 64 bytes. Answers a BatchCancelOrders with one result per requested cancellation, in request order; an accepted item requested cancellation, and order events report the final state.
| Field, offset and type | Description |
|---|---|
seq0 · uint64 | Required. Client sequence number copied from the command. |
correlationId8 · uint64 | Required. Batch identity copied from the command. |
tsNs16 · uint64 | Required. Acceptance timestamp in nanoseconds since the Unix epoch, UTC. |
acceptedCount24 · uint32 | Required. Number of items accepted. |
rejectedCount28 · uint32 | Required. Number of items rejected. |
rateLimitWeight32 · uint64 | Optional, null 0. Maximum weighted capacity of the batch operation's quota when an item was rejected with RATE_LIMIT_EXCEEDED; zero otherwise. |
rateLimitRemaining40 · uint64 | Optional, null UINT64_MAX. Weighted capacity remaining after the decision when an item was rejected with RATE_LIMIT_EXCEEDED; null otherwise. |
rateLimitRetryAfterNs48 · uint64 | Optional, null 0. Minimum delay in nanoseconds before retrying the rate-limited items; zero when no delay applies. |
rateLimitPolicyVersion56 · uint64 | Optional, null 0. Version of the quota policy used for the decision when an item was rejected with RATE_LIMIT_EXCEEDED; zero otherwise. |
Group results (groupSizeEncoding: uint16 entry block length, uint16 count). One result per requested cancellation, in request order.
Entry block length 11 bytes.
| Field, offset and type | Description |
|---|---|
status0 · BatchItemStatus | Required. Whether the cancellation was accepted. |
code1 · RejectCode | Optional, null 0. Reason the cancellation was rejected; zero when accepted. |
orderId3 · uint64 | Optional, null 0. Public identifier of the order: the one resolved when accepted, else the orderId sent; zero when neither is known. |
Events
Private events, sent after Subscribe enables their channel.
ExecutionEvent
Template ID 24 · block length 72 bytes. Private low-latency execution notification for one order in the authenticated account scope; the same execution may be sent first as PENDING and later as SETTLED.
| Field, offset and type | Description |
|---|---|
symbolId0 · uint32 | Required. Stable numeric trading-pair identifier returned by GetSpotConfig. |
matchId4 · uint64 | Required. Trade identifier monotonic within one trading pair; use with symbolId and orderId to de-duplicate PENDING and SETTLED notifications. |
matchSeq12 · uint64 | Required. Execution sequence monotonic within one trading pair; gaps are expected because this private feed includes only the authenticated account's executions. |
orderId20 · uint64 | Required. Public identifier of the authenticated account's order that received this fill. |
side28 · Side | Required, 0 invalid. Side of the authenticated account's order. |
liquidityRole29 · LiquidityRole | Required. Whether the authenticated account's order provided or removed liquidity. |
feeAsset30 · FeeAsset | Required. Asset selected for fees; this message does not include the fee amount, which is available from durable trade history after settlement. |
settlementStatus31 · SettlementStatus | Required. Whether financial settlement for this execution is pending or complete. |
fillQtyScaled32 · int64 | Required. Executed base-asset quantity for this fill, scaled by the pair's base_quantity_scale from GetSpotConfig. |
fillPriceTicks40 · int64 | Required. Execution price in quote units scaled by 1e9. |
remainingQtyScaled48 · int64 | Optional, null INT64_MIN. Order quantity remaining immediately after this execution, scaled by the pair's base_quantity_scale from GetSpotConfig; null on SETTLED notifications. |
matchTsNs56 · uint64 | Required. Execution timestamp in nanoseconds since the Unix epoch, UTC. |
gatewayTsNs64 · uint64 | Required. Timestamp when this WebSocket message was encoded, in nanoseconds since the Unix epoch, UTC; subtract matchTsNs to estimate server-side delivery latency. |
OrderEvent
Template ID 25 · block length 61 bytes. Private authoritative order lifecycle transition for one order in the authenticated account scope.
| Field, offset and type | Description |
|---|---|
symbolId0 · uint32 | Required. Stable numeric trading-pair identifier returned by GetSpotConfig. |
orderId4 · uint64 | Required. Public identifier of the authenticated account's order. |
version12 · uint32 | Required. Per-order state version starting at 1 and increasing with each published transition; ignore duplicate or older versions and recover current state through the Orders API after a gap. |
status16 · OrderStatus | Required. Lifecycle state after this transition; PENDING_REPLACE is not active liquidity. |
remainingQtyScaled17 · int64 | Required. Unexecuted base-asset quantity after this transition, scaled by the pair's base_quantity_scale from GetSpotConfig; zero for terminal states. |
cumulativeQtyScaled25 · int64 | Required. Cumulative executed base-asset quantity across the order lineage through this generation, including executions inherited from predecessors, scaled by the pair's base_quantity_scale from GetSpotConfig. |
eventTsNs33 · uint64 | Required. Order state-transition timestamp in nanoseconds since the Unix epoch, UTC. |
gatewayTsNs41 · uint64 | Required. Timestamp when this WebSocket message was encoded, in nanoseconds since the Unix epoch, UTC; subtract eventTsNs to estimate server-side delivery latency. |
timeInForce49 · TimeInForce | Required. Lifetime and fill policy of the order after this transition. |
expireAtTsNs50 · int64 | Optional, null INT64_MIN. Exact GTD expiry in nanoseconds since the Unix epoch, UTC; null for every other time-in-force policy. |
rejectReason58 · RejectCode | Required, 0 when none. For REJECTED: why the order was refused, the Orders API's error code of the same refusal; zero otherwise. |
cancelReason60 · CancelReason | Required, 0 when none. For CANCELED: why the order ended; zero otherwise. |
MarketResync
Template ID 29 · block length 13 bytes. Reports that this connection may have missed private order and execution events of one trading pair before this message. Sent only to connections whose subscription enables marketResync together with executions or orders, whether or not their account trades the pair; clients must opt in to receive it. The connection stays open and the events of every other pair are unaffected. On receipt, reconcile the pair's orders and executions through the Orders API, then apply this connection's later events of the pair, which follow this message in order and may repeat state the reconciliation already returned. One interruption may send it more than once, and each later one needs only the same reconciliation.
| Field, offset and type | Description |
|---|---|
symbolId0 · uint32 | Required. Stable numeric trading-pair identifier returned by GetSpotConfig. |
reason4 · MarketResyncReason | Required. Why events of the pair may have been missed; the recovery is the same for every reason. |
gatewayTsNs5 · uint64 | Required. Timestamp when this WebSocket message was encoded, in nanoseconds since the Unix epoch, UTC. |
Enums and bitsets
CancelAllListingStatus
uint8. Availability of the cancel-all order listing, independent of its submission outcome.
| Name and value | Description |
|---|---|
UNSPECIFIED · 0 | Listing status was not provided; used for other commands. |
INCLUDED · 1 | The initial response includes its listing, possibly empty and limited to 200 orders. |
NOT_RETAINED_READ_OPEN_ORDERS · 2 | A retry returns the original outcome and counts without its historical listing; read open orders for current state and use order updates for final outcomes. |
CommandType
uint8. Client command carried in a WebSocket binary message.
| Name and value | Description |
|---|---|
PING · 1 | Tests session liveness without submitting a trading command. |
CREATE_ORDER · 2 | Submits one new order for admission. |
CANCEL_ORDER · 3 | Requests cancellation of one order. |
MODIFY_ORDER · 4 | Requests changes to one existing order. |
CANCEL_ALL_ORDERS · 5 | Requests cancellation of all matching open orders in the authenticated account scope. |
SUBSCRIBE · 6 | Replaces the private event-channel subscription for the connection. |
BATCH_CREATE_ORDERS · 7 | Submits up to 20 new orders, each admitted or rejected on its own. |
BATCH_REPLACE_ORDERS · 8 | Modifies up to 50 orders on one trading pair, each amended in place or replaced, and admitted or rejected on its own. |
BATCH_CANCEL_ORDERS · 9 | Requests cancellation of up to 50 orders, each accepted or rejected on its own. |
Side
uint8. 0 means not set. Direction of an order or account execution.
| Name and value | Description |
|---|---|
BUY · 1 | Buy the base asset using the quote asset. |
SELL · 2 | Sell the base asset for the quote asset. |
OrderType
uint8. Price behavior requested for an order.
| Name and value | Description |
|---|---|
LIMIT · 1 | Executes only at the specified limit price or better. |
MARKET · 2 | Executes immediately against available liquidity subject to price protection. |
TimeInForce
uint8. Policy controlling how long an order may remain active and whether partial execution is allowed.
| Name and value | Description |
|---|---|
GTC · 1 | Good-til-canceled; unexecuted quantity may remain active until canceled. |
IOC · 2 | Immediate-or-cancel; executes available quantity immediately and cancels any remainder. |
FOK · 3 | Fill-or-kill; executes the entire quantity immediately or cancels without execution. |
GTD · 4 | Good-til-date; unexecuted quantity may remain active only before the exact expiry timestamp. |
FeeAsset
uint8. Asset in which order fees are charged; SELL orders must use QUOTE.
| Name and value | Description |
|---|---|
QUOTE · 1 | Charge fees in the quote asset. |
BASE · 2 | BUY-only option that deducts fees from the received base asset. |
OrderSizingKind
uint8. Required method used to size a new order.
| Name and value | Description |
|---|---|
BASE_QUANTITY · 1 | Size the order by an exact gross base-asset quantity. |
MAX_QUOTE_DEBIT · 2 | Size an eligible BUY order by a hard all-in quote-asset debit limit. |
STPMode
uint8. 0 means not set. Self-trade prevention mode.
| Name and value | Description |
|---|---|
EXPIRE_MAKER · 1 | Cancel the resting order when it would trade against the same root account, including its subaccounts. |
EXPIRE_TAKER · 2 | Cancel the incoming order when it would trade against the same root account, including its subaccounts. |
EXPIRE_BOTH · 3 | Cancel both orders when they would trade against the same root account, including its subaccounts. |
ModifyBehavior
uint8. 0 means not set. Policy controlling whether modification may retain or replace the existing order.
| Name and value | Description |
|---|---|
AMEND_OR_REPLACE · 1 | Amend in place when possible; otherwise cancel and replace the order. |
AMEND_ONLY · 2 | Amend in place and reject changes that require replacement. |
REPLACE_ONLY · 3 | Always cancel the existing order and create a replacement. |
RejectCode
uint16. 0 means not set. Stable machine-readable rejection reason; shared order-domain values use the same numbers as the Orders API. Zero means no rejection where a field allows it.
| Name and value | Description |
|---|---|
BAD_REQUEST · 1 | The message could not be decoded or was structurally invalid. |
INVALID_ARGUMENT · 2 | One or more request fields or field combinations were invalid. |
INSUFFICIENT_FUNDS · 3 | The account did not have enough available balance for the order. |
UNKNOWN_SYMBOL · 4 | The requested trading pair was unknown. |
BAD_PRICE · 5 | The requested price was invalid. |
BAD_QTY · 6 | The requested quantity was invalid. |
MIN_NOTIONAL · 7 | The order notional was below the pair minimum. |
QTY_STEP_SIZE · 8 | The quantity did not align with the pair step size. |
CONFLICT_DUPLICATE_CLIENT_ORDER_ID · 9 | The account-scoped client order identifier is retained from an earlier create request; reuse is rejected regardless of payload or order state. |
UNAVAILABLE · 10 | A required trading capability was temporarily unavailable. |
UNAUTHENTICATED · 11 | The caller was not authenticated. |
PERMISSION_DENIED · 12 | The authenticated caller was not allowed to perform the command. |
NOT_FOUND · 13 | The requested order or resource was not found. |
UPSTREAM_ERROR · 14 | A required dependency rejected or failed the command. |
FEE_ASSET_NOT_ALLOWED · 15 | The requested fee asset was not allowed for the order. |
PAIR_DISABLED · 16 | The trading pair was disabled. |
ORDER_UNKNOWN · 17 | The requested order was unknown in the authenticated account scope. |
INTERNAL_ERROR · 18 | The command failed because of an unexpected server error. |
POLICY_MARKET_DENY · 20 | The account policy did not allow trading on the requested pair. |
POLICY_MAX_NOTIONAL · 21 | The order exceeded the account policy maximum notional. |
POLICY_TRADING_HALTED · 22 | Trading was halted for the authenticated account scope. |
POLICY_SPOT_TRADE_DENY · 23 | The account policy did not allow spot trading. |
API_KEY_POLICY_REQUIRED · 27 | The API key required an attached trading policy. |
API_KEY_UNKNOWN · 28 | The API key could not be resolved. |
API_KEY_MARKET_DENY · 29 | The API key policy did not allow trading on the requested pair. |
PRICE_TICK_SIZE · 30 | The price did not align with the pair tick size. |
MIN_QTY · 31 | The quantity was below the pair minimum. |
BATCH_TOO_LARGE · 33 | The batch carried more items than the maximum allowed. |
POLICY_MAX_OPEN_ORDERS · 34 | The account reached its policy limit for open orders. |
MODIFICATION_REQUIRES_REPLACE · 35 | The requested modification required replacement but replacement was not allowed. |
CONFLICT_IDEMPOTENCY_KEY_REUSE · 36 | An idempotency key was reused with a different payload. |
MARKET_PRICE_UNAVAILABLE · 37 | No reference price was available to admit the market order. |
TRIGGER_PRICE_INVALID · 40 | The trigger price was invalid for the requested order. |
TRIGGER_PRICE_SOURCE_UNSUPPORTED · 41 | The requested trigger price source was unsupported. |
TRAILING_DISTANCE_INVALID · 42 | The trailing-stop distance was invalid. |
TRIGGER_NOT_FOUND · 43 | The trigger was not found. |
TRIGGER_STATUS_INVALID · 45 | The trigger's status did not allow the requested operation. |
TRIGGER_NOT_MODIFIABLE · 46 | The trigger did not support the requested change. |
CONFLICT_DUPLICATE_CLIENT_TRIGGER_ID · 47 | The client trigger ID was already used by another trigger. |
MAX_SLIPPAGE_INVALID · 48 | The maximum-slippage policy could not produce a valid pair-aligned execution bound. |
PAIR_NOT_LISTED_YET · 50 | The trading pair was known but not yet listed. |
PAIR_DELISTED · 51 | The trading pair was delisted. |
PAIR_CANCEL_ONLY · 52 | The trading pair accepted cancellations but not new or replacement orders. |
PAIR_POST_ONLY · 53 | The trading pair required post-only order placement. |
PAIR_REDUCE_ONLY · 54 | The trading pair did not accept new spot exposure. |
RISK_LIMIT · 55 | An account-level risk limit was exceeded. |
MARKET_HALTED · 56 | The market was halted. |
ACCOUNT_UNKNOWN · 57 | The authenticated account could not be resolved. |
POST_ONLY_CROSS · 58 | A post-only order would have immediately crossed the book. |
REDUCE_ONLY_BLOCKED · 59 | Reduce-only policy blocked the order. |
PRICE_BAND_VIOLATION · 60 | The order violated the market price band. |
MARKET_CAP_VIOLATION · 61 | The order violated the market-cap guard. |
EMPTY_BOOK · 62 | The market order could not execute because the book was empty. |
FOK_INSUFFICIENT_LIQUIDITY · 63 | The fill-or-kill order lacked sufficient immediate liquidity. |
ORDER_ALREADY_TERMINAL · 64 | The client order identifier referred to an order already in a terminal state. |
STALE_QUOTE · 65 | The client reference price was stale under the server drift policy. |
VALIDATION_ERROR · 66 | The request failed structural or cross-field validation. |
OVERLOADED · 67 | The connection or trading service reached bounded admission capacity. |
MAX_QUOTE_DEBIT_TOO_SMALL · 68 | The quote debit limit could not resolve one valid step-aligned base quantity. |
RATE_LIMIT_EXCEEDED · 69 | The authenticated account exhausted the applicable trading quota. |
CANCEL_REQUEST_EXPIRED · 73 | The cancellation expired before admission; use a fresh request ID for a new cancellation. |
MAX_QTY · 74 | The quantity was above the pair maximum: the market-order maximum for MARKET orders, the limit-order maximum otherwise. |
MAX_NOTIONAL · 75 | The order notional was above the pair maximum; a stricter account policy cap returns POLICY_MAX_NOTIONAL instead. |
QTY_AT_OR_BELOW_FILLED · 76 | The replacement total quantity was at or below the order's filled quantity: the order ended at its filled quantity and no replacement order was created. |
GATEWAY_MISCONFIGURED · 77 | The trading gateway that took the command is misconfigured for the order service behind it; an operator must correct it, and retrying does not help. |
INVALID_ORDER_ID · 80 | The order identifier or the replacement order identifier was not valid. |
CHILD_QTY_RAISE_NOT_ALLOWED · 81 | The quantity of a trigger's child order or a ladder order can't be raised above its planned quantity. Nothing changed. |
ATTACHED_RISK_NOT_SUPPORTED · 82 | Attached take-profit, stop-loss or trailing legs can't be applied here: this market takes none, an attached trailing stop isn't offered yet, or the modify changes them together with the order's price, quantity, client order ID or a replace. Nothing changed. |
SETTLEMENT_BACKLOGGED · 84 | The account has too many filled or ended orders whose settlement has not completed yet. Nothing changed; the request is accepted again once settlement catches up. |
ATTACHED_LEGS_EXCEEDED · 86 | The order already carries every attached take-profit, stop-loss and trailing-stop leg it may hold, so another attached leg was refused. |
FEE_ASSET_INVALID · 87 | The trigger's fee asset was not valid. |
FEE_CEILING_INVALID · 88 | The trigger's maximum fee rate was not valid. |
UNSUPPORTED_FIELD_SET · 89 | The trigger set a field that must be left unset. |
TRIGGER_FIRE_LIMIT_REACHED · 90 | The trigger could not fire again. |
CONDITION_FLAGS_INVALID · 91 | The trigger's condition flags were not valid. |
CONDITION_PARAMETER_SET · 92 | The trigger set a condition parameter its condition does not take. |
TWAP_CAPACITY_REACHED · 93 | The market had no room for another TWAP order. |
CHILD_ORDER_INCONSISTENT · 94 | The trigger's child order did not match the order the trigger requested, so the trigger failed and the child order was canceled. |
PRICE_LEVEL_QUANTITY_LIMIT · 127 | The order would take the total quantity resting at its price past the most a price level can hold, even if some quantity still fits. Nothing changed: a new order was not placed, a modified order keeps resting as it was, and the other orders at that price are unchanged. Another price or a smaller quantity, or the same order once less quantity rests at that price, is accepted. |
MARKET_QUOTE_STALE · 200 | The market order carried no client reference price, and the pair's reference quote (top of book) was older than its freshness bound when the order was admitted. |
MARKET_QUOTE_UNHEALTHY · 201 | The market order carried no client reference price, and the pair's reference quote could not be used to price it, for example because it postdated the order or carried an invalid price. |
INVALID_TIME_IN_FORCE · 202 | The time in force, or its expiry time, is not accepted for this order or for a trigger's child order type. |
QUICKSWAP_NOT_PERMITTED · 203 | The request carried QuickSwap terms that the account or market does not accept. |
DUPLICATE_ORDER_ID · 204 | The order identifier assigned to the request is already in use by another order of the market. Nothing changed. |
MAX_OPEN_ORDERS_TOTAL · 205 | The account has reached its maximum number of open orders across all markets. A stricter sub-account policy cap returns POLICY_MAX_OPEN_ORDERS instead. |
STP_MODE_NOT_ALLOWED · 206 | The self-trade prevention mode is not one the venue accepts for this order. |
PAIR_BACKLOGGED · 207 | The trading pair is busy with the account's earlier requests, so this one was not admitted and nothing was reserved. Retry shortly. |
PRICE_LEVELS_EXHAUSTED · 208 | The order book of the market holds its maximum number of distinct price levels, so an order at a new price cannot rest. Nothing changed. |
CLIENT_ORDER_IDS_EXHAUSTED · 209 | The account reserves its maximum number of client order IDs, including those of recently ended orders. Retry once they expire, or send the request without a client order ID. |
ORDER_ID_CONFLICT · 210 | The order identifier is held by a different, earlier order, so the request was not applied. Nothing changed. |
INVALID_SIDE · 211 | The order side, or a trigger's child order side, is not a known side. |
INVALID_ORDER_TYPE · 212 | The order type, or a trigger's child order type, is not a known order type. |
INVALID_STP_MODE · 213 | The self-trade prevention mode is not a known mode. |
INVALID_ORDER_FLAGS · 214 | An order flag is unknown, or not accepted with this order type or time in force, or on a trigger's child order. |
BATCH_OTHER_ITEM_INVALID · 215 | Another item of the same batch was invalid, so this item was not applied either. Nothing in the batch changed. |
REPLACE_ONTO_OWN_ID · 216 | The replacement order identifier equals the identifier of the order it replaces. |
INVALID_CLIENT_ORDER_ID · 217 | The client order ID is longer than 36 bytes or otherwise not valid. |
ORDER_SEQUENCE_EXHAUSTED · 218 | The account used every order identifier available to it in this market. Retrying does not help; contact support. |
INVALID_HANDLING_MODE · 219 | The order handling mode is not a known or accepted mode. |
FEE_SCHEDULE_UNAVAILABLE · 220 | The fees that apply to the order cannot be determined right now, so it was not admitted. Retry later. |
POLICY_UNAVAILABLE · 221 | The account's trading policy cannot be evaluated right now, so the order was not admitted. Retry later. |
CANCEL_ALL_AFTER_TIMEOUT_INVALID · 222 | The cancel-all-after timeout is neither 0, which disarms it, nor between 10 and 120 seconds. |
CANCEL_SCOPE_TOO_LARGE · 223 | The cancel-all request named more than 100 symbols. |
RATE_LIMIT_POLICY_UNAVAILABLE · 224 | No usable rate-limit policy applies to the account right now, so the request was refused rather than admitted unlimited. Retry later. |
SYSTEM_RATE_LIMITED · 225 | The venue-wide admission rate that the account shares with other accounts is exhausted. The account's own limit was not reached; retry shortly. |
ORDER_MODIFY_IN_PROGRESS · 226 | An earlier amend or replace of the order has not completed yet. Retry once it completes. |
ORDER_PLACEMENT_PENDING · 227 | The order, or the replace that created it, has not been placed on the book yet, so it cannot be modified. Retry shortly. |
INVALID_MODIFY_BEHAVIOR · 228 | The modify behavior is not a known behavior. |
BATCH_REPLACE_ONLY_REQUIRED · 229 | No longer returned: each BatchReplaceOrders item follows the AMEND_OR_REPLACE behavior. The value stays reserved. |
BATCH_SINGLE_SYMBOL_REQUIRED · 230 | An item of the batch modify named no symbol, another symbol than the batch's first item, or an order on another symbol, so the batch was refused. |
REQUEST_RECEIPTS_EXHAUSTED · 231 | The account keeps its maximum number of recent modify or batch requests for duplicate detection. Retry once earlier ones expire. |
INTENT_ID_INVALID · 232 | The cancel-all or cancel-all-after request carried an intent identifier of zero. |
DRY_RUN_INVALID · 233 | The cancel-all request's dry-run flag was neither 0 nor 1. |
CANCEL_ALL_AFTER_SCOPE_CONFLICT · 234 | A cancel-all-after is already due to fire, and the re-arm's scope does not cover every symbol of the pending one. |
NEW_ACCOUNT_CAPACITY_REACHED · 235 | The venue holds its maximum number of account access records, so an account trading this market for the first time cannot be admitted. Retry later. |
TRIGGER_CHILD_PRICE_NOT_MODIFIABLE · 236 | The modify patched the trigger's child limit price or price mode, which the trigger does not accept. |
TRIGGER_GENERATIONS_EXHAUSTED · 237 | The trigger reached its last modification. Nothing changed; cancel it and create a new trigger instead. |
TRIGGER_CONTROL_SHARE_EXHAUSTED · 238 | The account has its maximum number of trigger changes whose outcome is still pending. Retry shortly. |
TRIGGER_CONTROLS_BUSY · 239 | The venue's capacity for pending trigger changes is exhausted across accounts. Retry shortly. |
TRIGGER_TYPE_NOT_SUPPORTED · 240 | The trigger type is valid but not supported on this venue yet. |
INVALID_TRIGGER_TYPE · 241 | The trigger type is not a known type. |
TRIGGER_DIRECTION_INVALID · 242 | The trigger direction is neither ABOVE nor BELOW. |
TRIGGER_QTY_INVALID · 243 | The trigger's child order quantity is not positive. |
TRIGGER_BUY_REQUIRES_LIMIT · 244 | A buy trigger's child order is not a LIMIT order; its funds are reserved at the limit price. |
ACCOUNT_ROUTING_INVALID · 245 | The account's trading route is not configured for triggers, so the trigger was not admitted. Contact support if it persists. |
TRIGGER_LIMIT_EXCEEDED · 246 | The account has its maximum number of live and recently ended triggers. |
TRIGGER_CONTROL_IN_PROGRESS · 247 | An earlier change of the trigger has not completed yet. Retry once it completes. |
TRIGGER_PATCH_EMPTY · 248 | The trigger modify named no field to change. |
CLIENT_TRIGGER_ID_INVALID · 249 | The client trigger ID is empty, longer than 36 bytes or otherwise not valid. |
TRIGGER_ACTIVATION_PRICE_INVALID · 250 | The trailing trigger's activation price is not positive or not on the pair's tick. |
SLIPPAGE_TICKS_INVALID · 251 | The trigger's slippage bound in ticks is not valid for its child order. |
SLIPPAGE_BPS_INVALID · 252 | The trigger's slippage bound in basis points is not valid for its child order. |
TRIGGER_CONTROL_OUTCOME_UNKNOWN · 253 | The trigger change was not confirmed within its time bound. Its outcome is unknown and it may still apply; read the trigger before retrying. |
TRIGGER_CAPACITY_REACHED · 254 | The venue holds its maximum number of triggers across accounts right now. Retry later. |
RESERVATION_CAPACITY_REACHED · 255 | The venue's capacity for fund reservations is exhausted right now, so the trigger's child order could not be reserved. Retry later. |
CLIENT_ORDER_ID_CAPACITY_REACHED · 256 | The venue's capacity for reserved client order IDs is exhausted right now, so the trigger's child order could not reserve one. Retry later. |
ACCOUNT_RESERVATION_LIMIT_REACHED · 257 | The account's open orders and triggers hold its maximum number of fund reservations. |
INVALID_TRIGGER_CONTROL · 258 | The requested trigger operation is not a known operation. |
TRIGGER_PATCH_NOT_ALLOWED · 259 | A trigger operation other than modify carried field changes. |
TRIGGER_PATCH_FIELD_UNKNOWN · 260 | The trigger modify named a field that is not known. |
TRIGGER_PATCH_VALUE_UNMASKED · 261 | The trigger modify carried a value for a field its change mask does not name. |
TRIGGER_PATCH_PRICE_MODE_INVALID · 262 | The trigger modify's price mode is not a known mode. |
ACCOUNT_ORDERS_SUSPENDED · 263 | New orders, changes and trigger orders on this account are suspended until a balance issue is resolved; cancels still work. Nothing changed. |
TRAILING_SIDE_NOT_SUPPORTED · 264 | Not returned: trailing stops accept either side. |
TRAILING_CHILD_NOT_MARKET · 265 | A trailing stop that sells must have a MARKET child order. |
TWAP_DURATION_INVALID · 266 | The TWAP duration is shorter than 1 second or longer than about 292 years, the longest the venue clock represents. |
LIMIT_CHILD_SLIPPAGE_SET · 267 | The TWAP sets a slippage bound, but its slices are LIMIT orders, which take none. |
SLIPPAGE_BOUNDS_CONFLICT · 268 | The slippage bound is given both in ticks and in basis points; give only one. |
TWAP_INTERVAL_INVALID · 269 | The TWAP slice interval is shorter than 100 milliseconds or longer than its duration. |
LADDER_LEVEL_REJECTED · 270 | One of the ladder's orders can't be placed, so the ladder was not created. Nothing changed. |
LADDER_RANGE_TOO_NARROW · 271 | The ladder's price range is too narrow to place its orders at least one price tick apart. |
LADDER_LEVELS_INVALID · 272 | A ladder places from 2 to 100 orders. |
ORDER_LIMITS_UNAVAILABLE · 273 | This market's order limits aren't set yet, so it can't take new orders. |
ORDER_TYPE_NOT_ALLOWED_IN_AUCTION · 274 | This market is in an auction call and takes only limit orders that rest without crossing the book; market, immediate-or-cancel and fill-or-kill orders are refused. Nothing changed. |
POST_ONLY_NOT_ALLOWED_IN_AUCTION · 275 | This market is in an auction call; new post-only orders are refused. Nothing changed. |
QUICKSWAP_FEE_DETAILS_INCOMPLETE · 276 | The request's QuickSwap fee details are incomplete: a fee schedule needs a broker, and a broker or broker fee terms need a fee schedule. |
QUICKSWAP_MARKET_NOT_PRICED · 277 | The requested QuickSwap fee schedule doesn't price this market. |
QUICKSWAP_BROKER_FEE_TERMS_MISMATCH · 278 | The broker fee terms belong to another broker. |
QUICKSWAP_FEE_RECIPIENT_IS_PAYER · 279 | A QuickSwap fee would be paid into the account placing the order. |
QUICKSWAP_BROKER_FEE_TERMS_UNAVAILABLE · 280 | The broker fee terms aren't available yet; retry shortly. |
QUICKSWAP_ACCOUNT_OWNER_UNKNOWN · 301 | The QuickSwap account is not ready yet; no order was placed. Retry shortly. |
QUICKSWAP_BROKER_ACCOUNT_UNAVAILABLE · 281 | The broker's fee account isn't available yet; retry shortly. |
QUICKSWAP_DISABLED · 282 | QuickSwap isn't enabled for this account's trading. |
QUICKSWAP_ATTACHED_RISK_NOT_ALLOWED · 283 | QuickSwap orders can't carry take-profit or stop-loss legs. |
QUICKSWAP_ORDER_NOT_MODIFIABLE · 284 | QuickSwap orders can't be amended or replaced. |
QUICKSWAP_FEE_TOTAL_TOO_HIGH · 285 | The QuickSwap fees together would exceed the order's value. |
QUICKSWAP_BROKER_FEE_TERMS_INVALID · 286 | The broker fee terms are invalid and can't be used. |
QUICKSWAP_BROKER_INVALID · 287 | The broker's QuickSwap setup is invalid and can't be used. |
QUICKSWAP_FEE_SCHEDULE_INVALID · 288 | The QuickSwap fee schedule is invalid and can't be used. |
QUICKSWAP_MARKET_FEE_INVALID · 289 | The QuickSwap fee for this market is invalid and can't be used. |
QUICKSWAP_SETUP_INVALID · 290 | QuickSwap's setup is invalid, so QuickSwap orders can't be placed. |
QUICKSWAP_CAPACITY_REACHED · 291 | QuickSwap's capacity for fee settings is reached; this order can't be placed. |
ATTACHED_EXIT_WORKING · 292 | An exit order placed by one of the order's attached take-profit or stop legs is still working, so the order's attached legs can't be added, edited, paused or resumed now; removing a leg is still accepted. Nothing changed; retry once the exit completes. |
MARKET_TRIGGER_LIMIT_EXCEEDED · 293 | The account already has the most triggers one account may have on this market, attached take-profit, stop-loss and trailing legs included. Nothing changed; retry once one of them ends. |
MARKET_TWAP_LIMIT_EXCEEDED · 294 | The account already has the most TWAP orders one account may have on this market. Nothing changed; retry once one of them ends. |
MARKET_LADDER_LIMIT_EXCEEDED · 295 | The account already has the most ladder orders one account may have on this market. Nothing changed; retry once one of them ends. |
CHILD_QTY_EXCEEDS_REMAINING · 296 | The new quantity of a TWAP order's slice would leave more than the TWAP's remaining quantity. Nothing changed; a slice can be raised up to what the TWAP still has to execute. |
ORDER_CANCEL_OUTCOME_UNKNOWN · 297 | The order cancellation was sent but not confirmed in time. Its outcome is unknown and it may still apply; read the order, or for a cancel all the open orders, before retrying. |
ORDER_MODIFY_OUTCOME_UNKNOWN · 298 | The order modification was sent but not confirmed in time. Its outcome is unknown and it may still apply; read the order before retrying. |
ORDER_REPAIRING · 299 | This order is being canceled while the account's balances are brought back in line, so it can't be changed. Nothing changed; cancels still work, and the account's other orders can still be changed. |
ACCOUNT_REPAIRING · 300 | This account's orders are being canceled while its balances are brought back in line, so new orders, changes and trigger orders are paused for a short time. Nothing changed; cancels still work. Try again shortly. |
TRIGGER_WOULD_TRIGGER_IMMEDIATELY · 302 | The trigger price, or a trailing stop's activation price, is already reached by the price the trigger watches, so the trigger would fire or activate at once. Nothing changed; choose a price the market has not reached. |
ORDER_CREATE_OUTCOME_UNKNOWN · 303 | The order was sent but not confirmed in time. Its outcome is unknown and it may have been accepted; read the order by its client order ID, or read open orders, before retrying. For a batch create, every item's outcome is unknown; read them back, or resend the batch with the same correlationId and items within 15 minutes, which returns decided items' original results and retries the rest without admitting any item twice. |
TRIGGER_CREATE_OUTCOME_UNKNOWN · 304 | The trigger was sent but not confirmed in time. Its outcome is unknown and it may have been created; read the triggers for its client trigger ID before retrying. |
TRIGGER_SYMBOL_MISMATCH · 305 | The request names a different listed trading pair from the trigger's own. Nothing changed; name the trigger's own pair, or omit the symbol. |
MAX_OPEN_ORDERS_PER_PAIR · 306 | The account has reached its maximum number of resting orders in this market. Good-till-cancelled and good-till-date orders count until they end; immediate-or-cancel, fill-or-kill and market orders never count, and a replace keeps its order's place. Nothing changed; cancel a resting order in this market first. |
SELF_TRADE_PREVENTED · 307 | An attached take-profit, stop-loss or trailing stop order would have traded with another of your resting orders, so self-trade prevention expired it. The attached order stays active. New trades and price updates do not send it again while the other order is first in line at the best price; once that order is gone or no longer first there, it is sent again if its trigger condition still holds. Reported as a trigger's fire refusal, never as the answer to a command. |
SEQUENCE_OUT_OF_ORDER · 1001 | The client sequence did not equal the next expected sequence for this connection. |
CancelReason
uint8. 0 means not set. Why a CANCELED order ended, with the numbers of the Orders API's CancelReason. A cancel is no error: a refused order is REJECTED with a RejectCode instead. Zero means the order is not canceled.
| Name and value | Description |
|---|---|
USER_REQUEST · 1 | A cancel the account sent: a cancel, a batch cancel or a cancel-all. |
IOC_REMAINDER · 2 | The unfilled remainder of an immediate-or-cancel order. |
MARKET_REMAINDER · 3 | The unfilled remainder of a market order: the book ran out, or the next price was past the order's protection price. |
STP_EXPIRE_MAKER · 4 | Self-trade prevention canceled this resting order when an incoming order belonging to the same root account, including another subaccount of that root, would have matched it. |
STP_EXPIRE_TAKER · 5 | Self-trade prevention canceled this incoming order instead of matching a resting order belonging to the same root account, including another subaccount of that root. |
STP_EXPIRE_BOTH · 6 | Self-trade prevention canceled both this order and the order belonging to the same root account, including another subaccount of that root, that it would have matched. |
REPLACED · 7 | A replace ended this order and created its successor. |
GTD_EXPIRED · 8 | A good-till-date order reached its expiry time. |
QTY_AT_OR_BELOW_FILLED · 9 | An amend or replace set the order's total quantity at or below its filled quantity, so the order ended at its filled quantity. |
PAIR_DRAIN · 10 | The market was disabled: the exchange canceled its resting orders. |
ATTACHED_RISK_REFUSED · 11 | The market refused one of the order's attached take-profit, stop-loss or trailing-stop legs, so the order's remainder and its other legs were canceled. |
CANCEL_ALL_AFTER · 12 | The account's cancel-all-after timer reached its deadline without a heartbeat. |
ACCOUNT_REPAIR · 13 | Canceled by the exchange while it recovered the account; place new orders once the account trades again. |
TWAP_ROLLOVER · 14 | A TWAP slice its TWAP canceled at the next slice's due time; its unfilled remainder moves to the TWAP's later slices. |
STRATEGY_CANCEL · 15 | An order a trigger placed, such as a TWAP slice, a ladder level, a stop's child or an attached leg's exit, canceled because its trigger ended or another leg took over the exit. |
SYSTEM · 16 | The exchange canceled the order for a reason it does not name. |
MARKET_HALTED · 17 | The market was halted: the exchange canceled every open order of the market. Fills before the cancel stand. The market refuses new orders until it trades again. |
ATTACHED_EXIT_FIRED · 18 | The order's attached take-profit, stop-loss or trailing stop fired while the order still rested: the exchange canceled the order's unfilled remainder before the exit order was placed, so the exit never trades with it. Fills before the cancel stand. |
LiquidityRole
uint8. Liquidity role of the authenticated account's order in an execution.
| Name and value | Description |
|---|---|
MAKER · 1 | The order was resting and provided liquidity. |
TAKER · 2 | The order was incoming and removed liquidity. |
SettlementStatus
uint8. Financial finality of an execution notification.
| Name and value | Description |
|---|---|
PENDING · 1 | The execution occurred but financial settlement is not yet final; fee amounts are not yet available. |
SETTLED · 2 | Financial settlement completed; the execution may become available from trade history shortly afterward. |
OrderStatus
uint8. Current lifecycle state of an order.
| Name and value | Description |
|---|---|
PENDING · 1 | Accepted for processing but not yet active for execution. |
PENDING_CANCEL · 2 | Cancellation requested; the order may execute until cancellation completes. |
PENDING_REPLACE · 3 | Replacement requested; the replacement is not yet active for execution. |
WORKING · 4 | Active and eligible to rest or execute. |
FILLED · 5 | Fully executed with no remaining quantity. |
CANCELED · 6 | Canceled with no remaining active quantity. |
REJECTED · 7 | Rejected before becoming active. |
MarketResyncReason
uint8. Why a connection may have missed private events of one trading pair.
| Name and value | Description |
|---|---|
INTERRUPTED · 1 | Private event delivery for the pair was interrupted, for example during maintenance or recovery of the pair, and has resumed. |
DISCONTINUITY · 2 | The server detected missing, conflicting or unreadable private events of the pair. |
RateLimitOperation
uint8. 0 means not set. Trading operation whose rate limit rejected the command.
| Name and value | Description |
|---|---|
CREATE_ORDER · 1 | Single-order placement operation. |
CANCEL_ORDER · 2 | Single-order cancellation operation. |
MODIFY_ORDER · 3 | Single-order modification operation. |
CANCEL_ALL_ORDERS · 4 | Bulk cancellation operation. |
BATCH_CREATE_ORDERS · 5 | Batch order placement operation. |
BATCH_REPLACE_ORDERS · 6 | Batch order modification operation. |
BATCH_CANCEL_ORDERS · 7 | Batch order cancellation operation. |
RateLimitPolicyClass
uint8. 0 means not set. Quota family used for a rate-limit decision.
| Name and value | Description |
|---|---|
TRADING_PLACE · 1 | Quota shared by order placement and modification operations. |
TRADING_CANCEL · 2 | Quota shared by order cancellation operations. |
RateLimitScope
uint8. 0 means not set. Caller dimension that owns exhausted capacity.
| Name and value | Description |
|---|---|
ACCOUNT · 1 | Quota capacity is shared by the authenticated account. |
RateLimitRefillModel
uint8. 0 means not set. How exhausted quota capacity becomes available again.
| Name and value | Description |
|---|---|
CONTINUOUS · 1 | Capacity replenishes continuously over time. |
BatchItemStatus
uint8. Outcome of one item of a batch command.
| Name and value | Description |
|---|---|
ACCEPTED · 1 | The item was admitted or accepted for processing; later order events report its lifecycle. |
REJECTED · 2 | The item was rejected; its code names the reason and states what, if anything, the item changed. |
BatchStatus
uint8. Aggregate outcome of a BatchReplaceOrders command.
| Name and value | Description |
|---|---|
ADMITTED · 1 | Every item was admitted. |
PARTIALLY_ADMITTED · 2 | Some items were admitted and others rejected. |
REJECTED · 3 | Every item was rejected. |
ReplaceAction
uint8. 0 means not set. What an admitted BatchReplaceOrders item did to its order.
| Name and value | Description |
|---|---|
AMENDED · 1 | The order kept oldOrderId and no successor order was created: it was amended in place and kept its queue priority, or, when the new total quantity was at or below its filled quantity, it ended at its filled quantity. Keep tracking oldOrderId. |
REPLACED · 2 | The order ended and the successor order replacementOrderId took its place, with its queue priority reset. |
EventChannels
uint32 bitset. Private event channels enabled for this authenticated connection. Unlisted bits must be zero.
| Choice | Bit and mask | Description |
|---|---|---|
executions | 0 · 0x1 | Receive private execution notifications for the authenticated account scope. |
orders | 1 · 0x2 | Receive private order lifecycle notifications for the authenticated account scope. |
marketResync | 2 · 0x4 | Receive MarketResync when private events of a trading pair may have been missed, while executions or orders is also enabled. Without it, such a miss closes the connection with WebSocket status 1012 instead; reconnect, then recover orders and executions through the Orders API. |
OrderFlags
uint32 bitset. Order behavior flags. Unlisted bits must be zero.
| Choice | Bit and mask | Description |
|---|---|---|
postOnly | 0 · 0x1 | Reject the order rather than execute immediately; valid only for GTC limit orders. |