The WebSocket feed encodes all messages as JSON. All response messages contain a type and a channel field.

Message types

These are possible values for the type field:

  • snapshot: contains current snapshot of current market or account data.
  • update: contains an update about the current market data.
  • subscribed: indicates a successful subscription to the channel.
  • unsubscribed: indicates a successful un-subscription to the channel.
  • pong: indicates a successful ping-pong operation.
  • error: exists when an error occurs. There will be accompanying fields message with the error message and (optional) code for the standard HTTP error code

Request format

  • op: one of sub, unsub or ping
  • channeland product : Name of the channel and product, currently supported values are:
    • book: support products like BTC-PERP, ETH-PERP, SOL-PERP, etc
    • ticker: support products like BTC-PERP, ETH-PERP, SOL-PERP, etc
    • trades: support products like BTC-PERP, ETH-PERP, SOL-PERP, etc
    • orders: support products like BTC-PERP, ETH-PERP, SOL-PERP, etc
    • oracle: support assets like BTC, ETH, SOL , etc
    • positions: no need provide products here

Response format

  • channel: See above section for possible channel values
  • type: See above section for possible message types
  • data: The realtime data feed
  • product: Product ID of the requested data feed
  • code: standard HTTP error codes if there type is error
  • message: Error message where type is error