Skip to content
LogoLogo

openOrders

Endpoint

WebSocket /ws

Selector: subscription.type: "openOrders"

Purpose

Streams the selected customer's open-order list, with an initial list and updates when that list changes.

Authorization

Owner or approved reader for subscription.user. The SDK signs requests. Current permissions are checked before delivery; expiry or revocation stops access.

Request fields

FieldTypeRequiredMeaning
methodStringYes"subscribe".
authObjectYesRequest proof with timestamp, nonce and signature; see authorization.
subscriptionObjectYesSubscription definition.
subscription.typeStringYes"openOrders".
subscription.userAddressYesCustomer account authorized by the request signer.
subscription.dexStringNoOmit or use "" for the default DEX. Other values are unsupported.

Request example

Test fixture. Generate a fresh proof before use. Fixture inputs.

{
  "method": "subscribe",
  "subscription": {
    "type": "openOrders",
    "user": "0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf"
  },
  "auth": {
    "timestamp": 1796250000000,
    "nonce": "0x0303030303030303030303030303030303030303030303030303030303030303",
    "signature": "0xca60c8cb82aa8b58b8283a3a2c324a0cba31c4162b0c942523f7c53f2f54ce455b072a9f2bdca857ae08d5b27bf01f746d011a30bdce4b8b5ea72dad34b55f4b1c"
  }
}

Response fields

First receive a subscribe acknowledgement, then data:

FieldMeaning
channel"openOrders".
dataCustomer open-order message.
data.dex"" for the default DEX.
data.userSelected customer account address.
data.ordersCurrent open-order array; empty when there are no open orders in this customer view.

Each nonempty data.orders entry contains:

FieldMeaning
coinConfigured market name.
limitPxLimit price as a decimal string.
oidOrder ID in the customer order view.
side"B" for buy or "A" for sell.
szRemaining size as a decimal string.
timestampOrder time in Unix milliseconds.
cloidClient order ID, or null if absent.

Response example

{
  "channel": "openOrders",
  "data": {
    "dex": "",
    "user": "0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf",
    "orders": []
  }
}

Constraints

  • Each update contains the current order array rather than a list of field-level patches. Unchanged arrays are not resent.
  • A subscription update is an observation of order state, not permission to infer an unobserved fill.
  • Duplicate requests acknowledge the existing subscription without another snapshot.

unsubscribe stops this subscription. WebSocket overview covers connection limits and reconnect behavior.