Trading Channel
Description
Push once any trade is matched/cancelled.
After first subscription, it will push the recent snapshot data and then push the update data
Request Example
{
"op": "subscribe",
"args": [
{
"instType": "SPOT",
"channel": "trade",
"instId": "BTCUSDT"
}
]
}
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
op | String | Yes | Operation, subscribe unsubscribe |
args | List<Object> | Yes | List of channels to subscribe to |
> instType | String | Yes | Product Line Type |
> channel | String | Yes | Channel name |
> instId | String | Yes | Product id For example: ETHUSDT |
Response Example
{
"event": "subscribe",
"arg": {
"instType": "SPOT",
"channel": "trade",
"instId": "BTCUSDT"
}
}
Response Parameters
Parameter | Type | Description |
---|---|---|
event | String | is an event, |
arg | Object | No Channel to subscribe to |
> instType | String | Is product type |
> channel | String | is channel name |
> instId | String | is product id. For example: ETHUSDT |
code | String | Error code, returned only on error |
msg | String | Error message |
Push Data
{
"action": "snapshot",
"arg": {
"instType": "SPOT",
"channel": "trade",
"instId": "BTCUSDT"
},
"data": [
{
"ts": "1695709835822",
"price": "26293.4",
"size": "0.0013",
"side": "buy",
"tradeId": "1000000000"
}
],
"ts": 1695711090682
}
Push Parameters
Parameter | Type | Description |
---|---|---|
arg | Object | Successfully subscribed channel |
> instType | String | Product Type |
> channel | String | Channel name |
> instId | String | Product id For example: ETHUSDT |
action | String | Push data action, snapshot or update |
data | List<Object> | Subscribed data |
> tradeId | String | Transaction ID |
> ts | String | Transaction time, millisecond format of Unix timestamp, such as 1597026383085 |
> price | String | Transaction price |
> size | String | Transaction quantity |
> side | String | Transaction direction |