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 Trades do not work for Linear Futures #1010

Closed
pavs94 opened this issue Feb 2, 2024 · 1 comment · Fixed by #1017
Closed

Bybit Trades do not work for Linear Futures #1010

pavs94 opened this issue Feb 2, 2024 · 1 comment · Fixed by #1017
Labels

Comments

@pavs94
Copy link

pavs94 commented Feb 2, 2024

Describe the bug
When subscribing to BTCUSDT Perpetual Futures, the subscription fails as the websocket connection url is different on bybit

To Reproduce
Steps to reproduce the behavior:

from datetime import datetime as dt

from cryptofeed import FeedHandler
from cryptofeed.backends.aggregate import Throttle
from cryptofeed.defines import TRADES
from cryptofeed.exchanges import Bybit


async def trade(t, receipt_timestamp):
    print(f"Book received at {t} ts: {receipt_timestamp}")


def main():
    f = FeedHandler()
    f.add_feed(Bybit(symbols=['BTC-USDT-PERP'], channels=[TRADES], callbacks={TRADES: trade}))

    f.run()


if __name__ == '__main__':
    main()

Expected behavior

  • Get Trades for Bybit BTCUSDT. Subscribe to the correct websocket
    https://bybit-exchange.github.io/docs/v5/ws/connect
  • USDT Futures: wss://stream.bybit.com/v5/public/linear
  • Inverse Futures: wss://stream.bybit.com/v5/public/inverse
  • Upgrade Bybit functions with the upgraded Websockets

Operating System:

  • macOS

Cryptofeed Version

  • installed via pip - v2.4.0
@pavs94 pavs94 added the bug label Feb 2, 2024
@gawaboga
Copy link

gawaboga commented Mar 7, 2024

Hi, I'm getting same errors, Cryptofeed Version 2.4.0, on ubuntu:
fh.add_feed(Bybit(symbols=['BTC-USDT-PERP'], channels=[FUNDING, OPEN_INTEREST], callbacks={OPEN_INTEREST: oi, FUNDING: funding}))

output:
2024-03-07 16:26:43,689 : ERROR : BYBIT.ws.1: Error from exchange {'success': False, 'ret_msg': 'error:handler not found,topic:instrument_info.100ms.BTCUSDT', 'conn_id': '26ffa4fb-e6aa-48fb-94b3-91f415ec765c', 'req_id': '', 'op': 'subscribe'}

How is possible to solve in the code?
Really appreciate,
Thanks Sam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants