Commit Graph

3 Commits

Author SHA1 Message Date
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
ramseshk b59dcc3629 Initial project scaffold: five quant strategies for Hyperliquid Testnet
Set up the directory structure and wrote placeholder logic for:

- Order Book Imbalance: trades on L2 bid/ask skew
- Iceberg/TWAP detection: follows whale accumulation patterns
- Funding rate arbitrage: delta-neutral carry on perp funding
- Pairs trading: BTC/ETH spread mean reversion
- Avellaneda-Stoikov market making: optimal bid/ask quoting

Also added shared risk manager, portfolio tracker, and a plain-language strategy walkthrough in docs/.
2026-08-03 11:12:20 +00:00