Trades

A trade is the executed transaction of a financial asset between a buyer and seller on a market venue (order book match). A financial asset can be a cryptoasset, a fiat currency, or a cryptoasset derivatives contract. Trade-level data is available upon request

Subscription

After websocket connection is established, you will need to send a request message with details of your subscription.

A full list of supported markets is available through the REST dictionary endpoint.

Add markets

Allows the addition of markets to a subscription within the websocket connection.

Request

Type: request-trades-subscriptions-add

Payload:

{
  "subscriptions":[
    {
      "marketId":"binance-btc-usdt"
    }
  ]
}
Response

Type: response-trades-subscriptions-add

Payload:

{
  "added": 1,
  "total": 5
}

Remove markets

Allows the removal of markets from a subscription within the websocket connection.

Request

Type: request-trades-subscriptions-remove

Payload:

{
  "subscriptions":[
    {
      "marketId":"binance-btc-usdt"
    }
  ]
}
Response

Type: response-trades-subscriptions-remove

Payload:

{
  "removed": 1,
  "total": 4
}

Data

If everything is correct during subscription, we will provide you with a continuous stream of real-time market data updates according to your tariff limits.

Type: t

Payload:

Field NameTypeDescription
tsIntegerTimestamp, aggregation window start time in milliseconds. UNIX epoch format
mStringMarket ID
pStringTransaction price
vStringTransaction volume

Example

  1. Subscribe to one market:
{
  "traceId":"uy34fw9",
  "type":"request-trades-subscriptions-add",
  "payload": {
    "subscriptions":[
      {
        "marketId":"binance-btc-usdt"
      }
    ]
  }
}
  1. Receive successful response
{
  "traceId":"uy34fw9",
  "type":"response-trades-subscriptions-add",
  "payload": {
    "added": 1,
    "total": 1
  }
}
  1. Then start receiving market data feed you subscribed to:
{
    "type": "t",
    "payload": {
        
        "ts": 1657837620000,
        "m": "binance-btc-usdt",
        "p" : "21594.75",
        "v" : "0.00067"
    }
}