Open Leobouloc opened 6 years ago
Hm. If I understand correctly, some entries are also entry removals. So technically, there may be 100 entries.
have you checked if values has a length of 100 ?
At the snapshot, I always have 100 values as far as I recall. For updates, I always get a single update per message. So it makes sense that my orderbook does not always have 100 values. But I would expect the following updates to make up for any deletion. Yet I often have to wait 5 or 6 seconds to get a complete orderbook back (with additions to the orderbook)... Does this seem like the expected behavior of the Bitfinex API / btfxwss library ?
I'd say it's expected behaviour - since i would assume its alway 100 updates, not actualy entries. Btfxwss just passes the messages though, so perhaps you should check with bitfinex - just to be sure :)
I use the API to fetch the orderbooks for BTCUSD with the following parameters:
I would expect my book length to always be 99 or 100 both for bid and ask. Yet when I empty the book updates using the code below, I often end up with book lengths of 85, 86 ... If I try to loop the code below to wait until I get a full book, I often have to wait up to 5 or 6 seconds before my book representation is valid (length 100 on both sides). This seems very long to me.
Is this an expected behavior ? If not, is it possible that the ordering of the queue be different than that in which the messages were passed ? Is it possible that some update messages got lost ?