Open aceffer opened 2 years ago
Describe the bug Order book data from BitMEX for symbol MATICUSDT is incorrect.
To Reproduce Steps to reproduce the behavior: Run this script and compare prices and volumes against data on bitmex.com.
from cryptofeed import FeedHandler from cryptofeed.defines import L2_BOOK import cryptofeed.exchanges from datetime import datetime, timedelta from cryptofeed.exchanges import Bitmex class BookReader: def __init__(self): self.__last_print = datetime.utcnow() async def book(self, book, receipt_timestamp): if datetime.utcnow() - self.__last_print > timedelta(seconds=1): bid = float(book.book['bid'].index(0)[0]) ask = float(book.book['ask'].index(0)[0]) bidVol = book.book['bid'].index(0)[1] askVol = book.book['ask'].index(0)[1] print(f"bid={bid} / {bidVol} ask={ask} / {askVol}") self.__last_print = datetime.utcnow() def main(): config = {'log': {'filename': 'demo.log', 'level': 'DEBUG', 'disabled': False}} f = FeedHandler(config=config) br = BookReader() f.add_feed(Bitmex(max_depth=10, subscription={L2_BOOK: ['MATIC-USDT-PERP']}, callbacks={L2_BOOK: br.book}), checksum_validation=True, cross_check=True) f.run() if __name__ == '__main__': main()
Expected behavior The price and volume should be the same as the exchange provides on their website.
Screenshots
Operating System:
Cryptofeed Version 2.2.1, 2.2.3
And Also incorrect volumes on HuobiSwap.
Describe the bug Order book data from BitMEX for symbol MATICUSDT is incorrect.
To Reproduce Steps to reproduce the behavior: Run this script and compare prices and volumes against data on bitmex.com.
Expected behavior The price and volume should be the same as the exchange provides on their website.
Screenshots
Operating System:
Cryptofeed Version 2.2.1, 2.2.3