Margin, Leverage & Positions
How is unrealized PnL calculated?
The difference between your entry price and the current mark price, times position size. Longs gain when the mark rises above entry; shorts gain when it falls below.
It updates continuously and feeds the account equity used for margin. It becomes realized when you close.