WebSocketTrade WebSocket

GET

Establish a WebSocket connection to get real-time updates for order books. Subscribe to a live feed of all outstanding buy and sell orders on the market for specific coins and tokens. Send messages when specific market conditions occur.

Header Params

  • Authorization string required
    Bearer token for authorization

Body Params

object

  • type string required
    The event type (e.g. "subscribe" or "unsubscribe")
  • channel string required
    The subscription channel (e.g. "level2" for order books)
  • accountId string required
    The ID of the account
  • productId string required
    The ID of product. (e.g. "TBTC-TUSD*")
  • includeCumulative boolean
    Include cumulative size in each price level. When true, each level is [price, size, cumulativeSize] instead of [price, size]. cumulativeSize is the running total of size from the top of that side through the level.

    Defaults to false

Responses

101

Switching Protocols. Once connected, the server may send:

  • WsOrderBooksResponse — level2 order book snapshot/updates
  • WsSubscriptionResponse — confirmation after every subscribe/unsubscribe request

Response Body

ONE OF

  • channel string
    The channel name (e.g. "level2").
  • type string
    The type of the response (e.g. "snapshot").
  • product string
    The product name (e.g. "TBTC-TUSD*").
  • time string date-time
    The timestamp of the snapshot.
  • bids array of array
    An array of bid levels [price, size] or [price, size, cumulativeSize] when includeCumulative is true. cumulativeSize is the running total of size from the top of that side through the level.
  • asks array of array
    An array of ask levels [price, size] or [price, size, cumulativeSize] when includeCumulative is true. cumulativeSize is the running total of size from the top of that side through the level.
403
Forbidden - Insufficient permissions

Response Body

object

  • error string required
  • errorName string required
  • reqId string required