Skip to content

Hyperliquid surge hook#64

Merged
bulkcade merged 78 commits into
hyperliquid-hook-mainfrom
hyperliquid-surge-hook
Sep 22, 2025
Merged

Hyperliquid surge hook#64
bulkcade merged 78 commits into
hyperliquid-hook-mainfrom
hyperliquid-surge-hook

Conversation

@bulkcade
Copy link
Copy Markdown
Contributor

Description

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Dependency changes
  • Code refactor / cleanup
  • Optimization: [ ] gas / [ ] bytecode
  • Documentation or wording changes
  • Other

Checklist:

  • The diff is legible and has no extraneous changes
  • Complex code has been commented, including external interfaces
  • Tests have 100% code coverage
  • The base branch is either main, or there's a description of how to merge

Issue Resolution

bulkcade and others added 2 commits August 14, 2025 18:46
Co-authored-by: Juan Ignacio Ubeira <juani@balancerlabs.dev>
Co-authored-by: Juan Ignacio Ubeira <juani@balancerlabs.dev>
Copy link
Copy Markdown
Contributor

@joaobrunoah joaobrunoah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey guys, this is a great hook!

I've left some suggestions about the standards that we follow. Besides, I think it'd be great to have a fork test on HyperEVM to test the PRECOMPILE addresses and make sure it behaves as we expect (although I can do that in another PR, if needed).

Comment thread pkg/pool-hooks/contracts/hooks-quantamm/HyperSurgeHook.sol Outdated
Comment thread pkg/pool-hooks/contracts/hooks-quantamm/HyperSurgeHook.sol Outdated
Comment thread pkg/pool-hooks/contracts/hooks-quantamm/HyperSurgeHook.sol Outdated
Comment thread pkg/pool-hooks/contracts/hooks-quantamm/HyperSurgeHook.sol Outdated
Comment thread pkg/pool-hooks/contracts/hooks-quantamm/HyperSurgeHook.sol
Comment thread pkg/pool-hooks/contracts/hooks-quantamm/HyperSurgeHook.sol
Comment thread pkg/pool-hooks/contracts/hooks-quantamm/HyperSurgeHook.sol Outdated
Comment thread pkg/pool-hooks/contracts/hooks-quantamm/HyperSurgeHook.sol Outdated
Comment thread pkg/pool-hooks/contracts/hooks-quantamm/HyperSurgeHook.sol Outdated
Comment thread pkg/pool-weighted/contracts/WeightedPool.sol
bulkcade and others added 4 commits August 15, 2025 09:49
Co-authored-by: Juan Ignacio Ubeira <juani@balancerlabs.dev>
Co-authored-by: João Bruno - Balancer Labs <joaobrunoah@gmail.com>
Copy link
Copy Markdown
Contributor

@joaobrunoah joaobrunoah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Chris. Just some notes about szDecimals and the TokenInfo struct returned by the Precompile. Looks like you'll need 2 indexes: the pairIndex to fetch the spot price, and the tokenIndex to fetch the szDecimals. I've checked in Hypercore API, these are two different things.

For example, for UETH, the tokenIndex is 221, and the pairIndex is 151. The structs below are based on a POST request to api https://api.hyperliquid.xyz/info, with body 'type' = 'spotMeta'.

Struct of token index on Hyper API:

{
      name: 'UETH',
      szDecimals: 4,
      weiDecimals: 9,
      index: 221,
      tokenId: '0xe1edd30daaf5caac3fe63569e24748da',
      isCanonical: false,
      evmContract: { address: '0xbe6727b535545c67d5caa73dea54865b92cf7907', evm_extra_wei_decimals: 9 },
      fullName: 'Unit Ethereum',
      deployerTradingFeeShare: '1.0',
    }

Struct of pairIndex on Hyper API:

{ tokens: [221, 0], name: '@151', index: 151, isCanonical: false }

Comment thread pkg/pool-hooks/contracts/hooks-quantamm/HyperSurgeHook.sol Outdated
Comment thread pkg/pool-hooks/contracts/hooks-quantamm/HyperSurgeHook.sol Outdated
@bulkcade bulkcade merged commit 4d5b999 into hyperliquid-hook-main Sep 22, 2025
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants