Trades

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.

[
  CHAN_ID, 
  TYPE, // 'te' 
  [
    ID, 
    SYMBOL, 
    MTS_CREATE,
    ORDER_ID, 
    EXEC_AMOUNT, 
    EXEC_PRICE, 
    ORDER_TYPE, 
    ORDER_PRICE, 
    MAKER,
    PLACEHOLDER,
    PLACEHOLDER,
		CID
  ]
]
 
[0,"te",[402088407,"tETHUST",1574963975602,34938060782,-0.2,153.57,"MARKET",0,-1,null,null,0]]
[
  CHAN_ID, 
  TYPE // 'tu' 
  [
    ID, 
    SYMBOL, 
    MTS_CREATE, 
    ORDER_ID, 
    EXEC_AMOUNT, 
    EXEC_PRICE, 
    ORDER_TYPE, 
    ORDER_PRICE, 
    MAKER, 
    FEE, 
    FEE_CURRENCY,
    CID
  ]
]
  
[0,"tu",[402088407,"tETHUST",1574963975602,34938060782,-0.2,153.57,"MARKET",0,-1,-0.061668,"USD"]]

Stream Fields

TermTypeDescription
CHAN_IDintIdentification number for the channel subscribtion. Trade events are always sent through the account information channel with CHAN_ID = 0
TYPEstring'te' (trade executed), 'tu' (trade execution update)
IDintegerTrade database id
CIDintegerClient Order ID
SYMBOLstringSymbol (tBTCUSD, …)
MTS_CREATEintegerExecution timestamp
ORDER_IDintegerOrder id
EXEC_AMOUNTfloatPositive means buy, negative means sell
EXEC_PRICEfloatExecution price
ORDER_TYPEstringOrder type
ORDER_PRICEfloatOrder price
MAKERint1 if true, -1 if false
FEEfloatFee ('tu' only)
FEE_CURRENCYstringFee currency ('tu' only)