entry_price = abs(virtual_quote_lot_position) / abs(base_lot_position)
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
PnL
Unrealized PnL is based on mark price versus entry price:unrealized_pnl = position_size * (mark_price - entry_price)
- long positions gain when mark price rises
- short positions gain when mark price falls
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
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.