The trade feed returns information about executed trades.
Authentication is not required.
Feed |
Event Type |
Permissible API Keys |
trade
|
subscribe / unsubscribe
|
N/A |
Sample Sent Message |
{ "event":"subscribe", "feed":"trade", "product_ids":[ "PI_XBTUSD", ] } |
Sample Return if Successful. (A result message is received per product id) |
{
|
Field |
Type | Description |
event
|
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed | string | The requested subscription feed |
product_ids | list of strings | A list of strings which represent the products that user will receive information upon |
Sample Subscription Snapshot Data |
{ "feed": "trade_snapshot", "product_id": "PI_XBTUSD", "trades": [ { "feed": "trade", "product_id": "PI_XBTUSD", "uid": "caa9c653-420b-4c24-a9f1-462a054d86f1", "side": "sell", "type": "fill", "seq": 655508, "time": 1612269657781, "qty": 440, "price": 34893 }, { "feed": "trade", "product_id": "PI_XBTUSD", "uid": "45ee9737-1877-4682-bc68-e4ef818ef88a", "side": "sell", "type": "fill", "seq": 655507, "time": 1612269656839, "qty": 9643, "price": 34891 } ] } |
Field |
Type | Description |
feed | string | The subscribed snapshot feed |
product_id | string | The subscribed product (referred also as instrument or symbol) |
uid | string | Unique identifier for the matched trade |
side | string | The classification of the taker side in the matched trade: "buy" if the taker is a buyer, "sell" if the taker is a seller. |
type | string | The classification of the matched trade: "fill" if it is a normal buyer and seller, "liquidation" if it is a result of a user being liquidated from their position, "assignment" if user is assigned or fills an assignment, or "termination" if it is a result of a user being terminated. |
seq | positive integer |
The subscription message sequence number |
time | positive integer |
The UTC or GMT time of the trade in milliseconds |
qty | positive float |
The quantity of the traded product |
price | positive float |
The price that the product got traded |
Sample Subscription Delta Data |
{ "feed": "trade", "product_id": "PI_XBTUSD", "uid": "05af78ac-a774-478c-a50c-8b9c234e071e", "side": "sell", "type": "fill", "seq": 653355, "time": 1612266317519, "qty": 15000, "price": 34969.5 } |
Field |
Type | Description |
feed | string | The subscribed feed |
product_id | string | The subscribed product (referred also as instrument or symbol) |
side | string | The classification of the taker side in the matched trade: "buy" if the taker is a buyer, "sell" if the taker is a seller. |
type | string | The classification of the matched trade: "fill" if it is a normal buyer and seller, "liquidation" if it is a result of a user being liquidated from their position, "assignment" if user is assigned or fills an assignment, or "termination" if it is a result of a user being terminated. |
seq | positive integer |
The subscription message sequence number |
time | positive integer |
The UTC or GMT time of the trade in milliseconds |
qty | positive float |
The quantity of the traded product |
price | positive float |
The price that the product got traded |
Sample Return if Unsuccessful |
{ "event":"error", "message":"Invalid product id" } |
Field |
Type | Description |
event | string | Always error |
message | string |
An error message out of:
|