Skip to content
LogoLogo

Place orders

Endpoint

POST /exchange

Selector: action.type: "order"

Purpose

Places one or more perpetual limit orders for the authorized customer's account. The enclave applies the customer's risk constraints before native execution through the pooled account.

Authorization

Owner or permitted trading agent. The SDK signs the action; see raw signing for custom clients.

Request fields

FieldTypeRequiredMeaning
actionObjectYesThe supported action described below.
nonceUnsigned integerYesTrading nonce; native-style millisecond timestamp convention.
signatureObjectYesWallet signature containing r, s and recovery byte v (27 or 28).
expiresAfterUnsigned integer or nullNoRequest expiry in Unix milliseconds.
vaultAddressNullNoOmit or use null; customer subaccount/vault routing is outside this profile.

The action object contains:

FieldTypeRequiredMeaning
action.typeStringYes"order".
action.ordersArrayYesBetween 1 and 32 order objects.
action.groupingStringYes"na".
action.orders[].aUnsigned integerYesSupported perpetual asset index.
action.orders[].bBooleanYestrue for buy; false for sell.
action.orders[].pDecimal stringYesPositive limit price.
action.orders[].sDecimal stringYesPositive order size.
action.orders[].rBooleanYesReduce-only flag.
action.orders[].tObjectYes{"limit":{"tif":"Gtc"}}.
action.orders[].cHex stringNoClient order ID: 0x followed by 32 hexadecimal characters.

See the shared trading envelope for the common signing and routing fields.

Request example

The signature and timestamps below are illustrative, not valid authorization. Asset 0 is illustrative; the deployment's supported markets determine valid indexes.

{
  "action": {
    "type": "order",
    "orders": [
      {
        "a": 0,
        "b": true,
        "p": "100000",
        "s": "0.001",
        "r": false,
        "t": {
          "limit": {
            "tif": "Gtc"
          }
        },
        "c": "0x11111111111111111111111111111111"
      }
    ],
    "grouping": "na"
  },
  "nonce": 1796250000000,
  "signature": {
    "r": "0x1111111111111111111111111111111111111111111111111111111111111111",
    "s": "0x2222222222222222222222222222222222222222222222222222222222222222",
    "v": 27
  }
}

Response fields

FieldMeaning
status"ok" for an admitted request or "err" for a request-level rejection.
responseResponse object on success; a reason string for a request-level rejection.
response.type"order" for the order response.
response.data.statusesOne result per submitted order, in request order.
response.data.statuses[].resting.oidOrder ID for a resting order.
response.data.statuses[].filled.oidOrder ID for a filled order.
response.data.statuses[].filled.totalSzTotal filled size reported by a filled result.
response.data.statuses[].filled.avgPxAverage fill price reported by a filled result.
response.data.statuses[].errorRejection reason for an individual child.

Response example

A resting acknowledgement has this shape:

{
  "status": "ok",
  "response": {
    "type": "order",
    "data": {
      "statuses": [
        {
          "resting": {
            "oid": 12345
          }
        }
      ]
    }
  }
}

Constraints

This profile supports Gtc limit orders with grouping: "na". A batch contains between 1 and 32 orders. IOC, post-only ALO, trigger orders, grouped TP/SL and builder fields are outside the supported action shape.

The customer planner accepts up to six fractional price digits and eight fractional size digits after ignoring trailing zeros. Market and venue constraints still apply. Price, size and market checks can reject an individual child.

An acknowledgement is distinct from reconciled fill and position accounting. An uncertain result retains the corresponding reservations until its outcome is reconciled. A missing response is not permission to blindly resubmit.