Place batch orders
Place up to 100 orders in a single request.
address query parameter matching the master Ethereum address for X-API-Key (same as single POST /placeOrder).
Signed per order. This endpoint requires the X-Signature header to be present (non-empty); its value is not verified — set it to any one element’s signature. Omitting it rejects every element with invalid order signature. Each element of orders carries its own signature over the ordersign typed canonical payload for that order (op 1) — the same bytes a standalone placeOrder signs; the shared X-API-Key + X-Timestamp headers authenticate the batch. The whole batch consumes a single replay slot. The top-level grouping is not individually signed.
Response behavior
Asynchronous. The endpoint returns either202 Accepted (the common case — the batch was forwarded to the matching engine and per-order rows do not carry terminal state) or 200 OK (the gateway already had definitive state for the batch by the time it responded; per-order status reflects that state). In both cases each row echoes the accepted orderId / clientId so subscribers can correlate WebSocket events with the request. To observe each order’s full lifecycle (OPEN, FILLED, CANCELED, REJECTED, fills, etc.) clients must subscribe to the orders WebSocket channel (and userFills for trade-level events). Per-order validation failures are still returned synchronously as status: ERROR with an error message in the corresponding responses[] entry; valid rows are forwarded to the matching engine (partial success).
TPSL groupings
Set the top-levelgrouping field to submit a take-profit / stop-loss bundle instead of plain orders. The three grouping modes are:
partialTpsl
Place 1–2 TPSL legs sized to a user-specified quantity. Every order must settpslType (STOP_LOSS or TAKE_PROFIT) and stopPrice. Two legs must be one of each trigger type.
positionTpsl
Same shape aspartialTpsl but the engine resizes each leg to close the account’s full open position at trigger time (isPositionTPSL is implicitly true). Use quantity: "0" on each leg; the engine replaces it at trigger. At most one TP and one SL may be active per account+market — a second placement is rejected with POSITION_TPSL_ALREADY_EXISTS.
entryTpsl
Submit an entry order together with 1–2 bound TPSL children in a single atomic bundle (2–3 orders total). The entry leg has notpslType; each child leg sets tpslType. When the entry is canceled, all child TPSL legs are automatically cascade-canceled.
Authorizations
Hex-encoded Ed25519 public key (64 chars). The public key IS the API key — register it via POST /createApiKey. Required on every authenticated request, both read-only and signed.
Unix time in nanoseconds as a decimal string (e.g. "1713825891591000000"). Millisecond or second epochs are rejected with 401 Unauthorized. Must be within ±30,000 ms (MaxTimestampDriftMs, the drift window stays configured in milliseconds) of server wall-clock, or the request is rejected with 401 Unauthorized. Required on all mutating / credential-creating endpoints. This same value must appear as the ct field in the ordersign typed canonical payload (single-order endpoints) or in each element's ct field (batch endpoints).
Lowercase hex-encoded Ed25519 signature (128 chars).
Single-order endpoints (placeOrder, cancelOrder, modifyOrder, and other non-batch mutating routes) sign over the ordersign typed canonical payload — a compact, key-sorted JSON object built from parsed request fields using engine-native integer values:
ct must equal the X-Timestamp header value. Keys in brackets are conditional (omitted when empty). op values: 1=place, 2=cancel, 3=modify. See the ordersign package for field definitions and reference signing code.
Other signed routes (e.g. createApiKey, tokens, userPreferences) still use the legacy scheme: signing_message = X-Timestamp + ACTION + canonicalJSON(body), where ACTION is the camelCase final path segment.
Batch endpoints (batchPlaceOrders, batchCancelOrders) do NOT use this header. They authenticate with per-element typed ordersign signatures embedded in the request body (see the global auth description and the per-field signature descriptions on OrderRequest / CancelOrderRequest).
Read endpoints are authenticated by ?address= (and optionally X-API-Key) only — no signature is required. The one exception is GET /v1/affiliate/inviteCodes, which returns bearer secrets and therefore requires the full header triple; with no body its signing message is X-Timestamp + ACTION. canonicalJSON(body) is the JSON body with object keys sorted lexicographically at every level and no whitespace; the server canonicalizes the received body before verifying, so only the bytes signed over must be canonical. Required on all mutating / credential-creating endpoints.
Query Parameters
Master Ethereum address for this API key (must match address from POST /createApiKey for the same key). Required on REST for account-scoped reads and for place/cancel. Invalid hex → 400; mismatch with key → 403.
20-byte EVM address as hex: optional 0x or 0X prefix and exactly 40 hexadecimal digits. API responses normalize to lowercase a–f after 0x.
^(0x|0X)?[0-9a-fA-F]{40}$Body
Request body for POST /batchPlaceOrders. Supports plain limit/market orders as well as three TPSL grouping modes controlled by the top-level grouping field.
Plain batch (grouping omitted or "na") Send up to 100 standard LIMIT or MARKET orders.
TPSL groupings — set grouping to one of partialTpsl, positionTpsl, or entryTpsl to submit a trigger-order bundle. Shape constraints are enforced at the request level:
partialTpsl— 1 or 2 TPSL legs; every order must settpslType. Two legs must be oneSTOP_LOSSand oneTAKE_PROFIT. The order size is user-controlled.positionTpsl— same shape aspartialTpslbut the engine resizes each leg to the full open position at trigger time.isPositionTPSLis implicitly true.entryTpsl— 2 or 3 orders: exactly one entry leg (notpslType) plus 1–2 TPSL child legs. The TPSL children are automatically cascade-canceled when the entry is canceled.
Array of orders to place. Length constraints depend on grouping:
na(default): 1–100 orders.partialTpsl/positionTpsl: 1–2 TPSL orders.entryTpsl: 2–3 orders (1 entry + 1–2 TPSL children).
1 - 100 elementsClassifies a batchPlaceOrders submission so the gateway can route and validate it correctly. Omit or set to "na" for a plain (non-TPSL) batch.
na, partialTpsl, positionTpsl, entryTpsl Response
Batch processed and the gateway already has definitive state for the rows. Per-order status reflects that state. Treat as best-effort enrichment of the 202 path; the orders WebSocket channel is still the source of truth.