Skip to content

Commit

Permalink
Update redis.py (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
GoldenNaim authored Nov 13, 2020
1 parent b5f1cda commit 20fa67f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cryptostore/aggregator/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from collections import defaultdict
import time

from cryptofeed.defines import TRADES, L2_BOOK, L3_BOOK, TICKER, FUNDING, OPEN_INTEREST
from cryptofeed.defines import TRADES, L2_BOOK, L3_BOOK, TICKER, FUNDING, OPEN_INTEREST, LIQUIDATIONS

from cryptostore.aggregator.util import l2_book_flatten, l3_book_flatten
from cryptostore.aggregator.cache import Cache
Expand Down Expand Up @@ -64,8 +64,8 @@ def read(self, exchange, dtype, pair, start=None, end=None):
updates = l2_book_flatten(updates)
elif dtype == L3_BOOK:
updates = l3_book_flatten(updates)
elif dtype in {TRADES, TICKER, OPEN_INTEREST}:
as_float = ('size', 'amount', 'price', 'timestamp', 'receipt_timestamp', 'bid', 'ask', 'open_interest')
elif dtype in {TRADES, TICKER, OPEN_INTEREST, LIQUIDATIONS}:
as_float = ('size', 'amount', 'price', 'timestamp', 'receipt_timestamp', 'bid', 'ask', 'open_interest', 'leaves_qty')
are_float = filter(as_float.count, updates[0])
for k in are_float:
for update in updates:
Expand Down

0 comments on commit 20fa67f

Please sign in to comment.