Skip to main content

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

ParameterTypeRequiredDescription
opStringYesOperation, subscribe unsubscribe
argsList<Object>YesList of channels to subscribe to
> instTypeStringYesProduct Line Type
> channelStringYesChannel name
> instIdStringYesProduct id For example: ETHUSDT
Response Example
{
"event": "subscribe",
"arg": {
"instType": "SPOT",
"channel": "trade",
"instId": "BTCUSDT"
}
}

Response Parameters

ParameterTypeDescription
eventStringis an
event,
argObjectNo
Channel to subscribe to
> instTypeStringIs
product type
> channelStringis
channel name
> instIdStringis
product id. For example: ETHUSDT
codeStringError code, returned only on error
msgStringError 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

ParameterTypeDescription
argObjectSuccessfully subscribed channel
> instTypeStringProduct Type
> channelStringChannel name
> instIdStringProduct id For example: ETHUSDT
actionStringPush data action, snapshot or update
dataList<Object>Subscribed data
> tradeIdStringTransaction ID
> tsStringTransaction time, millisecond format of Unix timestamp, such as 1597026383085
> priceStringTransaction price
> sizeStringTransaction quantity
> sideStringTransaction direction