3 Commits

Author SHA1 Message Date
ramseshk 526a40b01e Rename VIP→Tier, recalculate equity curve on fee tier change
Renamed all "VIP N" to "Tier N" in config, server, and HTML dropdowns.

Added recalc_equity_curve() that rebuilds the equity curve with new
fee rates. Previously the equity curve was passed through unchanged
when switching tiers, so the chart visually stayed identical even
though PnL numbers changed. Now each tier produces its own curve.

Example OBI historical: Tier 0 equity ends at 141.5, Tier 6 at 149.7 —
the chart visibly shifts up as fees drop from 4.5bp to 2.4bp taker.
2026-08-04 09:12:07 +00:00
ramseshk 055da97a79 Fix fee tiers to match official Hyperliquid docs
Perps tiers 4-6 had wrong volume thresholds, taker rates, and
incorrect negative maker rebates (HL only has rebates via staking).

Changes (matching https://hyperliquid.gitbook.io/.../trading/fees):
  Tier 4: $250M→$500M vol, taker 0.025%→0.028%
  Tier 5: $750M→$2B vol, taker 0.020%→0.026%, maker -0.002%→0.000%
  Tier 6: $2.5B→$7B vol, taker 0.015%→0.024%, maker -0.004%→0.000%

UI dropdown labels updated to match. Chart refresh enhanced with
resize+fitContent after recalc for smooth transitions.
2026-08-04 09:04:05 +00:00
ramseshk 0c0d2124ad Add Hyperliquid fee tier selector — 7 VIP levels × 7 staking tiers
config/fee_tiers.py: complete Hyperliquid fee schedule with perps and spot
base rates plus staking discount multipliers. effective_rate() computes
the actual fee after staking discount. get_perp_fees() returns the
effective rate for a given VIP tier, staking tier, and fee model.

Backtest runner: added --fee-tier (0-6) and --staking-tier flags.
Regenerated all 12 backtests at VIP 0 baseline. Runner now shows fee tier
info at startup.

Server: /api/backtest/{name}/recalc endpoint accepts ?fee_tier=X&staking_tier=Y
and returns recalculated PnL with the new fee structure. On-the-fly
recalculation — no need to re-run the backtest.

Dashboard: VIP tier dropdown (VIP 0-6) and staking tier dropdown
(None/Wood/Bronze/Silver/Gold/Platinum/Diamond) in backtest detail panel.
Changing either instantly recalculates PnL via the API.

Key finding: Cartea-Jaimungal goes from -5.58% net at VIP0 to +2.39% net
at VIP6+Diamond (maker rebate: exchange pays YOU -0.0024% to provide
liquidity). Fee structure completely changes strategy viability assessment.
2026-08-04 07:26:40 +00:00