feat(perps): double fee for hip-3 assets #21919
Merged
+144
−57
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
Implement 2x fee multiplier for HIP-3 (HyperLiquid Improvement Proposal 3) assets as per HyperLiquid protocol specification.
What changed:
dex:SYMBOLformat likexyz:TSLA) now have 2x base exchange feesBTC,ETH) are unaffectedWhy:
HyperLiquid protocol charges double base fees for builder-deployed perpetuals (HIP-3 assets):
How:
Applied 2x multiplier to all three fee rate sources:
Changelog
CHANGELOG entry: Fixed HIP-3 perpetuals to display correct 2x exchange fees
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/TAT-1950
Manual testing steps
Screenshots/Recordings
Before
HIP-3 assets showed incorrect 0.043% provider fee (missing 2x multiplier)

After
HIP-3 assets correctly show 0.086% provider fee (2x multiplier applied)

Pre-merge author checklist
Pre-merge reviewer checklist
Technical Details
Files Modified:
app/components/UI/Perps/controllers/types/index.ts- Addedcoinparameter toFeeCalculationParamsapp/components/UI/Perps/controllers/providers/HyperLiquidProvider.ts- Applied HIP-3 2x multiplier to all rate sourcesapp/components/UI/Perps/controllers/PerpsController.ts- Updated method signatureapp/components/UI/Perps/hooks/usePerpsOrderFees.ts- Passcoinparameterapp/components/UI/Perps/hooks/usePerpsCloseAllCalculations.ts- PasscoinparametercoinparameterTest Coverage:
hip3-fee-validation.test.tswith 8 validation testsKey Implementation:
Note
Implements a 2× fee multiplier for HIP-3 (
dex:SYMBOL) assets and updates fee calculation to requirecoin, applying the multiplier across base, cached, and API-fetched rates with comprehensive test updates.HIP3_FEE_CONFIGwithFEE_MULTIPLIER: 2inconstants/hyperLiquidConfig.ts.parseAssetName(coin)) inHyperLiquidProvider.calculateFees()for:coinrequired inFeeCalculationParams(controllers/types).PerpsController.calculateFeessignature to acceptFeeCalculationParamsand forward to provider.cointo fee calc inusePerpsOrderFeesandusePerpsCloseAllCalculations.coin.HyperLiquidProvider.test.ts.isFeeCacheValidedge case).Written by Cursor Bugbot for commit d096fa9. This will update automatically on new commits. Configure here.