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

Bug Report: Hyperliquid - Error subscribing order book data streams and public klines #7501

Open
lgrawet opened this issue Mar 15, 2025 · 1 comment
Labels

Comments

@lgrawet
Copy link

lgrawet commented Mar 15, 2025

Describe the bug

Hi,

It looks like Hyperliquid is currently unusable for many pairs. I used v2_directional_rsi.py for the example.
HYPE-USDC is working but BTC-USDC is throwing the following errors at startup:

Image

2025-03-15 09:03:06,462 - 17 - hummingbot.connector.exchange.hyperliquid.hyperliquid_api_order_book_data_source.HyperliquidAPIOrderBookDataSource - ERROR - Unexpected error occurred subscribing to order book data streams.
2025-03-15 09:03:06,463 - 17 - hummingbot.connector.exchange.hyperliquid.hyperliquid_api_order_book_data_source.HyperliquidAPIOrderBookDataSource - ERROR - Unexpected error occurred when listening to order book streams. Retrying in 5 seconds...
Traceback (most recent call last):
  File "/home/hummingbot/hummingbot/core/data_type/order_book_tracker_data_source.py", line 79, in listen_for_subscriptions
    await self._subscribe_channels(ws)
  File "/home/hummingbot/hummingbot/connector/exchange/hyperliquid/hyperliquid_api_order_book_data_source.py", line 83, in _subscribe_channels
    symbol = await self._connector.exchange_symbol_associated_to_pair(trading_pair=trading_pair)
  File "hummingbot/connector/exchange_base.pyx", line 97, in exchange_symbol_associated_to_pair
    return symbol_map.inverse[trading_pair]
  File "/opt/conda/envs/hummingbot/lib/python3.10/site-packages/bidict/_base.py", line 524, in __getitem__
    return self._fwdm[key]
KeyError: 'BTC-USDC'
2025-03-15 09:03:06,681 - 17 - hummingbot.data_feed.candles_feed.hyperliquid_spot_candles.hyperliquid_spot_candles - ERROR - Unexpected error occurred subscribing to public klines...
Traceback (most recent call last):
  File "/home/hummingbot/hummingbot/data_feed/candles_feed/candles_base.py", line 383, in _subscribe_channels
    subscribe_candles_request: WSJSONRequest = WSJSONRequest(payload=self.ws_subscription_payload())
  File "/home/hummingbot/hummingbot/data_feed/candles_feed/hyperliquid_spot_candles/hyperliquid_spot_candles.py", line 123, in ws_subscription_payload
    "coin": self._coins_dict[self._base_asset],
KeyError: 'BTC'
2025-03-15 09:03:06,683 - 17 - hummingbot.data_feed.candles_feed.hyperliquid_spot_candles.hyperliquid_spot_candles - ERROR - Unexpected error occurred when listening to public klines. Retrying in 1 seconds...
Traceback (most recent call last):
  File "/home/hummingbot/hummingbot/data_feed/candles_feed/candles_base.py", line 354, in listen_for_subscriptions
    await self._subscribe_channels(ws)
  File "/home/hummingbot/hummingbot/data_feed/candles_feed/candles_base.py", line 383, in _subscribe_channels
    subscribe_candles_request: WSJSONRequest = WSJSONRequest(payload=self.ws_subscription_payload())
  File "/home/hummingbot/hummingbot/data_feed/candles_feed/hyperliquid_spot_candles/hyperliquid_spot_candles.py", line 123, in ws_subscription_payload
    "coin": self._coins_dict[self._base_asset],
KeyError: 'BTC'

Steps to reproduce

  1. Create config for v2_directional_rsi.py exchange/candles_exchange: hyperliquid, trading_pair/candles_pair: HYPE-USDC
  2. Start the script, it should be OK
  3. Create another config for v2_directional_rsi.py exchange/candles_exchange: hyperliquid, trading_pair/candles_pair: BTC-USDC
  4. Start the script and observe the errors

Release version

2.4.0

Type of installation

Docker

Attach required files

No response

@lgrawet lgrawet added the bug label Mar 15, 2025
@lgrawet
Copy link
Author

lgrawet commented Mar 17, 2025

As discussed on Discord, I have to use UBTC instead of BTC and I just found out why!
First let's check the contract from Hyperliquid trading interface. This is not Bitcoin but Unit Bitcoin.
Here is the explanation

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