Perps collateral gating and price fixes#9530
Conversation
|
@metamaskbot publish-previews |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
…ns in assetCtxs handler (TAT-3387)
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 5dbe70c. Configure here.
geositta
left a comment
There was a problem hiding this comment.
Requesting changes for two correctness gaps in the new collateral and price source gates. Collateral must be positively identified as USDC before discovery or trading proceeds, and fast feed ownership must not suppress assetCtxs until a usable price is cached. The notification scoping, API removal, and supporting coverage otherwise look good. Please address these cases with tests if you agree?
geositta
left a comment
There was a problem hiding this comment.
Thanks for addressing the collateral fail open behavior and fast feed bootstrap handling.
I am requesting one remaining change so every market discovery path enforces the same USDC-only policy. Once getMarketDataWithPrices excludes unsupported HIP-3 DEXs from fresh and cached results, this should be ready for approval.
…ng-and-price-fixes
Merging main pulled in the 9.3.0 release, which moved prior Unreleased content into a 9.3.0 section and left Unreleased empty. The merge commit left this branch's new entries attached to the now-released 9.3.0 section instead of the fresh Unreleased section, which the merge-queue changelog check flags. Move them back under Unreleased. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@metamaskbot publish-previews |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |

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 (HIP-3 order rejection), real-time price sourcing, and a breaking public export; behavior is heavily tested but incorrect collateral or price ownership could affect tradability and UI freshness.
Overview
Aligns perps-controller with HyperLiquid’s USDH sunset and slower public
assetCtxsfeed.HIP-3 collateral (TAT-3304): HIP-3 DEXs are supported only when collateral resolves to USDC via spot metadata (fail-closed if metadata is missing). Non-USDC DEXs are removed from
getMarketsandgetMarketDataWithPrices(including stale cache), andplaceOrderreturnsUNSUPPORTED_COLLATERALinstead of the old USDC→USDH auto-swap. TheUSDH_CONFIGexport is removed (breaking), along with all USDH swap/transfer helpers.Faster prices (TAT-3387): Subscribes to global
fastAssetCtxsfor mark/mid updates; per-DEXassetCtxsstill supplies funding/OI/volume/oracle and no longer overwrites prices for coins covered byfastAssetCtxs(HIP-3 symbols keep usingassetCtxswhen not on the fast feed). Subscription is restored on reconnect and torn down inclearAll().Notification efficiency (TAT-3454):
#notifyAllPriceSubscribersaccepts an optionalchangedSymbolsset soallMids,fastAssetCtxs, andactiveAssetCtxonly notify subscribers for symbols whose prices actually changed.Reviewed by Cursor Bugbot for commit 2721cb0. Bugbot is set up for automated code reviews on this repo. Configure here.