Websocket channel for latest traded transaction information
Description
Interval: realtime
Request
{"event": "subscribe", "arg": [{ "channel": "trade", "sym":"OKX_SPOT_BTC_USDT" }]}
| Field name | Type | Necessary | Remarks |
|---|---|---|---|
| event | String | Y | subscribe / unsubscribe |
| args | Array | Y | Subscribe param. There can be no more than 50 sym parameters per subscribe. |
| > channel | String | Y | Channel name: trade |
| > sym | String | Y | Unique identifier |
Response
{"event":"subscribe","arg":[{"channel":"trade","sym":"OKX_SPOT_BTC_USDT"}],"code":0,"message":"Success"}
| Field | Type | Remarks |
|---|---|---|
| event | String | subscribe / unsubscribe |
| code | String | Error Code |
| msg | String | Error Message |
| args | Array | Subscribe param |
| > channel | String | Channel name: trade |
| > sym | String | Unique identifier |
Data Sample:
{
"arg":{
"channel":"trade",
"sym":"OKX_SPOT_BTC_USDT"
},
"data":{
"tradeid":"609770900",
"price":"93481.7",
"qty":"0.00022049",
"side":"sell",
"ts":"1732094185659"
}
}
| Field | Type | Remarks |
|---|---|---|
| > channel | String | Channel name: trade |
| > sym | String | Unique identifier |
| data | Array | Data |
| > tradeid | String | Transaction ID |
| > price | String | Traded price |
| > qty | String | Traded Quantity |
| > side | String | Transaction Direction |
| > ts | String | Timestamp, in Unix millionsecond. e.g. 1732093591811 |
