Skip to main content
Phoenix derives entry price from the open position’s base size and virtual quote position. For an open position: entry price=virtual quote lot positionbase lot position\text{entry price} = \frac{\left|\text{virtual quote lot position}\right|} {\left|\text{base lot position}\right|} If base_lot_position is zero, the position has no active entry price.

When entry price changes

Entry price changes when a fill increases exposure.
  • if you are flat or long and buy more, Phoenix recalculates the long entry price
  • if you are flat or short and sell more, Phoenix recalculates the short entry price
  • maker, taker, and spline fills follow the same accounting rules
Reducing a position does not change the remaining entry price. It realizes PnL on the closed portion and preserves the average basis for the open remainder. A full close removes the entry price. A flip through zero creates a new entry price for the residual position.

PnL

Unrealized PnL is based on mark price versus entry price: unrealized PnL=position size×(mark priceentry price)\text{unrealized PnL} = \text{position size} \times \left(\text{mark price} - \text{entry price}\right)
  • long positions gain when mark price rises
  • short positions gain when mark price falls
Realized PnL is created when a fill reduces, closes, or flips an existing position.

What does not change entry price

The following do not change entry price by themselves:
  • placing a resting limit order
  • funding settlement
  • trading fees
  • builder fees
Funding and fees affect collateral separately. They are not included in virtual_quote_lot_position. If an opposite-side limit order rests, entry price is unchanged. If it executes, the filled portion follows the normal fill rules above.

See also