Entry Price, Unrealized PnL, and Realized PnL on Hyperliquid
Entry price summarizes the cost basis of an open position, unrealized PnL marks that open exposure, and realized PnL records value crystallized through closes and other settled flows.
PnL on a leveraged trading account has multiple layers. Entry price describes the weighted cost basis of the position that remains open. Unrealized PnL estimates the gain or loss on that open exposure using the protocol's marking convention. Realized PnL records value that has been crystallized by reducing or closing exposure, with fees and funding tracked as separate economic flows where applicable.
Entry price is a state variable, not your first fill
If you build a position through several fills at different prices, the displayed entry price reflects the remaining position's cost basis rather than simply the price of the first trade. Reductions can also change how realized PnL is separated from the cost basis that remains.
This matters when reconciling a bot. Comparing the exchange entry price against one local fill is insufficient; the local system needs the full fill history or current authoritative position state.
Unrealized PnL depends on a reference price
An open position is not settled profit simply because the last trade moved in your favor. Hyperliquid uses its marking framework for risk and unrealized PnL calculations. That reference can differ from the last traded price.
For a linear perp, intuition is straightforward: long PnL rises as the marking price rises above entry; short PnL rises as it falls below entry. Position size determines the dollar sensitivity.
Realized trading PnL is not total strategy return
Closing a profitable position creates realized trading PnL, but a complete strategy return also includes maker or taker fees, builder fees if any, funding payments or receipts, borrowing interest where relevant, and gas for HyperEVM interactions.
A carry strategy can intentionally realize little directional PnL while earning funding. A market maker can realize spread capture while paying inventory and adverse-selection costs. “PnL” should therefore be defined before it is used as a performance metric.
Reconciliation for serious users
Store fills, fees, funding, transfers, and position snapshots independently. Reconcile exchange state against local state at startup and after connectivity interruptions. If the numbers disagree, treat Hyperliquid's current account state and fill history as the source to investigate rather than continuing to trade on stale assumptions.