Skip to main content

Ticker

Subscribe to the ticker stream.

note
  • This topic utilises the snapshot field and delta field. If a response param is not found in the message, then its value has not changed.

Push frequency: Derivatives - 100ms, Spot - real-time

Topic:
tickers.{symbol}

Response Parameters

ParameterTypeComments
topicstringTopic name
typestringData type. snapshot,delta
csintegerCross sequence
tsnumberThe timestamp (ms) that the system generates the data
dataarrayObject
> symbolstringSymbol name
> tickDirectionstringTick direction
> price24hPcntstringPercentage change of market price in the last 24 hours
> lastPricestringLast price
> prevPrice24hstringMarket price 24 hours ago
> highPrice24hstringThe highest price in the last 24 hours
> lowPrice24hstringThe lowest price in the last 24 hours
> prevPrice1hstringMarket price an hour ago
> markPricestringMark price
> indexPricestringIndex price
> openIntereststringOpen interest size
> openInterestValuestringOpen interest value
> turnover24hstringTurnover for 24h
> volume24hstringVolume for 24h
> nextFundingTimestringNext funding timestamp (ms)
> fundingRatestringFunding rate
> bid1PricestringBest bid price
> bid1SizestringBest bid size
> ask1PricestringBest ask price
> ask1SizestringBest ask size

Subscribe Example

const socket = new WebSocket('wss://stream-testnet.zoomex.com/v3/public/linear');

socket.onopen = function() {
const subscribeMsg = {
"op": "subscribe",
"args": ["tickers.BTCUSDT"]
};
socket.send(JSON.stringify(subscribeMsg));
};

socket.onmessage = function(event) {
};

socket.onclose = function(event) {
};

Response Example

```json
{
"topic": "tickers.BTCUSDT",
"type": "snapshot",
"data": {
"symbol": "BTCUSDT",
"tickDirection": "PlusTick",
"price24hPcnt": "0.017103",
"lastPrice": "17216.00",
"prevPrice24h": "16926.50",
"highPrice24h": "17281.50",
"lowPrice24h": "16915.00",
"prevPrice1h": "17238.00",
"markPrice": "17217.33",
"indexPrice": "17227.36",
"openInterest": "68744.761",
"openInterestValue": "1183601235.91",
"turnover24h": "1570383121.943499",
"volume24h": "91705.276",
"nextFundingTime": "1673280000000",
"fundingRate": "-0.000212",
"bid1Price": "17215.50",
"bid1Size": "84.489",
"ask1Price": "17216.00",
"ask1Size": "83.020"
},
"cs": 24987956059,
"ts": 1673272861686
}
```