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.
Name | Type | Comments |
---|---|---|
market_id | integer | Market in use, set to 0 |
symbol | string | Symbol e.g BTC-USD |
tradeable_entity_id | integer | Tradeable Entity Id |
type | string | snap_full_updates | snap_only | snap_with_deltas |
interval | integer | In milliseconds, multiple of 100 |
user_tag | string | Unique 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
Name | Type | Comments |
---|---|---|
server_utc_timestamp | integer | Time at which the message was generated by the API |
market_id | integer | 0 – 255, set to 0 |
symbol | string | Instrument name e.g BTC-USD |
buy | BuySell array | cf below |
sell | BuySell array | cf below |
BuySell Message
Name | Abbreviated | Type | Comments |
---|---|---|---|
ordered | o | integer | Exchange order id |
price | p | float | |
quantity | q | float | |
utc_timestamp | mt | integer | Time 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
Name | Abbreviated | Type | Comments |
---|---|---|---|
server_utc_timestamp | st | integer | Time at which the message was generated by the API |
market_id | mid | integer | 0, for RFQ indicative quotes it is set to 255 |
symbol | sym | string | Instrument name e.g BTC-USD |
tradeable_entity_id | tid | integer | Tradeable Entity Id |
side | s | string | buy / sell |
order_id | o | string | Exchange order id |
price | p | float | |
quantity | q | float | |
utc_timestamp | mt | integer | Time 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
Name | Abbreviated | Type | Comments |
---|---|---|---|
server_utc_timestamp | st | integer | Time at which the message was generated by the API |
market_id | mid | integer | 0, for RFQ indicative quotes it is set to 255 |
symbol | sym | string | Instrument name e.g BTC-USD |
tradeable_entity_id | tid | integer | Tradeable Entity Id |
side | s | string | buy / sell |
order_id | o | string | Exchange order id |
utc_timestamp | mt | integer | Time 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
Name | Abbreviated | Type | Comments |
---|---|---|---|
server_utc_timestamp | st | integer | Time at which the message was generated by the API |
market_id | mid | integer | 0 |
symbol | sym | string | Instrument name e.g BTC-USD |
tradeable_entity_id | tid | integer | Tradeable Entity Id |
side | s | string | buy / sell |
order_id | o | string | Exchange order id |
price | p | float | |
quantity | q | float | |
utc_timestamp | mt | integer | Order 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
Name | Abbreviated | Type | Comments |
---|---|---|---|
server_utc_timestamp | st | integer | Time at which the message was generated by the API |
market_id | mid | integer | 0 |
symbol | sym | string | Instrument name e.g BTC-USD |
tradeable_entity_id | tid | integer | Tradeable Entity Id |
side | s | string | buy / sell |
old_order_id | o | string | Old Exchange order id |
new_order_id | n | string | New Exchange order id |
price | p | float | |
quantity | q | float | |
utc_timestamp | mt | integer | Time 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 | 0 – 255, 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"
}
}