Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Binance "Event Time" vs "Trade time"

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.
}
like image 760
RandyMy Avatar asked Jun 04 '18 20:06

RandyMy


People also ask

Is the Binance API free?

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.

How do I get Binance in futures API?

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.


1 Answers

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".

like image 126
Sergey P Avatar answered Nov 15 '22 13:11

Sergey P