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
- Linear/Inverse
- Spot
Parameter | Type | Comments |
---|---|---|
topic | string | Topic name |
type | string | Data type. snapshot ,delta |
cs | integer | Cross sequence |
ts | number | The timestamp (ms) that the system generates the data |
data | array | Object |
> symbol | string | Symbol name |
> tickDirection | string | Tick direction |
> price24hPcnt | string | Percentage change of market price in the last 24 hours |
> lastPrice | string | Last price |
> prevPrice24h | string | Market price 24 hours ago |
> highPrice24h | string | The highest price in the last 24 hours |
> lowPrice24h | string | The lowest price in the last 24 hours |
> prevPrice1h | string | Market price an hour ago |
> markPrice | string | Mark price |
> indexPrice | string | Index price |
> openInterest | string | Open interest size |
> openInterestValue | string | Open interest value |
> turnover24h | string | Turnover for 24h |
> volume24h | string | Volume for 24h |
> nextFundingTime | string | Next funding timestamp (ms) |
> fundingRate | string | Funding rate |
> bid1Price | string | Best bid price |
> bid1Size | string | Best bid size |
> ask1Price | string | Best ask price |
> ask1Size | string | Best ask size |
Parameter | Type | Comments |
---|---|---|
topic | string | Topic name |
ts | number | The timestamp (ms) that the system generates the data |
type | string | Data type. snapshot |
cs | integer | Cross sequence |
data | array | Object |
> symbol | string | Symbol name |
> lastPrice | string | Last price |
> highPrice24h | string | The highest price in the last 24 hours |
> lowPrice24h | string | The lowest price in the last 24 hours |
> prevPrice24h | string | Percentage change of market price relative to 24h |
> volume24h | string | Volume for 24h |
> turnover24h | string | Turnover for 24h |
> price24hPcnt | string | Percentage change of market price relative to 24h |
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
- Linear
```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
}
```