Skip to main content

market-data

Subscribe to market data

This request is used to subscribe to market data updates for a particular symbol.

There are a few forms of the message:

- snapshot_full_updates

Here the user will receive the current full book snapshot followed by all its updates. It is the responsibility of the user to update and maintain the book.

From time to time the exchange may send another full snapshot where upon the user should discard their current book and replace it with the latest snapshot.

For this message form, the update interval must be set to 0.

- snap_only

Here, the user will receive the current full book snapshot at the specified interval.

The interval is specified in 100 millisecond increments.

- snap_with_deltas

Here, the user will receive the full current book snapshot followed by delta change messages at the specified interval.

The interval is specified in 100 millisecond increments.

If the book has not changed during this interval, a delta message will not be sent.

The delta message defines a series of instructions to add, or delete price levels, add or delete orders to bring the order book up to date.

NameTypeComments
market_idintegerMarket in use, set to 0
symbolstringSymbol e.g BTC-USD
tradeable_entity_idintegerTradeable Entity Id
typestringsnap_full_updates | snap_only | snap_with_deltas
intervalintegerIn milliseconds, multiple of 100
user_tagstringUnique user defined ASCII between 1 – 64 bytes

Examples

{
"subscribe": {
"market_id": "0",
"symbol": "BTC-USD-INDEX",
"type": "snap_full_updates",
"tradeable_entity_id": "2",
"interval": "0",
"user_tag": "unique_request_id"
}
}
{
"subscribe": {
"market_id": "0",
"type": "snap_only",
"tradeable_entity_id": "7",
"interval": "500",
"user_tag": "unique_request_id"
}
}

Snapshot

This is an unsolicited message sent when subscribed to market data updates for a symbol to indicate a new snapshot of the book has been generated.

Snapshot Message

NameTypeComments
server_utc_timestampintegerTime at which the message was generated by the API
market_idinteger0 – 255, set to 0
symbolstringInstrument name e.g BTC-USD
buyBuySell arraycf below
sellBuySell arraycf below

BuySell Message

NameAbbreviatedTypeComments
orderedointegerExchange order id
pricepfloat
quantityqfloat
utc_timestampmtintegerTime at which the last buy/sell order was created in the exchange

Example

{
"snapshot": {
"server_utc_timestamp": "42334345456",
"market_id": "0",
"symbol": "UTC-USD",
"buy": [
{
"price": "0.004",
"quantity": "0.004",
"orderid": "123456",
"utc_timestamp": "12345566789"
}
],
"sell": [
{
"price": "0.0006",
"quantity": "0.004",
"orderid": "1234567",
"utc_timestamp": "232134354435436"
}
]
}
}

Order Added

This is an unsolicited message sent when subscribed to market data updates for a symbol to indicate an order has been added to the order book.

The abbreviated field names are in the second column.

Order Added Message

NameAbbreviatedTypeComments
server_utc_timestampstintegerTime at which the message was generated by the API
market_idmidinteger0, for RFQ indicative quotes it is set to 255
symbolsymstringInstrument name e.g BTC-USD
tradeable_entity_idtidintegerTradeable Entity Id
sidesstringbuy / sell
order_idostringExchange order id
pricepfloat
quantityqfloat
utc_timestampmtintegerTime at which the order was added in the exchange

Example

{
"order_added": {
"server_utc_timestamp": "3434366657767676",
"market_id": "0",
"symbol": "BTC-USD",
"tradeable_entity_id": "7",
"side": "buy",
"order_id": "12345",
"price": "1234.678 ",
"quantity": "0.001000",
"utc_timestamp": "12345678"
}
}

Abbreviated:

{
"order_added": {
"st": "3434366657767676",
"mid": "0",
"sym": "BTC-USD",
"tid": "7",
"s": "buy",
"o": "12345",
"p": "1234.678 ",
"q": "0.001000",
"mt": "12345678"
}
}

Order Deleted

This is an unsolicited message sent when subscribed to market data updates for a symbol to indicate an order has been deleted from the order book. The abbreviated field names are in the second column.

Order Deleted Message

NameAbbreviatedTypeComments
server_utc_timestampstintegerTime at which the message was generated by the API
market_idmidinteger0, for RFQ indicative quotes it is set to 255
symbolsymstringInstrument name e.g BTC-USD
tradeable_entity_idtidintegerTradeable Entity Id
sidesstringbuy / sell
order_idostringExchange order id
utc_timestampmtintegerTime at which the order was deleted in the exchange

Example

{
"order_deleted": {
"server_utc_timestamp": "12345678",
"market_id": "0",
"symbol": "BTC-USD",
"tradeable_entity_id": "7",
"side": "sell",
"order_id": "123456",
"utc_timestamp": "1234567890"
}
}

Order Executed

This is an unsolicited message sent when subscribed to market data updates for a symbol to indicate an order has been executed in the order book.

The abbreviated field names are in the second column.

Order Executed Message

NameAbbreviatedTypeComments
server_utc_timestampstintegerTime at which the message was generated by the API
market_idmidinteger0
symbolsymstringInstrument name e.g BTC-USD
tradeable_entity_idtidintegerTradeable Entity Id
sidesstringbuy / sell
order_idostringExchange order id
pricepfloat
quantityqfloat
utc_timestampmtintegerOrder Timestamp

Example

{
"order_executed": {
"server_utc_timestamp": "12345678",
"market_id": "0",
"symbol": "BTC-USD",
"tradeable_entity_id": "7",
"side": "sell",
"order_id": "3434234234",
"price": "0.2000",
"quantity": "1.0",
"utc_timestamp": "12345678909"
}
}

Order Updated

This is an unsolicited message sent when subscribed to market data updates for a symbol to indicate an order has been updated in the order book.

The abbreviated field names are in the second column.

Order Updated Message

NameAbbreviatedTypeComments
server_utc_timestampstintegerTime at which the message was generated by the API
market_idmidinteger0
symbolsymstringInstrument name e.g BTC-USD
tradeable_entity_idtidintegerTradeable Entity Id
sidesstringbuy / sell
old_order_idostringOld Exchange order id
new_order_idnstringNew Exchange order id
pricepfloat
quantityqfloat
utc_timestampmtintegerTime at which the order was updated in the exchange

Example

{
"order_updated": {
"server_utc_timestamp": "34324234543543534",
"market_id": "0",
"symbol": "UTC-USD",
"tradeable_entity_id": "7",
"side": "buy",
"old_order_id": "123456",
"new_order_id": "1234567",
"price": "0.003400",
"quantity": "0.020000",
"utc_timestamp": "12345677889"
}
}

## Trade

This is an unsolicited message sent when subscribed to market data updates for a symbol to indicate a trade message has been generated.

### Trade Message

| Name | Type | Comments |
| --------------------- | ------- | -------------------------------------------------- |
| server_utc_timestamp | integer | Time at which the message was generated by the API |
| market_id | integer | 0255, set to 0 |
| symbol | string | Instrument name e.g `BTC-USD` |
| tradeable_entity_id | integer | Tradeable Entity Id |
| trade_id | integer | |
| price | float | |
| quantity | float | |
| buy_display_order_id | integer | Exchange order id |
| sell_display_order_id | integer | Exchange order id |
| utc_timestamp | integer | Time at which the trade was executed in the system |

### Example

```json
{
"trade": {
"server_utc_timestamp": "234234325",
"market_id": "0",
"symbol": "BTC-USD",
"tradeable_entity_id": "7",
"trade_id": "1234",
"price": "12.5",
"quantity": "0.0045",
"buy_display_order_id": "123456",
"sell_display_order_id": "4554678",
"utc_timestamp": "12342345435346"
}
}