Receive updates for any trade events on your account.
Subscribe to the account information channel to keep track of your trades. The account information channel will provide a feed of your trades for as long as the channel remains open. Any authenticated connection is automatically subscribed to the account information channel.
Example code to open an authenticated connection can be found on our Authenticated Channels Page.
Trade events are sent with CHAN_ID = 0 and can be identified by looking at the TYPE stream field. Trade events will use one of the following abbreviations: 'te' (trade executed) and 'tu' (trade execution update). The 'te' message is sent when a trade is executed while the 'tu' message is sent shortly after containing the trade id (ID) and additional updated fields.
[
0, //CHAN_ID
"te", //MSG_TYPE
[
402088407, //ID
"tETHUST", //SYMBOL
1574963975602, //MTS_CREATE
34938060782, //ORDER_ID
-0.2, //EXEC_AMOUNT
153.57, //EXEC_PRICE
"MARKET", //ORDER_TYPE
0, //ORDER_PRICE
-1, //MAKER
null, //FEE ('tu' only)
null, //FEE_CURRENCY ('tu' only)
0 //CID
] //TRADE_ARRAY
]
[
0, //CHAN_ID
"tu", //MSG_TYPE
[
402088407, //ID
"tETHUST", //SYMBOL
1574963975602, //MTS_CREATE
34938060782, //ORDER_ID
-0.2, //EXEC_AMOUNT
153.57, //EXEC_PRICE
"MARKET", //ORDER_TYPE
0, //ORDER_PRICE
-1, //MAKER
-0.061668, //FEE
"USD", //FEE_CURRENCY
1714466193700 //CID
] //TRADE_ARRAY
]
Trade update data
Index | Field | Type | Description |
---|---|---|---|
[0] | CHANNEL_ID | Int | Identification number assigned to the channel for the duration of this connection. |
[1] | MSG_TYPE | String | 'te' (trade executed), 'tu' (trade execution update) |
[2] | TRADE_ARRAY | Array | Trade array |
Trade arrays
Index | Field | Type | Description |
---|---|---|---|
[0] | ID | Integer | Trade database id |
[1] | SYMBOL | String | Symbol (tBTCUSD, …) |
[2] | MTS_CREATE | Integer | Execution timestamp |
[3] | ORDER_ID | Integer | Order id |
[4] | EXEC_AMOUNT | Float | Positive means buy, negative means sell |
[5] | EXEC_PRICE | Float | Execution price |
[6] | ORDER_TYPE | String | Order type |
[7] | ORDER_PRICE | Float | Order price |
[8] | MAKER | Int | 1 if true, -1 if false |
[9] | FEE | Float | Fee ('tu' only, returns null for 'te' events) |
[10] | FEE_CURRENCY | String | Fee currency ('tu' only, returns null for 'te' events) |
[11] | CID | Integer | Client Order ID |