Skip to content

Commit

Permalink
bug and typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasbs17 committed Jan 17, 2024
1 parent 7122f6a commit 0420a45
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Changelog

### 2.5.0
* Update: transitioned from Coinbase Pro (retired) to Coinbase Advanced Trades
* Update: transitioned from Coinbase Pro (retired) to Coinbase Advanced Trade

### 2.4.1
* Bugfix: Handle empty nextFundingRate in OKX
Expand Down
4 changes: 2 additions & 2 deletions cryptofeed/exchanges/coinbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ async def _pair_level2_snapshot(self, msg: dict, timestamp: float):
async def _pair_level2_update(self, msg: dict, timestamp: float):
pair = self.exchange_symbol_to_std_symbol(msg['product_id'])
delta = {BID: [], ASK: []}
ts = self.timestamp_normalize(msg['timestamp'])
for update in msg['updates']:
ts = self.timestamp_normalize(update['event_time'])
side = BID if update['side'] == 'bid' else ASK
price = Decimal(update['price_level'])
amount = Decimal(update['new_quantity'])
Expand All @@ -160,7 +160,7 @@ async def _pair_level2_update(self, msg: dict, timestamp: float):
self._l2_book[pair].book[side][price] = amount
delta[side].append((price, amount))

await self.book_callback(L2_BOOK, self._l2_book[pair], timestamp, timestamp=ts, raw=msg, delta=delta)
await self.book_callback(L2_BOOK, self._l2_book[pair], timestamp, timestamp=ts, raw=msg, delta=delta)

async def _book_snapshot(self, pairs: list):
# Coinbase needs some time to send messages to us
Expand Down

0 comments on commit 0420a45

Please sign in to comment.