Search code examples
pythonwebsocketcoinbase-apigdax-api

Coinbase Websocket API, seconds-accurate order book building


I have been working with the Coinbase Websocket API recently for data analysis purposes. I am trying to track the order book in at least seconds-frequency.

As far as I am aware of, it is possible to use the REST API for that, but it does not include timestamp. The other options are the websocket level2 updates and the full channels.

The problem is that when I am processing the level2 updates I am constantly falling back in time (I did not focus on processing speed while I was programming since it was not my goal and I do not have the hardware neither the connection speed to do it), so for example after 30min I am able to process only 10 min of data.

The problem comes if, for whatever reason I am disconnected from the exchange, I have to reconnect again and I have a big empty window of data in the middle.

Is there any aggregated feed or way to do it (Receive all updates in one second or something like that) that I am not aware of? or should I just resign and improve my code and buy better equipment?

P.D: I am relatively new, so sorry if this type of question does not fit here!


Solution

  • Just in case anyone interested I just opened multiple websocket at different time windows and reconnect them periodically in order to miss as few price updates as possible.