Skip to content
This repository has been archived by the owner on Jul 20, 2020. It is now read-only.

Incomplete book ? #128

Open
Leobouloc opened this issue Apr 5, 2018 · 3 comments
Open

Incomplete book ? #128

Leobouloc opened this issue Apr 5, 2018 · 3 comments
Assignees

Comments

@Leobouloc
Copy link

I use the API to fetch the orderbooks for BTCUSD with the following parameters:

PRECISION = 'P0'
FREQUENCY = 'F0' # F0 for realtime, F1 for 2sec
LENGTH = '100' # 25 or 100

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.

while not books_q.empty():
    values = books_q.get()
    [update book structure]

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 ?

@deepbrook
Copy link
Collaborator

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 ?

@deepbrook deepbrook self-assigned this Apr 11, 2018
@Leobouloc
Copy link
Author

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 ?

@deepbrook
Copy link
Collaborator

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 :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants