简体   繁体   English

Coinbase Websocket API,秒级准确的订单簿构建

[英]Coinbase Websocket API, seconds-accurate order book building

I have been working with the Coinbase Websocket API recently for data analysis purposes.我最近一直在使用Coinbase Websocket API进行数据分析。 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.据我所知,可以为此使用 REST API ,但它不包括时间戳。 The other options are the websocket level2 updates and the full channels.其他选项是 websocket 2 级更新和完整频道。

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.问题是,当我处理 level2 更新时,我一直在时间倒退(我在编程时没有关注处理速度,因为这不是我的目标,我没有硬件,也没有连接速度来做到这一点),因此例如在 30 分钟后,我只能处理 10 分钟的数据。

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.如果无论出于何种原因我与交换断开连接,我必须重新连接,并且中间有一个大的空 window 数据,就会出现问题。

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?还是我应该辞职并改进我的代码并购买更好的设备?

PD: I am relatively new, so sorry if this type of question does not fit here! PD:我比较新,如果这类问题不适合这里,请见谅!

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.以防万一有人感兴趣,我刚刚在不同时间打开了多个 websocket windows 并定期重新连接它们,以便尽可能少地错过价格更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM