bmoscon / cryptofeed

Cryptocurrency Exchange Websocket Data Feed Handler
Other
2.14k stars 668 forks source link

L2_BOOK and crypto.com #953

Open voidloop opened 1 year ago

voidloop commented 1 year ago

Describe the bug L2_BOOK on crypto.com is not functioning properly. Access to the dictionary returns inconsistent data.

To Reproduce

from cryptofeed import FeedHandler
from cryptofeed.defines import CRYPTODOTCOM, L2_BOOK

f = FeedHandler()

async def callback(book, t):
    print(book.book.ask.index(0), list(book.book.ask.__data)[0])

f.add_feed(CRYPTODOTCOM, max_depth=5, symbols=['DOT-USDT'], channels=[L2_BOOK], callbacks={L2_BOOK: callback})

f.run()

Operating System:

# uname -a
Linux xxx 6.1.11-200.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Feb  9 19:20:24 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Cryptofeed Version

# pip list | grep cryptofeed
cryptofeed                     2.3.1

Thank you

voidloop commented 1 year ago

Sorry, the output of the program is

('10.0000', '23.52') 7.0835
('10.0000', '23.52') 7.0835
('10.0000', '23.52') 7.0835
('10.0000', '23.52') 7.0835
('10.0000', '23.52') 7.0835
('10.0000', '23.52') 7.0835
('10.0000', '23.52') 7.0835
('10.0000', '23.52') 7.0835
('10.0000', '23.52') 7.0835
('10.0000', '23.52') 7.0835
('10.0000', '23.52') 7.0829