Public trade
This topic pushes raw trade information; each trade has a unique buyer and seller.
Variable "v" acts as a tradeId. This variable is shared across different symbols; however, each ID is unique. For example, suppose in the last 5 seconds 3 trades happened in ETHUSDT, BTCUSDT, and BHTBTC. Their tradeId (which is "v") will be consecutive: 112, 113, 114.
Push frequency: real-time
Topic: trade.{symbol}
Response Parameters
Parameter | Type | Comments |
---|---|---|
topic | string | Topic name |
ts | number | The timestamp (ms) that message is sent out |
type | string | Data type. snapshot |
data | array | Object |
> v | string | Trade ID |
> t | number | Timestamp (trading time in the match box) |
> p | string | Price |
> q | string | Quantity |
> m | boolean | True indicates buy side is taker, false indicates sell side is taker |
> type | string | Trade type. 0 :Spot trade. 1 :Paradigm block trade |
Subscribe Example
{
"req_id": "trade0001", //optional
"op": "subscribe",
"args": [
"trade.BTCUSDT"
]
}
Stream Example
{
"topic": "trade.BTCUSDT",
"ts": 1673437259397,
"type": "snapshot",
"data": {
"v": "2290000000036455162",
"t": 1673437259395,
"p": "17440",
"q": "0.0002",
"m": false,
"type": "0"
}
}