Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BYBIT liquidation side data seems to be inverted in respect to other exchanges #985

Open
gigitalz opened this issue Jul 11, 2023 · 0 comments
Labels

Comments

@gigitalz
Copy link

gigitalz commented Jul 11, 2023

Describe the bug
BYBIT liquidation data seems to be inverted in respect to other exchanges like BINANCE_FUTURES or BITMEX, when the liquidation are SELL for these exchanges on BYBIT they are sent as side BUY.

To Reproduce

from multiprocessing import Process, freeze_support

from cryptofeed import FeedHandler
from cryptofeed.backends.socket import LiquidationsSocket
from cryptofeed.defines import LIQUIDATIONS
from cryptofeed.exchanges import EXCHANGE_MAP

def writer(addr, port):
    f = FeedHandler()
    configured = []
    exchanges = {'BINANCE_FUTURES', 'BITMEX', 'BYBIT'}

    print("Querying exchange metadata...")
    for exchange_string, exchange_class in EXCHANGE_MAP.items():
        if exchange_string in exchanges:
            if LIQUIDATIONS in exchange_class.info()['channels']['websocket']:
                configured.append(exchange_string)
                print(exchange_string)
                symbols = [sym for sym in exchange_class.symbols() if 'PINDEX' not in sym]
                f.add_feed(exchange_class(subscription={LIQUIDATIONS: symbols}, callbacks={LIQUIDATIONS: LiquidationsSocket(addr, port=port)}), timeout=600)
                       
    print("Starting feedhandler for exchanges:", ', '.join(configured))
    f.run()


if __name__ == '__main__':
    freeze_support()
    p = Process(target=writer, args=('udp://127.0.0.1', 12345))
    p.start()

Expected behavior
I expect liquidation side to be coherent for all exchanges

Operating System:
Windows 10

Cryptofeed Version
2.3.2

@gigitalz gigitalz added the bug label Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant