Anonymous Ticks
This allows simultaneous tick subscriptions to multiple markets.
Upon subscribing to a market, the client will first receive a snapshot of latest ticker, followed by updates. See the data model: Get Market Tick
Either it can be subscribed from a single symbol (by reaching to this endpoint)
/trading-api/v1/market-data/tick/{symbol}
Or tick of different markets can be subscribed to, and controlled by parameters in the subscription message listed below
/trading-api/v1/market-data/tick
Operations
SEND/trading-api/v1/market-data/tick
Subscribe
Multiple subscriptions could be opened within the same websocket.
The index price of different ticks to be subscribed are controlled by the parameters in the subscription message listed below.
Accepts the following message:
Let you subscribe to a given topic
Examples
{
"method": "subscribe",
"id": "1611082473000",
"jsonrpc": "2.0",
"type": "command",
"params": {
"topic": "tick",
"symbol": "BTCUSD"
}
}
This example has been generated automatically.
RECEIVE/trading-api/v1/market-data/tick
After subscribing, the server sends :
- an acknowledgement
- followed by a snapshot
Sends one of the following messages:
- #1Acknowledgment
Confirm the topic being subscribed
objectExamples
{"id": "1611082473000","jsonrpc": "2.0","result": {"responseCodeName": "OK","responseCode": "200","message": "Successfully subscribed"}}This example has been generated automatically.
- #2Snapshot
Snapshot to the subscribed tick data
objectExamples
{"type": "snapshot","dataType": "V1TATickerResponse","data": {"askVolume": "3.56000000","average": "5200.0400","baseVolume": "1.00000000","bestAsk": "6543.0000","bestBid": "2345.0000","bidVolume": "2.00000000","change": "0.0000","close": "5200.0400","createdAtTimestamp": "1591058897000","publishedAtTimestamp": "1591058898000","high": "5200.0400","last": "5200.0400","lastTradeDatetime": "2020-06-02T00:40:39.500Z","lastTradeSize": "1.00000000","low": "5200.0400","open": "5200.0400","percentage": "0.00","quoteVolume": "5200.0400","symbol": "BTC-USDC-PERP","vwap": "5200.0400","currentPrice": "0.0007","ammData": [{"feeTierId": "1","currentPrice": "0.0007","bidSpreadFee": "0.00000005","askSpreadFee": "0.00000006"},{"feeTierId": "2","currentPrice": "0.0017","bidSpreadFee": "0.00000015","askSpreadFee": "0.00000016"}],"createdAtDatetime": "2020-06-02T00:48:17.000Z","markPrice": "26000.0000","fundingRate": "0.114100","openInterest": "9.00000000"}}This example has been generated automatically.
RECEIVE/trading-api/v1/market-data/tick
In case of invalid subscription message, an error rejection would be sent.
Sends the following message:
Explain why the topic could not be subscribed
Examples
{
"id": "1611082473000",
"jsonrpc": "2.0",
"error": {
"code": "-32602",
"errorCode": "29013",
"errorCodeName": "'abcde' is not a valid topic"
}
}
This example has been generated automatically.
SEND/trading-api/v1/market-data/tick
Keepalive
In case nothing is subscribed to, keep the websocket connection alive.
Accepts the following message:
Examples
{
"method": "keepalivePing",
"params": {},
"id": "1611082473000",
"jsonrpc": "2.0",
"type": "command"
}
This example has been generated automatically.
RECEIVE/trading-api/v1/market-data/tick
Acknowledgement returned by the server in response to a keepalive-ping.
Sends the following message:
Examples
{
"id": "1611082473000",
"jsonrpc": "2.0",
"result": {
"responseCodeName": "OK",
"responseCode": 200,
"message": "Keep alive pong"
}
}