How Is PnL Calculated for Perpetual Positions?
What Is PnL?โ
PnL stands for profit and loss. On an open perpetual position, it shows how much the position has gained or lost so far. This is unrealized PnL: it changes with the market price and only becomes realized when you close or reduce the position.
Gem Wallet shows PnL as a dollar amount and a percentage on:
- The Positions list.
- The position's details.
- The confirmation screen when you close a position.
PnL in Dollarsโ
The dollar PnL is the difference between the position's current value and its value at the entry price:
- Long: PnL = Size ร (Current Price โ Entry Price)
- Short: PnL = Size ร (Entry Price โ Current Price)
Perpetual values in Gem Wallet are always shown in US dollars, even if you chose a different currency in Settings, because the collateral is USDC.
PnL Percentโ
The PnL percent is the return on the margin the position opened with:
PnL % = PnL รท Opening Margin
Opening Margin = Entry Value รท Leverage
Because the position is leveraged, the PnL percent moves faster than the market price. For example:
| Position | Price move | PnL % |
|---|---|---|
| Long 5x | Price rises 10% | +50% |
| Long 5x | Price falls 10% | โ50% |
| Short 10x | Price falls 3% | +30% |
| Short 10x | Price rises 3% | โ30% |
This matches ROE (return on equity) on Hyperliquid, and the percentages you set for Take Profit and Stop Loss in Auto Close.
Earlier versions of Gem Wallet divided the PnL by the margin currently in use, which grows and shrinks with the PnL. That made gains read smaller and losses larger than on Hyperliquid. Update to the latest version to see the same percentage as Hyperliquid.
PnL, Margin, and Fundingโ
| Row on the position | What it shows |
|---|---|
| PnL | Unrealized gain or loss, with the percent of the opening margin |
| Margin | The margin currently in use, which changes with the PnL |
| Funding Payments | Funding paid or received while the position is open, shown separately from PnL. A payment you made appears as a negative cost |
| Liquidation Price | The price at which the position would be liquidated |
The PnL percent always uses the opening margin, while the Margin row, the maximum you can reduce, and the full-close check use the margin currently in use.
Funding is not part of the PnL figure. See What is Funding?.
PnL When You Closeโ
When you tap Close, the confirmation screen shows the expected PnL at the current price. The final realized PnL can differ slightly, because orders are priced with 2% slippage so they fill while the price moves, and the fill price is set by the market.