Skip to main content
WSS

Quickstart

1. Get a token

2. Connect to the WebSocket

Pass the token as an Authorization header on the WebSocket upgrade request. Invalid or missing tokens are rejected with HTTP 401 before the connection is established.
Replace gateway.sandbox.architect.exchange with gateway.architect.exchange for production.

3. Login response

On successful connection, the server sends a login response with rid: 0 containing your open orders:

4. Place an order

The server responds with the order ID:
You then receive order lifecycle events as they happen (acknowledged t="n", filled t="f", canceled t="c", rejected t="j").

Cancel on Disconnect

To automatically cancel all orders placed during a WebSocket session when the connection drops, pass the cancel_on_disconnect query parameter when opening the connection:
Only orders sent on that specific connection are canceled; orders placed via other connections or the REST API are unaffected.

Estimated funding rate

Request the live estimated funding rate for a symbol with a t="ef" message:
The server replies with the estimate, correlated by rid:
status is one of ready, settlement_pending, or unavailable. The numeric fields are populated only when status is ready; otherwise res.reason explains why no estimate is available. The same estimate is also published on the market data ticker stream — see Websocket marketdata.
token
type:http

Bearer token authentication using user/session tokens from /api/get_user_token.

To connect to the WebSocket, include the Authorization header:

Place Order Request
type:object

Request to place a new order (t="p")

Cancel Order Request
type:object

Request to cancel an existing order (t="x"). Exactly one of oid or cid must be provided.

Cancel All Orders Request
type:object

Request to cancel all open orders (t="X")

Replace Order Request
type:object

Request to cancel and replace an existing order with a new order (t="r"). Exactly one of oid or cid must be provided. The replacement order inherits the original's client order ID (cid).

Get Open Orders Request
type:object

Request to retrieve all open orders (t="o")

Get Estimated Funding Rate Request
type:object

Request the live estimated funding rate for a symbol (t="ef")

Login Response
type:object

Initial response upon WebSocket connection (rid=0)

Place Order Response
type:object

Response to place order request

Cancel Order Response
type:object

Response to cancel order request

Replace Order Response
type:object

Response to replace order request

Cancel All Orders Response
type:object

Response to cancel all orders request

Get Open Orders Response
type:object

Response to get open orders request

Get Estimated Funding Rate Response
type:object

Response to get estimated funding rate request

Heartbeat Event
type:object

Heartbeat/timestamp event (t="h")

Cancel Rejected Event
type:object

Order cancel request was rejected (t="e")

Order Acknowledged Event
type:object

Order has been acknowledged by the exchange (t="n")

Order Canceled Event
type:object

Order has been canceled (t="c")

Order Replaced/Amended Event
type:object

Order has been replaced or amended (t="r")

Order Rejected Event
type:object

Order has been rejected (t="j")

Order Expired Event
type:object

Order has expired (t="x")

Order Done For Day Event
type:object

Order is done for the day (t="d")

Order Partially Filled Event
type:object

Order has been partially filled (t="p")

Order Filled Event
type:object

Order has been completely filled (t="f")