Skip to content

Ticker

WebSocket Ticker

Subscribe

Request Format

{
  "op":"subscribe",
  "args":[
    "<topic 1>",
    "<topic 2>",
    "...",
    "<topic n>"
  ]
}

Topic Description

  • Topic format: "usdt/ticker.{instrument_id}"
Name Type Mandatory Description
instrument_id string YES contract abbreviation, such as BTC-SWAP. If this value is "all", you will get the ticker information of all contracts.

Request Example

{
    "op": "subscribe",
    "args": [
        "usdt/ticker.BTC-SWAP",
        "usdt/ticker.all"
    ]
}

Response Example

{
  "topic":"usdt/ticker.BTC-SWAP",
  "data":[
    {
      "symbol":"BTC-SWAP",          // instrument_id
      "lastPrice":"29926.5",        // last price
      "markPrice":"29927.9",        // mark price
      "bestAskPrice":"29926.7",     // 1st ask
      "bestBidPrice":"29926.4",     // 1st bid
      "high24h":"30544.0",          // 24h highest price
      "low24h":"29820.0",           // 24h lowest price
      "open24h":"30035.7",          // 24h open price
      "volume24h":"89286739.0",     // 24h volume
      "bestAskVolume":"18004.0",    // 1st ask volume
      "bestBidVolume":"17919.0",    // 1st bid volume
      "timestamp":1681281991103,    
      "openPrice":"30200.5",        // open price
      "indexPrice":"29927.9",       // index price
      "fundingRate":"0.000298",     // funding rate
      "openInterest":""             // the quantities of relative position 
    }
  ]
}

Unsubscribe

Request Format

{
  "op":"unsubscribe",
  "args":[
    "<topic 1>",
    "<topic 2>",
    "...",
    "<topic n>"
  ]
}

Topic Description

  • Topic format: "usdt/ticker.{instrument_id}"
Name Type Mandatory Description
instrument_id string YES contract abbreviation, such as BTC-SWAP. If this value is "all", you will get the ticker information of all contracts.

Request Example

{
    "op": "unsubscribe",
    "args": [
        "usdt/ticker.BTC-SWAP",
        "usdt/ticker.all"
    ]
}