jaggedsoft / node-binance-api

Node Binance API is an asynchronous node.js library for the Binance API designed to be easy to use.
MIT License
1.58k stars 767 forks source link

Maintain Depth Chart Property: Event Time #330

Closed bmino closed 5 years ago

bmino commented 5 years ago

Every tick of the order book websocket contains the event time. It would be great if this property were incorporated into the depthCache to determine how old the current depth cache data is.

This is the payload returned each tick from the diff. depth stream:

{
  "e": "depthUpdate", // Event type
  "E": 123456789,     // Event time    <--- This guy right here!
  "s": "BNBBTC",      // Symbol
  "U": 157,           // First update ID in event
  "u": 160,           // Final update ID in event
  "b": [              // Bids to be updated
    [
      "0.0024",       // Price level to be updated
      "10"            // Quantity
    ]
  ],
  "a": [              // Asks to be updated
    [
      "0.0026",       // Price level to be updated
      "100"           // Quantity
    ]
  ]
}
bmino commented 5 years ago

Looks to be merged via PR #334 but not yet released

bmino commented 5 years ago

Can we get this in a release @jaggedsoft ?

jaggedsoft commented 5 years ago

sure :) v0.9.1

bmino commented 5 years ago

Great, thanks!