Protocol
Position value
The value of a DERP position can be expressed in several ways:
- Mark value is the total value of underlying assets represented by the position at mark price. It is used to calculate funding rates and perform liquidation checks.
- Sale value is the current value of the position, calculated using the current market price at which the position would be closed.
The PnL of a position is the amount that it lost or gained since entry. It can be expressed in different ways depending on the price used for calculation and other considerations:
- Mark PnL, the PnL based on the mark price.
- Sale PnL, the PnL based on the market price at which the position would be closed. It is the technical maximum PnL that can be paid out on position close.
- Real PnL is the amount that will actually be paid out if the position was closed at the moment of its calculation. If the AMM has enough liquidity to cover the Sale PnL and funding payments, it will be equal to the sum of funding accrued by the position and the Sale PnL. Otherwise it will be clamped to available liquidity.
Real value mechanism
The DERP protocol allows for the existence of positions whose PnL cannot be paid out at the moment. The Real PnL of a position is meant as a realization of that requirement - allowing users to close their positions at all times, while not requiring any initial liquidity to open a market.