This page will help you get started with Ticker Websocket.

Channel: ticker

The ticker channel provides latest best bid and ask market data. All markets are of type update. Updates are sent when the new data is available.

🚧

Empty book

When price and size are both zero, it means that side of the book is empty.

wscat -c wss://ws.testnet.bsx.exchange/ws -x '{"op":"sub","channel":"ticker","product":"BTC-PERP"}'
{"type":"message", "connection_id":"8f8b70d9-86b8-42e8-bda0-c6277b43270d"}
{"channel":"ticker","product":"BTC-PERP","type":"subscribed"}
{"channel":"ticker","product":"BTC-PERP","type":"update","data":{"bid":{"price":"43045.4","size":"10.0789"},"ask":{"price":"43046","size":"0.2407"},"timestamp":1703699063986504000,"gsn":2219507}}
{"channel":"ticker","product":"BTC-PERP","type":"update","data":{"bid":{"price":"43045.4","size":"10.0789"},"ask":{"price":"43047","size":"0.3916"},"timestamp":1703699064041902000,"gsn":2219511}}
// Request
{
  "op": "sub",
  "channel": "ticker",
  "product": "BTC-PERP"
}
// Response
{
  "channel": "ticker",
  "product": "BTC-PERP",
  "type": "update",
  "data": {
    "bid": {
      "price" :"37201.52",
      "size": "123.45"
    }, 
    "ask": {
      "price": "37205.12",
      "size": "123.32"
    },
    "timestamp": 1703513424291498000, // in nanosecond
    "gsn": 2219507 // exchange's internal global sequence number
  } 
}