Skip to main content

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:

PositionPrice movePnL %
Long 5xPrice rises 10%+50%
Long 5xPrice falls 10%โˆ’50%
Short 10xPrice falls 3%+30%
Short 10xPrice 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.

note

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 positionWhat it shows
PnLUnrealized gain or loss, with the percent of the opening margin
MarginThe margin currently in use, which changes with the PnL
Funding PaymentsFunding paid or received while the position is open, shown separately from PnL. A payment you made appears as a negative cost
Liquidation PriceThe 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.