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 fieldsmessagewith the error message and (optional)codefor the standard HTTP error code
Request format
op: one ofsub,unsuborpingchannelandproduct: Name of the channel and product, currently supported values are:book: support products like BTC-PERP, ETH-PERP, SOL-PERP, etcticker: support products like BTC-PERP, ETH-PERP, SOL-PERP, etctrades: support products like BTC-PERP, ETH-PERP, SOL-PERP, etcorders: support products like BTC-PERP, ETH-PERP, SOL-PERP, etcoracle: support assets likeBTC,ETH,SOL, etcpositions: no need provide products here
Response format
channel: See above section for possible channel valuestype: See above section for possible message typesdata: The realtime data feedproduct: Product ID of the requested data feedcode: standard HTTP error codes if theretypeiserrormessage: Error message wheretypeiserror