- channel: babelsub_spot$pair_ticker
{
"event": "addChannel",
"channel": "babel_sub_spot_$pair_ticker"
}
| 参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
|---|---|---|---|---|---|
| pair | true | string | 交易对 | BIX_BTC, BIX_ETH, BTC_USDT, ETH_USDT...... |
请求 Ticker 数据的例子
正确订阅
{
"event": "addChannel",
"channel": "babel_sub_spot_BIX_BTC_ticker"
}
订阅成功返回数据的例子
[{
"channel": "babel_sub_spot_BIX_BTC_ticker",
"data_type": 0,
"data":{
"pair":"BIX_BTC",
"last":"0.00006837",
"last_usd":"0.43",
"last_cny":"2.96",
"high":"0.00007401",
"low":"0.00006628",
"buy":"0.00006814",
"buy_amount":"2654.5376",
"sell":"0.00006876",
"sell_amount":"170.3094",
"vol":"48027601",
"percent":"-6.73%",
"timestamp":1536650154258,
"base_last_cny":"2.96838961"
}
}]
data说明
"data":{
"pair": 交易对
"last": 最新成交价
"last_cny": 最新成交价,cny计价
"last_usd": 最新成交价,usd计价
"high": 24h最高价
"low": 24h最低价
"buy": 最新买一价
"buy_amount": 买一量
"sell": 最新卖一价
"sell_amount": 卖一量
"vol": 24h成交量
"percent": 24h涨跌幅
"timestamp": 时间戳
"base_last_cny": 最新成交价,cny计价(保留8位小数)
}
之后每当 Ticker 有更新时,client 都会收到数据,例子
[{
"channel": "babel_sub_spot_BIX_BTC_ticker",
"data_type": 1,
"data":{
"pair":"BIX_BTC",
"last":"0.00006837",
"last_usd":"0.43",
"last_cny":"2.96",
"high":"0.00007401",
"low":"0.00006628",
"buy":"0.00006814",
"buy_amount":"2654.5376",
"sell":"0.00006876",
"sell_amount":"170.3094",
"vol":"48027601",
"percent":"-6.73%",
"timestamp":1536650154258,
"base_last_cny":"2.96838961"
}
}]