Perps collateral gating and price fixes#9530
Open
gambinish wants to merge 8 commits into
Open
Conversation
Member
Author
|
@metamaskbot publish-previews |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 06e81f9. Configure here.
…ns in assetCtxs handler (TAT-3387)
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
Closes out three open perps-controller tickets left over from HyperLiquid's public feed changes and USDH sunset:
TAT-3454 — Price update notifications were fanning out to every subscribed symbol on every tick, even when only one symbol's price changed. Now #notifyAllPriceSubscribers takes an optional changedSymbols set so list-view subscribers (watchlists, market overview) stop re-rendering on unrelated symbol ticks.
TAT-3387 — HyperLiquid slowed down the public assetCtxs feed and introduced fastAssetCtxs to keep a fast (~5s) cadence for mark price. We now subscribe to fastAssetCtxs as the primary price source, while assetCtxs keeps handling funding/OI/volume/oracle data as before.
TAT-3304 — Following the USDH sunset, HIP-3 DEXs are now gated to USDC collateral only. Non-USDC DEXs are filtered out of market discovery and orders against them fail fast with a new UNSUPPORTED_COLLATERAL error, instead of attempting the now-defunct USDC→USDH auto-swap. The dead swap machinery and the public USDH_CONFIG export are removed (breaking).
References
Checklist
Note
Medium Risk
Touches live trading paths (order rejection, market discovery) and real-time price/WebSocket behavior, plus a breaking public export removal; changes are well-tested but affect consumer integrations and UI price freshness.
Overview
Aligns perps-controller with HyperLiquid’s USDH sunset and slower public
assetCtxsfeed by changing collateral rules, price sourcing, and how price updates are delivered.HIP-3 / collateral (TAT-3304): Non-USDC-collateral HIP-3 DEXs are dropped from market discovery and blocked at order time with
UNSUPPORTED_COLLATERALinstead of the old USDC→USDH auto-swap. The large USDH swap/transfer helpers and the publicUSDH_CONFIGexport are removed (breaking for importers). Collateral resolution fails open when spot metadata can’t identify the token.Prices (TAT-3387): A global
fastAssetCtxsWebSocket subscription becomes the primary mark/mid price path; per-DEXassetCtxsstill fills funding/OI/volume/oracle and no longer overwrites prices for coinsfastAssetCtxscovers (e.g. HIP-3 symbols still priced viaassetCtxswhen not on the fast feed). The feed is restored on reconnect and torn down onclearAll(), with the same transient retry as other subscriptions.Notifications (TAT-3454):
#notifyAllPriceSubscribersaccepts an optionalchangedSymbolsset soallMids,fastAssetCtxs, and per-symbolactiveAssetCtxticks don’t re-notify every list subscriber when unrelated symbols move.Reviewed by Cursor Bugbot for commit 93bd559. Bugbot is set up for automated code reviews on this repo. Configure here.