# ๐งฎ P&L Calculation

Last updated

Last updated

In Rho Protocol, Profit and Loss (P&L) calculations for future contracts are executed using the Mark-to-Market (MTM) method. This approach relies on the last market-traded fixed rate for dynamic and immediate margin adjustment, providing a real-time snapshot of each position's profitability.

Rho Futures have two components: a fixed leg and a floating leg. The P&L is the difference between both legs. Below is the calculation of the P&L step by step.

The future value of the fixed leg at settlement is determined using the formula:

$\text{FV}_{Fixed Leg_i} =\text{Notional}_{i}\times\left(1+\text{Fixed Rate}_{i} \times \frac{T-t_0,i}{365*24*60*60} \right)$

Here, *T* is the contract's maturity date, *i* represents individual trades and *t0* is the trade date. Time is measured in seconds.

Floating Leg Calculation

For the floating leg, we use the funding rates accumulated from the time of the trade until maturity. We store the accumulated interest rate in the floating index as a variable. The difference from the Floating Index at two timestamps represents the floating interest rate calculated over the period.

As the floating rate from the moment of evaluation until maturity is unknown, we use the rate from the futures to Mark- to-Mark the floating leg value.

The value of the floating leg of a trade i is calculated as follows:

Here, the Floating Rate Index at *t0 *and *t *is used to factor in the accrued value over time. *i *represents individual trades.

$\text{FV}_{Floating Leg_i} =\text{Notional}_i \times\left(\text{1+FloatingIndex(t)-FloatingIndex(t0,i)+LastFixedRate} \times \frac{T-t}{365*24*60*60} \right)$

The Last_Fixed_Rate assures a mark-to-market dynamic calculation.

P&L Calculation

$\text{PnL}_{receiver} =+\text{FV}_{Fixed Leg}-\text{FV}_{Floating Leg}$

$\text{PnL}_{payer} =-\text{FV}_{Fixed Leg}+\text{FV}_{Floating Leg}$