adshao / go-binance

A Go SDK for Binance API
MIT License
1.48k stars 664 forks source link

Add "pu" final update Id in last stream(ie `u` in last stream) #489

Open goriunov opened 1 year ago

goriunov commented 1 year ago

As per Binance specs we should be using "pu" (Final update Id in last stream(ie u in last stream) to detect that our local order book is out of order. This PR adds pu to the WsDepthEvent

https://binance-docs.github.io/apidocs/futures/en/#how-to-manage-a-local-order-book-correctly

goriunov commented 1 year ago

@adshao i have tried running it but for some reason binance does not return the "pu" field from their side, which is quite interesting as their documentation states that it should be available, may be i have missed some details. If you have some tips would be great!

I have also fixed missing Event value on the Combined Feed

adshao commented 1 year ago

Please also fix the unit test error: https://github.com/adshao/go-binance/actions/runs/5004262748/jobs/9001267285?pr=489

goriunov commented 1 year ago

@adshao doing abit more investigation looks like this only works for the fstream from binance instead of the stream we subscribe to in the library