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

OrderbookSync returns stale data #80

Closed
petercerno opened this issue Jul 23, 2017 · 10 comments
Closed

OrderbookSync returns stale data #80

petercerno opened this issue Jul 23, 2017 · 10 comments

Comments

@petercerno
Copy link

Hi, when creating OrderbookSync as follows:

this._orderbookSync = new Gdax.OrderbookSync(
      productIds, apiURI, websocketURI, this._authClient);

And then reading the bid / ask prices as follows:

let state = this._orderbookSync.books[productId].state();
let bid = state.bids[0].price;
let ask = state.asks[0].price;

What happens is that bid or ask prices stop being updated (after some time) and become stale (inconsistent with what I see on https://www.gdax.com/trade/). This happens randomly, but often enough, that I have to re-create OrderbookSync almost every minute. Is there a bug? (It used to work fine before).

I have used ETH-EUR product.

@26medias
Copy link

26medias commented Jul 27, 2017

I have the same issue.

This call is highly unreliable.

I polled it once per minute for the past few days, and charted the best bid/ask:

One or the other, sometimes both, stop getting updates.

This is running on Heroku btw.

@dmalukov
Copy link

dmalukov commented Jul 28, 2017

PR #81 didn't fix this issue :(

@dmalukov
Copy link

There is warning here:

All open and match messages will always result in a change to the order book. Not all done or change messages will result in changing the order book. These messages will be sent for received orders which are not yet on the order book. Do not alter the order book for such messages, otherwise your order book will be incorrect.

But here I can see that "done" and "change" messages are processed in orderbook. Is this correct ?

@gmelika
Copy link

gmelika commented Sep 8, 2017

I think this comment might explain the stale data issue:

#104 (comment)

@fb55
Copy link
Contributor

fb55 commented Sep 8, 2017

This library refetches orders when it reconnects. Not sure what the exact origin of this is, especially as this seems limited on one side of the book. I hope to update gdax-node to use our level 2 channel soon, which should fix this issue. (See #82.)

@ztnark
Copy link

ztnark commented Jul 23, 2018

I am seeing this issue in 0.6.0. Is there a solution, or is OrderBookSync unusable? Thank you.

@johanhenriksson
Copy link

Im seeing this problem in 0.8.0 as well. Asks stop updating after a while, bids keep updating as normal. Are there any known workarounds?

@BGrades
Copy link

BGrades commented Jan 10, 2019

I am seeing the same problem in 0.8.0. I have the sync orderbook created with 4 productIds. And as @johanhenriksson described the asks stops updating after some time. Worth pointing out that the asks are stoping to update one by one. Does anyone know the reason for that or have a workaround? Thank you.

@BGrades
Copy link

BGrades commented Jan 15, 2019

Okay, I think @tensleep, who raised issue #308 "Order book resync (after dropped message) appears broken" pointed out the issue correctly. I changed the code to clear the bids and asks on resync and haven't seen the issue for the past week. There are several issues opened regarding the OrderbookSync and my guess is that most of them are related to the problem pointed out by tensleep. Hope it helps others in resolving the bug.

@drewrothstein
Copy link

Hi, we are closing out PRs + Issues as this project is being archived.

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

No branches or pull requests

9 participants