Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Entry Price & PnL

Your entry price is the reference point for every profit-and-loss number you see. This page explains how it's calculated, how it changes as you trade, and how unrealized and realized PnL follow from it.

Entry price

The entry price is the volume-weighted average price at which your current position was opened or added to:

Entry Price = ∑(Fill Price × Fill Size) ÷ Total Position Size

How it changes depends on what your trade does to the position:

ActionEffect on entry priceExample
OpenSet to the fill priceBuy 1 BTC @ 50,000 → entry = 50,000
Add (same direction)Recalculated as the weighted averageHold 1 BTC @ 50,000, buy 1 BTC @ 51,000 → entry = 50,500
Reduce (partial close)Unchanged — only realized PnL is bookedHold 2 BTC @ 50,500, sell 1 BTC → entry stays 50,500
Flip (reverse direction)Old side closes; the remainder opens fresh at the crossing fill priceHold 1 BTC long @ 50,000, sell 3 BTC → close long, open 2 BTC short at the new fill price

Entry price resets to zero once the position is fully closed.

Unrealized PnL

While a position is open, it's marked continuously against the mark price — so your unrealized PnL updates in real time:

  • Long — Unrealized PnL = (Mark Price − Entry Price) × Position Size
  • Short — Unrealized PnL = (Entry Price − Mark Price) × Position Size

This is the number that feeds your margin and liquidation calculations — not the last traded price.

Example. You hold 2 BTC long at an entry of 50,500. Mark price is 52,000:

Unrealized PnL = (52,000 − 50,500) × 2 = +3,000 USDC

Realized PnL

Realized PnL is locked in whenever you reduce or close a position, priced at the exit fill:

  • Long — Realized PnL = (Exit Price − Entry Price) × Closed Size
  • Short — Realized PnL = (Entry Price − Exit Price) × Closed Size

Costs are then applied to get what actually hits your balance:

Net PnL = Realized PnL − Trading Fees − Funding Paid

See Fees & Discounts for trading fees and Funding for funding payments.

Example. From the position above, you sell 1 BTC at 52,000:

Realized PnL = (52,000 − 50,500) × 1 = +1,500 USDC

Your remaining position is 1 BTC long, still at an entry price of 50,500.