hummingbot icon indicating copy to clipboard operation
hummingbot copied to clipboard

Feat/Hyperliquid spot connector

Open lutwidse opened this issue 1 year ago • 1 comments

Before submitting this PR, please make sure:

  • [x] Your code builds clean without any errors or warnings
  • [x] You are using approved title ("feat/", "fix/", "docs/", "refactor/")

A description of the changes proposed in the pull request: Implementation of Hyperliquid Exchange Spot Connector

Tests performed by the developer: Ongoing - Pure MM

Tips for QA testing: Ongoing

Fix Required: As the commit log notes, I'm struggling with the c_get_price

hummingbot.connector.exchange.hyperliquid.hyperliquid_exchange.HyperliquidExchange - WARNING - Ask orderbook for PURR_1-USDC_0 is empty.

The issue is how the Hyperliquid Spot API handles orders using a single token index instead of typical symbols like PURR-USDC. (though it does accept PURR/USDC as a special case)

e.g. orders are placed using @ 1, @ 2, @ 3 for tokens PURR-USDC, TEST-USDC, JPL-USDC. Additionally, Hyperliquid allows duplicate token names.

I’ve therefore mapped token indexes to token names in the _initialize_trading_pair_symbols_from_exchange_info This follows the Hummingbot token format and also enables future support for pairs like @1-@1 and @1-@2, allowing us to handle individual token indices separately.

hummingbot.connector.exchange.hyperliquid.hyperliquid_exchange.HyperliquidExchange - DEBUG - Mapped @1-@0 to PURR_1-USDC_0
hummingbot.connector.exchange.hyperliquid.hyperliquid_exchange.HyperliquidExchange - DEBUG - Mapped @2-@0 to TEST_2-USDC_0
hummingbot.connector.exchange.hyperliquid.hyperliquid_exchange.HyperliquidExchange - DEBUG - Mapped @3-@0 to JPL _3-USDC_0
hummingbot.connector.exchange.hyperliquid.hyperliquid_exchange.HyperliquidExchange - DEBUG - Mapped @4-@0 to BREAD_4-USDC_0
hummingbot.connector.exchange.hyperliquid.hyperliquid_exchange.HyperliquidExchange - DEBUG - Mapped @6-@0 to KOGU_6-USDC_0

I’m looking for tips on implementing a secure solution for mapping a single token index as the trading_pairs. Thank you.

lutwidse avatar Aug 31 '24 02:08 lutwidse

@lutwidse amazing work here my friend! thanks for working on this. the question is, there are multiple markets? if so we can do a list mapping like it's done in XRPL connector, if not, the market should be BASE-QUOTE in hummingbot mapped to whatever appears in Hyperliquid. The last thing that I would say is that you might copy the most of the code from hyperliquid perpetual that was done by @yancong001

cardosofede avatar Sep 03 '24 16:09 cardosofede

Closing PR since there are no updates and this PR is almost done #7282

cardosofede avatar Nov 18 '24 01:11 cardosofede