🚦
Unrealized PnL
Unrealized PnL is the unrealized amount of the user's profit or loss if closing a position with current prices.
$uPnL =(mP-pP)*S*(±1)$
uPnL – Unrealized PnL mP – Mark price pP – position's open price S – Position size. If the position is long, then the equation is multiplied by +1, if short, then by -1.
Example: Alice has 10,000 USDC on her margin account, and Bob has 6,000 USDC on his margin account. The BTC price is 33,520 USDC. At 15:00 Alice sells 1 BTC futures and Bob buys 1 BTC futures. The collateral for a position in both cases is 10%, or 0.1 BTC or 3,352 USDC.
Suppose the BTC price rises by 5% to 35,200 USDC by 22:00. Alice's uPnL will be -1680 USDC, and Bob's uPnL will be 1,680 USDC. Collateral is still 10% of the price, or 3,520 USDC. uPnL is converted to the margin amount when the trade is closed.