I am looking at the Binance Websocket Stream and have a question about Event time and Trade time. If this is raw trade information, how can there be 2 different times for a "Trade"? What is the "Event Time"?
From the github API docs:
Trade Streams
The Trade Streams push raw trade information; each trade has a unique buyer and seller.
Stream Name: @trade
Payload:
{
"e": "trade", // Event type
"E": 123456789, // Event time
"s": "BNBBTC", // Symbol
"t": 12345, // Trade ID
"p": "0.001", // Price
"q": "100", // Quantity
"b": 88, // Buyer order Id
"a": 50, // Seller order Id
"T": 123456785, // Trade time
"m": true, // Is the buyer the market maker?
"M": true // Ignore.
}
1. Binance API. Binance is a free to use API that uses third-party platforms to allow users to access and trade on crypto currency markets. Binance, when you consider the sheer number of crypto currency trades, is one of the largest single market players out there.
Log into your Binance account and go to the account settings -> API Management page where you can create a new API key. For the API restrictions, make sure 'Enable reading', and 'Enable Futures' are enabled.
The "T" or "Trade time" is the time of the transaction in milliseconds. I recommend using this time.
The "E" or "Event time" is the time value is inherent only to the sockets. It is associated with creating a socket object.
Usually "Event time" more then "Trade time" and the difference between these values is only a few milliseconds. Less than 30-40 milliseconds. Sometimes "Event time" less then "Trade time".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With