From 64243b0a6eb052b659141b5833945436c3b9875a Mon Sep 17 00:00:00 2001 From: Chris Gilbert Date: Mon, 19 Dec 2022 14:14:37 -0500 Subject: [PATCH] timestamp correction --- cryptofeed/exchanges/kucoin.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cryptofeed/exchanges/kucoin.py b/cryptofeed/exchanges/kucoin.py index 405a95280..d93feed41 100644 --- a/cryptofeed/exchanges/kucoin.py +++ b/cryptofeed/exchanges/kucoin.py @@ -343,7 +343,11 @@ async def _process_l2_book(self, msg: dict, symbol: str, timestamp: float): self.seq_no[symbol] = data['sequenceEnd'] - ts = data['time'] / 1000 + if 'time' in data: + ts = data['time'] / 1000 + else: + LOG.debug("No timestamp data returned by Kucoin websocket.") + ts = None delta = {BID: [], ASK: []} for s, side in (('bids', BID), ('asks', ASK)): for update in data['changes'][s]: