Subscribe
Field Name | Type | Values |
---|
type | string | subscribe |
subscriptions | array | |
-- name | string | l2 |
-- symbols | array | ["BTCUSD", "ETHBTC", ...] |
Level 2 Update Response
Field Name | Type | Values |
---|
type | string | l2_updates |
symbol | string | BTCUSD , etc. |
changes | array of arrays | Changes to order book |
-- | string | Buy or Sell |
-- | string | Price Level |
-- | string | Quantity |
Trade Response
Field Name | Type | Values |
---|
type | string | trade |
symbol | string | BTCUSD , etc |
event_id | long | Event ID of the trade |
timestamp | long | Time of the trade in milliseconds |
price | string | Price of the trade |
quantity | string | Quantity traded |
side | string | Side of the taker in the trade. buy or sell |
tid | long | Trade ID of the trade |
Examples
Initial JSON response for l2 subscription
{
"type": "l2_updates",
"symbol": "BTCUSD",
"changes": [
[
"buy",
"9122.04",
"0.00121425"
],
...,
[
"sell",
"9122.07",
"0.98942292"
]
...
],
"trades": [
{
"type": "trade",
"symbol": "BTCUSD",
"eventid": 169841458,
"timestamp": 1560976400428,
"price": "9122.04",
"quantity": "0.0073173",
"side": "sell",
"tid": 2840140800042677
},
...
],
}
json
JSON response for l2 update
{
"type": "l2_updates",
"symbol": "BTCUSD",
"changes": [["sell", "9160.20", "0.1921229751"]]
}
json
JSON response for trade execution
{
"type": "trade",
"symbol": "BTCUSD",
"event_id": 3575573053,
"timestamp": 151231241,
"price": "9004.21000000",
"quantity": "0.09110000",
"side": "buy",
"tid": 2840140800042677
}
json