fix: hide HIP-3 provider prefix and gate Trade to supported xyz markets - #32008
Conversation
HIP-3 perp markets surfaced in the social leaderboard with their provider prefix (`xyz:`, `cash:`, `kv:` …). Strip the prefix everywhere the symbol is displayed via `getPerpsDisplaySymbol`. We only support trading `xyz` HIP-3 markets. The perp Trade CTA now resolves the position's symbol: `xyz`/non-HIP-3 symbols link directly; other HIP-3 providers are remapped to their `xyz` equivalent (`cash:SPCX` → `xyz:SPCX`) and linked only when that market exists in the tradable set (via `useTradablePerpsMarketSymbols`). When no `xyz` market exists, the button is disabled and reads "Unsupported asset". The xyz resolution + market-data subscription is scoped to a new `PerpsTradeButton` (wrapped in its own `PerpsStreamProvider`) so spot positions never mount the provider. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
1 similar comment
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
| "trades": "Trades", | ||
| "buy": "Buy", | ||
| "trade": "Trade", | ||
| "unsupported_asset": "Unsupported asset", |
There was a problem hiding this comment.
market instead of asset?
There was a problem hiding this comment.
I would hide the CTA completely, otherwise the user might not have enough context to know what the button should do it asset was supported, causing confusion.
"I see this disabled button, but I have no idea what it would do if it was enabled"
There was a problem hiding this comment.
@xavier-brochard this would only happen if this was the first time you were seeing the page, right? Low probability imo
There was a problem hiding this comment.
I think we can't just assume the user will remember what is the CTA is supposed to be doing when disabled, at any time. UI in general should be explicit, IMO.
There was a problem hiding this comment.
Fair enough. For this PR I'd rather leave it as is to avoid the design rabbit hole of where to put the "unsupported market" message. Happy to follow up on a ticket and see what/where to put it.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| * Wrapped in its own {@link PerpsStreamProvider} so the market-data | ||
| * subscription that backs the existence check is scoped to perp positions | ||
| * only — spot positions never mount it. The provider merely shares the | ||
| * app-wide stream singleton (no connection side effects of its own); the only | ||
| * effect is subscribing to the public market-data channel, which the homepage | ||
| * already warms. |
usePerpsMarkets can report isLoading:false with an empty market list while a fetch is still in flight (or when an empty controller cache is treated as preloaded), so gating on isLoading alone could lock a remapped HIP-3 position into a false, sticky 'Unsupported market'. Key off the set being empty instead (per the hook's documented contract) to stay optimistic until the list arrives. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag selection rationale:
No E2E specs directly test the Social Leaderboard trader position/profile views, so these are the closest coverage available. The changes are medium risk — they affect UI behavior and navigation logic but are scoped to the social leaderboard perps feature. Performance Test Selection: |
|
|
No release label on PR. Adding release label release-8.1.0 on PR, as PR was added to branch 8.1.0 when release was cut. |



Description
HIP-3 perpetual markets were surfacing in the social leaderboard with their raw provider prefix (
xyz:,cash:,kv:…), e.g.cash:SPCX, and the perp Trade button always linked straight to the position's symbol — even for HIP-3 providers we don't support trading.This PR:
getPerpsDisplaySymbol(strips everything up to and including the first:). Non-HIP-3 symbols pass through unchanged.xyzmarkets. We only support tradingxyzHIP-3 markets:xyz:and non-HIP-3 symbols link directly.xyzequivalent (cash:SPCX→xyz:SPCX) and linked only when that market exists in the tradable market set (checked viauseTradablePerpsMarketSymbols).xyzmarket exists, the button is disabled and reads "Unsupported asset".The xyz resolution and its backing market-data subscription are scoped to a new
PerpsTradeButtoncomponent (wrapped in its ownPerpsStreamProvider), so spot positions never mount the provider and the subscription is limited to perp positions only.PerpsStreamProvideritself only shares the app-wide stream singleton (no connection side effects); the sole effect is subscribing to the public market-data channel, which the homepage already warms.Changelog
CHANGELOG entry: Fixed Hyperliquid HIP-3 perp markets showing their provider prefix (e.g.
cash:) in the social leaderboard, and disabled the Trade button for assets without a supported xyz market.Related issues
Fixes: TSA-785
Manual testing steps
Screenshots/Recordings
Before
After
N/A — behavioral change covered by unit tests; UI screenshots to be attached on the PR.
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Social leaderboard UI and perp navigation only; no auth or payment paths, with broad unit test coverage.
Overview
HIP-3 perp symbols in the social leaderboard no longer show provider prefixes (
cash:SPCX→ SPCX) viagetPerpsDisplaySymbolon position detail and profile rows.Perp Trade is replaced by
PerpsTradeButton, which maps symbols to tradablexyzHIP-3 markets (getSupportedXyzPerpMarketSymbol), checks the tradable set fromuseTradablePerpsMarketSymbols, and either navigates to Perps market details or shows a disabled Unsupported market label. Non-xyzHIP-3 positions stay enabled optimistically while the market list is empty or loading.Unit tests cover display, navigation, gating, and optimistic behavior; copy adds
unsupported_market.Reviewed by Cursor Bugbot for commit 5b3e30b. Bugbot is set up for automated code reviews on this repo. Configure here.