Understanding PnL on Hyperliquid
On Hyperliquid, every perpetual futures trade generates two types of profit and loss: realized PnL (profits from closed positions) and unrealized PnL (the current value of open positions). Hyperliquid displays both in your account dashboard, but understanding how they are calculated helps you make better trading decisions — especially when managing margin, stop losses, and funding costs. The core formula is straightforward: PnL equals the difference between your entry and exit price, multiplied by your position size and the contract multiplier. However, Hyperliquid adds complexity with funding rate payments, taker fees, and cross-margin accounting. This guide covers every variable so you can calculate your PnL accurately.
Realized PnL Formula
The realized PnL for a closed position on Hyperliquid is calculated as:
Realized PnL = (Exit Price - Entry Price) × Position Size × Direction
Where Direction is +1 for long positions and -1 for short positions. This gives you the gross PnL before fees and funding. Here is a concrete example using a BTC perpetual trade:
- Entry: Buy 1 BTC perpetual at $65,000 (long)
- Exit: Sell 1 BTC perpetual at $68,500
- Gross PnL: ($68,500 - $65,000) × 1 × 1 = $3,500
For a short position, the direction flips. If you short 1 BTC at $68,000 and buy back at $65,500:
- Gross PnL: ($65,500 - $68,000) × 1 × (-1) = +$2,500
This is the base calculation. Your actual net PnL subtracts fees and funding payments, which we cover next.
Unrealized PnL on Open Positions
Unrealized PnL uses the same formula but substitutes the current mark price for the exit price. Hyperliquid uses a mark price (not the last traded price) to calculate unrealized PnL, which prevents manipulation from low-liquidity trades. The formula becomes:
Unrealized PnL = (Mark Price - Entry Price) × Position Size × Direction
This value updates in real time as the mark price changes. Importantly, your unrealized PnL also reflects accrued but unpaid funding — Hyperliquid includes the expected next funding payment in your unrealized PnL calculation when positions are held near the funding settlement time (every hour).
Including Trading Fees in PnL
Hyperliquid charges fees on both opening and closing trades. The fee structure affects your net PnL significantly, especially for high-frequency traders. As of 2026, Hyperliquid's fee schedule is:
- Maker fees: 0.000% (zero for liquidity providers)
- Taker fees: 0.035% base rate (reduced to 0.0336% with HOLYGRAIL referral code)
To calculate net PnL including fees:
Net PnL = Gross PnL - (Entry Fee + Exit Fee)
Where Entry Fee = Position Size × Entry Price × Taker Rate, and Exit Fee = Position Size × Exit Price × Taker Rate. For a market order of 1 BTC at $65,000 with a 0.035% taker rate, the entry fee is $22.75. If you close at $68,500 with another market order, the exit fee is $23.98. Your net PnL on the $3,500 gross profit is $3,500 - $22.75 - $23.98 = $3,453.27. Using limit orders (maker) eliminates both entry and exit fees entirely, giving you the full $3,500.
Funding Rate Impact on PnL
Hyperliquid settles funding payments between long and short positions every hour. Funding rates keep perpetual prices aligned with spot prices, but they directly affect your PnL. The formula for funding cost is:
Funding Cost = Position Size × Entry Price × Funding Rate × Hours Held
When funding is positive, long positions pay short positions. When negative, shorts pay longs. Here is a realistic example:
- Position: 10x long 2 BTC at $65,000
- Position notional value: $130,000 (2 BTC × $65,000)
- Funding rate: 0.01% per hour (positive)
- Held for: 12 hours
- Total funding cost: $130,000 × 0.0001 × 12 = $156
This $156 is deducted from your PnL over 12 hours. On a $3,500 gross profit, funding reduces your net to $3,297.27 (after both fees and funding). Always check Hyperliquid's current funding rate page before opening leveraged positions you plan to hold for more than a few hours.
PnL Percentage and ROI
Your return on investment (ROI) is calculated against your margin (the collateral you put up), not the position size. The formula is:
ROI = Net PnL / Initial Margin × 100%
Using our example above: you put up $13,000 as margin for a 2 BTC position at 10x leverage. Your net PnL after fees and funding is $3,297.27. Your ROI is $3,297.27 / $13,000 × 100% = 25.36%. This is significantly different from the 5.38% gross price move ($3,500 / $65,000). Understanding this leverage magnification is critical — a 5% price move at 10x leverage produces a 50% ROI (before fees and funding), while a 5% loss can liquidate you entirely.
Tracking PnL Across Multiple Positions
Hyperliquid's cross-margin system complicates PnL tracking because all open positions share a single margin pool. Your total account PnL is the sum of all individual position PnL values, minus total fees paid, minus total funding costs. The easiest way to track this is:
- Hyperliquid dashboard: The "Portfolio" tab shows your total unrealized PnL across all positions in real time
- Trade history: The "Trades" tab shows closed positions with realized PnL, including fee breakdowns
- Manual spreadsheet: For serious traders, maintain a trade log with entry price, exit price, size, fees, and funding. This helps identify profitable and unprofitable patterns over time
Hyperliquid does not currently offer a downloadable CSV of trade history, so manual logging or an automated script using the Hyperliquid API is recommended for active traders who need detailed PnL tracking across hundreds of trades.
Common PnL Calculation Mistakes
- Ignoring funding on long holds: A position held for 24 hours at 0.01% hourly funding costs 0.24% of notional value. On a $100K position at 10x, that is $240 — enough to turn a small winner into a loser.
- Confusing gross and net PnL: Your Hyperliquid dashboard shows gross PnL by default. Net PnL (after all fees and funding) is available in the detailed view. Always check net before closing.
- Forgetting entry and exit fees: At 0.035% taker rate, a round-trip on a $50K position costs $35. For scalpers making 50 trades per day, this adds up to $1,750 — a massive drag on PnL.
- Using mark price vs last price: In fast-moving markets, the last traded price and mark price can diverge by 0.1-0.5%. Your unrealized PnL uses mark price, but your filled order uses the last price. This creates a temporary discrepancy that resolves when funding settles.
PnL Calculation Template for Traders
Here is a simple template you can use to calculate your net PnL for any Hyperliquid trade. Write down these values before and after each trade:
- A: Entry price
- B: Exit price
- C: Position size (contracts)
- D: Direction (1 for long, -1 for short)
- E: Gross PnL = (B - A) × C × D
- F: Entry fee = C × A × 0.00035 (for taker)
- G: Exit fee = C × B × 0.00035 (for taker)
- H: Funding cost = C × average price × hourly rate × hours held
- I: Net PnL = E - F - G - H
Use this template for every trade and you will have an accurate record of your actual performance on Hyperliquid, separated from the noise of open position fluctuations.
Start Trading on Hyperliquid Today
Use referral code HOLYGRAIL for 4% off all taker fees on your first $25M trading volume — that means every trade you calculate PnL for costs less
Trade on Hyperliquid →