Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cryptofeed/backends/quest.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ def __init__(self, *args, depth=10, **kwargs):
self.depth = depth

async def __call__(self, book, receipt_timestamp: float):
vals = ','.join([f"bid_{i}_price={book.book.bids.index(i)[0]},bid_{i}_size={book.book.bids.index(i)[1]}" for i in range(self.depth)] + [f"ask_{i}_price={book.book.asks.index(i)[0]},ask_{i}_size={book.book.asks.index(i)[1]}" for i in range(self.depth)])
bid_depth = min(self.depth, len(book.book.bids))
ask_depth = min(self.depth, len(book.book.asks))
bid_vals = [f"bid_{i}_price={book.book.bids.index(i)[0]},bid_{i}_size={book.book.bids.index(i)[1]}" for i in range(bid_depth)]
ask_vals = [f"ask_{i}_price={book.book.asks.index(i)[0]},ask_{i}_size={book.book.asks.index(i)[1]}" for i in range(ask_depth)]
vals = ','.join(bid_vals + ask_vals)
timestamp = book.timestamp
receipt_timestamp_int = int(receipt_timestamp * 1_000_000)
timestamp_int = int(timestamp * 1_000_000_000) if timestamp is not None else receipt_timestamp_int * 1000
Expand Down
3 changes: 2 additions & 1 deletion cryptofeed/exchanges/binance.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ def _address(self) -> Union[str, Dict]:
# for everything but premium index the symbols need to be lowercase.
if pair.startswith("p"):
if normalized_chan != CANDLES:
raise ValueError("Premium Index Symbols only allowed on Candle data feed")
LOG.warning("%s: Premium Index symbol %s is only supported on Candle feed; skipping for %s", self.id, pair, normalized_chan)
continue
else:
pair = pair.lower()
subs.append(f"{pair}@{stream}")
Expand Down