Skip to content
← Learn

Realized and Unrealized P&L

A winning close is not always a profitable account. Open positions and transfers have to reconcile too.

An open two-compartment ledger box: settled plain coins in one compartment and a transparent floating stack in the other, visually separating booked gains from changing marked values.

You can close a winning trade and still have a losing account. You can also have a larger account balance without earning a profit. These are accounting questions before they are trading questions.

A useful performance record keeps three things separate: gains already locked in by closing trades, the current value of open positions, and money deposited or withdrawn.

A partial close

Consider a linear contract where one unit gains or loses $1 for each $1 price change. Buy 10 units at $100. When the valuation price reaches $108, the open position has $80 of unrealized PnL:

10 × ($108 − $100) = $80.

Now sell four units at $107. Their realized profit is $28. Six units remain; valued at $108, they have $48 of unrealized profit. Combined gross PnL is $76. The difference from the earlier $80 comes from selling four units a dollar below the valuation price.

If the remaining six eventually sell at $102, they realize another $12. The completed trade has $40 of gross profit. If recorded fees and net funding paid total $7, net profit is $33. Actual fill prices already reflect spread and slippage; do not deduct those estimates a second time.

Unrealized does not mean imaginary

An open gain changes the account’s economic value and may affect margin availability. An open loss can trigger liquidation even though you have not voluntarily closed anything. Realization changes the position’s status; it does not create the preceding price movement.

The valuation price still matters. On Hyperliquid, the mark price is used for unrealized PnL and margin calculations. It can differ from the last trade or the price available for your entire exit. Other venues and instruments use their own conventions.

For a large position, a marked gain is therefore an estimate of value rather than a promise that every unit can be sold at that mark. A reconciliation should identify the mark source, timestamp, quantity and cost basis. If you add to a position, the venue’s average-entry display can change even though your earlier fills remain in the transaction record.

Deposits are not returns

Start with $1,000, deposit $400, and finish with equity of $1,500. With no withdrawals, investment PnL is $100:

Ending equity − starting equity − deposits + withdrawals.

This identity gives dollars earned. A percentage return needs more care because the deposit’s timing changes how much money was exposed.

Suppose $1,000 first grows by 10% to $1,100. You then deposit another $1,000, bringing equity to $2,100. A subsequent 10% loss leaves $1,890. Dollar PnL is negative $110, because more money was invested during the losing period.

The time-weighted return, which separates the two periods at the cash flow, is 1.10 × 0.90 − 1 = −1%. That answers how the sequence of investment returns performed independently of the deposit. A money-weighted return instead incorporates the amount and timing of capital. The GIPS handbook formalizes this distinction for performance reporting.

Why two performance screens disagree

When a strategy page, account screen and chart disagree, first compare their definitions. Are they showing dollars or percentages? Closed trades or total equity? Gross or net results? The same beginning and ending timestamps? Have transfers been removed?

A useful account record can explain the ending equity from starting equity, cash flows and net PnL, while a return series explains the path between them. A closed-trade figure alone cannot explain the account: open positions and transfers still have to reconcile with the ending equity.