Profit/Loss & Position Marking


Profit/Loss
Funding Payments
The funding rate is accrued continuously on the position size, and paid to/from the margin account in collateral currency at spot. Funding payments are realized when a trader modifies her position size, i.e. by performing an opening or closing trade.
Opening Trades
Opening a position or increasing the size of an existing position:
Locked-in-Value += Index Price * Trade Amount
Cash in margin account += ((Execution Price - Index Price) * Trade Amount
- Fee rate * |Trade Amount| * Index Price) / Collateral spot price
- Accumulated funding since last trade
Closing Trades
Closing or reducing the size of an existing position:
Locked-in-Value += Average Entry Price * Trade Amount
where
Average Entry Price = |Locked-in-Value| / |Position size|
Cash in margin account += ((Execution Price - Index Price) * Trade Amount
- Fee rate * |Trade Amount| * Index Price) / Collateral spot price
- Accumulated funding since last trade
Position Marking
The mark price determines Margin Account calculations and Liquidations.
Unrealized PnL
Current profit and loss of a given open position, in collateral currency:
Unrealized PnL = (Mark Price * Position Size - Locked-in-Value) / Collateral spot price
- Unpaid accumulated funding
Margin Balance
Current value of margin account including unrealized PnL, in collateral currency:
Margin Balance = Cash in margin account + Unrealized PnL
Leverage
Ratio between the position value at mark price in collateral currency and margin balance:
Leverage = (|Position size| * Mark Price / Collateral spot price) / Margin Balance
Margin Rate
Inverse of position leverage:
Margin Rate = 1 / Leverage
Last updated