feat(perps): remove USDH collateral handling from HyperLiquid provider#9124
Open
michalconsensys wants to merge 1 commit into
Open
feat(perps): remove USDH collateral handling from HyperLiquid provider#9124michalconsensys wants to merge 1 commit into
michalconsensys wants to merge 1 commit into
Conversation
USDH support is being sunset. Remove all USDH-specific logic including spot balance checks, USDC-to-USDH swaps, collateral transfers, and the cached spot metadata layer. Simplify getUsdcTokenId to fetch spot metadata directly. Update tests to use generic non-USDC tokens instead of USDH.
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.
Description
Removes all USDH collateral handling logic from the HyperLiquid provider. USDH support is being sunset, so the automatic USDC→USDH swap flow, spot balance checks, and session-cached spot metadata are no longer needed.
Changes
USDH_CONFIGconstant and its public export#isUsdhCollateralDex,#getSpotUsdhBalance,#getSpotUsdcBalance,#transferUsdcToSpot,#swapUsdcToUsdh,#ensureUsdhCollateralForOrder,#getCachedSpotMeta#cachedSpotMetafield and its pre-fetch inensureReadyForTrading()#ensureCollateralForHip3Order#getUsdcTokenIdto callspotMeta()directly instead of going through the removed cacheSPOT_ASSET_ID_OFFSET,SpotMetaResponse)Changelog
@metamask/perps-controllerUSDH_CONFIGconstantRelated issues
N/A
Manual testing steps
N/A — internal cleanup with no behavioral change for USDC-collateralized DEXs.
Screenshots/Recordings
N/A
Pre-merge author checklist
Pre-merge reviewer checklist