Skip to content

Fee display — Slice 2: HIP-3 effective rate + strikethrough + subsidy hint #100

@vipineth

Description

@vipineth

Parent PRD

#98

What to build

The second vertical slice. Teaches the fee system about HIP-3 builder-deployed perpetuals and makes subsidized markets (e.g. brentoil in growth mode) display their correct, dramatically lower effective rate. Adds the strikethrough tier-0 comparison line and the "Subsidized market" hint. Includes a manual verification gate against Hyperliquid's own UI before merge.

End-to-end behavior on HIP-3 markets:

  • computeEffectiveFee is extended with the HIP-3 branch:
    effective = userRate × 2 × deployerFeeScale × (growthMode ? 0.1 : 1).
    Validator markets continue to return userRate unchanged.
  • useFeeRates is extended to detect HIP-3 markets via UnifiedMarket.kind === "builderPerp", read deployerFeeScale from perpDexs[dexIndex], and read growthMode from meta.universe[assetIndex]. No new top-level fetches — all data already flows through MarketsProvider.
  • The tooltip gains a strikethrough tier-0 row rendered only when the effective rate is discounted (user tier/staking/referral) or subsidized (HIP-3). Tier-0 baseline: 0.0450% / 0.0150% perp, 0.0700% / 0.0400% spot.
  • A small "Subsidized market" hint appears in the tooltip when isHip3 && isGrowthMode.
  • Unit tests extended for: HIP-3 normal (deployerFeeScale = 1, no growth), HIP-3 growth mode (deployerFeeScale = 1, growth on), HIP-3 with deployerFeeScale > 1, spot HIP-3 edge (if spot+builder data path is reachable), string-precision cases.

Manual verification gate (HITL — required before merge)

Open Hyperliquid's own frontend while connected with the same wallet. For each of the following markets, the tooltip's "Your rate" must match Hyperliquid's displayed effective rate to four decimals for both taker and maker:

  • (a) A validator market (e.g. BTC-PERP).
  • (b) A HIP-3 growth-mode market (e.g. brentoil if available; otherwise any flagged growth-mode HIP-3 perp).
  • (c) A HIP-3 non-growth market.

If any rate fails to match, the formula is wrong — fix before merging. Attach a screenshot grid of HyperTerminal vs. Hyperliquid for each market to the PR.

Reference the parent PRD's Implementation Decisions, Testing Decisions, and Further Notes sections for full context.

Acceptance criteria

  • HIP-3 markets show the correct effective rate using the × 2 × deployerFeeScale × (growthMode ? 0.1 : 1) formula.
  • Strikethrough tier-0 row appears in the tooltip when effective < base (either user discount or HIP-3 subsidy); hidden otherwise.
  • "Subsidized market" hint appears in the tooltip when isHip3 && isGrowthMode.
  • Unit tests cover all new HIP-3 cases; all tests pass.
  • Manual verification: four-decimal match with Hyperliquid's UI on the three market categories above; screenshots attached to PR.
  • Typecheck passes for the whole app.
  • No regressions on validator markets (Slice 1 acceptance criteria still hold).

Blocked by

User stories addressed

Reference by number from the parent PRD:

  • User story 2
  • User story 3
  • User story 4
  • User story 13
  • User story 14
  • User story 16
  • User story 17

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions