feat: base HyperLiquid activation detection on spot sends and creation fees#9594
Merged
Conversation
…n fees The activation fee reserve for Pay withdrawals only applied to accounts with no outbound ledger history at all. HyperLiquid charges the one-time 1 USDC activation fee on the first spot send unless it was already paid by the inbound transfer that created the account. Bridge withdrawals use a separate fee lane and do not settle it, so accounts whose only outbound history was bridge withdrawals were wrongly classified as activated and their max withdrawals failed with "Insufficient USDC balance for token transfer gas". - Stop treating bridge withdrawals as activation - Treat a creation entry carrying a fee >= 1 as paid activation - Reserve the fee when the activation check fails, instead of skipping
pedronfigueiredo
previously approved these changes
Jul 22, 2026
…rawals EIP-7702 wrapped withdrawals have a top-level type of batch, so the perpsWithdraw feature flag override was never matched and the activation fee was silently disabled for most accounts.
Resolve CHANGELOG conflict by keeping both main's dependency bumps and this PR's HyperLiquid activation fee fix entries.
dan437
enabled auto-merge
July 23, 2026 12:05
jpuri
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
The
hyperliquidActivationFeereserve added in #9238 decides whether to hold back the one-time HyperLiquid activation fee by probinguserNonFundingLedgerUpdates. It currently treats any outbound ledger entry as proof of activation, including bridgewithdrawentries, and assumes the account is activated whenever the probe fails.That does not match how HyperLiquid charges the fee. Verified against the live API:
fee: "1.0"). All later sends are then fee-free.So an account whose only outbound history is bridge withdrawals is still unactivated for spot sends. The probe classified such accounts as activated, skipped the reserve, and their max withdrawals failed on the
sendAssetstep withInsufficient USDC balance for token transfer gas.This PR reworks the detection:
send/spotTransfer. A fee on a later inbound entry is ignored, because it belongs to the sender's own first-send activation.It also fixes the feature flag lookup that gates the reserve. Most withdrawals are wrapped in an EIP-7702 batch, so the parent transaction type is
batchand theoverrides.perpsWithdraw.hyperliquidActivationFeeconfig was never matched — the reserve was silently disabled for those accounts before the activation probe even ran. The override is now resolved through the first typed nested transaction when the parent is a batch, matching the existing type resolution in the relay submit and fiat strategies. In the meantime we solved this already in prod via a LD change.Max withdrawals then leave no leftovers: activated accounts send 100% of their balance, and unactivated accounts reserve exactly the fee, which HyperLiquid consumes, so the account ends at zero.
References
Checklist