Rho Protocol Documentation
BlogApply for BetaETH Sepolia faucet
  • ๐ŸŒŸ Getting started
    • ๐Ÿ“„ Overview
    • ๐Ÿ’ก Why go with Rho?
    • ๐ŸŽฏ Key use cases
    • ๐Ÿ›ก๏ธ Safety and dependability
    • ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Who does Rho Protocol benefit?
  • ๐Ÿ“‹ PRODUCT GUIDE
    • ๐Ÿ”ง Product basics
      • ๐Ÿ“ˆ PnL mechanics: How to profit with Rho
      • ๐Ÿ“‰ DV01: Fixed income's delta
    • ๐Ÿ’น Margin and leverage on Rho
      • ๐Ÿง  Is 50x leverage high for a rates trade?
    • ๐Ÿ“… Maturity selection in interest rate futures
    • ๐Ÿค– Automated market maker (AMM) model
    • ๐Ÿ’ผ Leveraging interest rate futures at Rho Protocol
    • ๐Ÿฆ Rho Liquidity Vault
    • โ—Risks
  • ๐Ÿš€ How to trade on Rho
    • ๐Ÿ“– New user guide: Start here
    • ๐Ÿ’ฐ Depositing collateral
      • ๐Ÿ”— Cross-chain deposits
      • ๐Ÿงช Requesting testnet assets
    • ๐Ÿ“Š Dashboard overview
    • โšก Executing your first trade
    • ๐Ÿ”€ Switching environments
    • ๐Ÿ”™ Review and adjust
  • ๐Ÿ—‚๏ธ Trading products: Technical specifications
    • ๐Ÿ‘‰ Rho rate futures
    • ๐Ÿ”จ Trading mechanisms and models
    • ๐Ÿงฎ P&L Calculation
    • ๐Ÿงพ Fees Structure Overview
      • Liquidity Provider (LP) Fees
      • Protocol fees
      • Time to Maturity
      • Price Impact and Variable LP Fee
      • Summary: Total Fee Calculation
      • Example 1: 31 Days to Maturity
      • Example 2: 1 Day to Maturity
    • ๐Ÿ›ก๏ธ Risk management and margin details
  • ๐Ÿ—๏ธ Practical applications and use cases
    • ๐ŸŒณ Hedging against interest rate fluctuations
    • ๐Ÿ’ต Opportunities to capitalize
    • ๐ŸŽฏ Arbitrage strategies
    • ๐Ÿ’ธ Income generation through enhanced yield strategies
    • ๐ŸŒฑ Portfolio diversification
  • โ‰๏ธ Frequently Asked Questions
    • ๐Ÿ“ฅ For Vaults depositors
    • ๐Ÿง How and why should I begin trading IRDs on Rho Protocol?
    • ๐Ÿ’ผ What digital wallets does Rho Protocol support?
    • ๐Ÿ”ง How can I effectively manage my collateral at Rho Protocol?
    • ๐Ÿšจ What can I do to prevent being liquidated?
  • ๐Ÿ› ๏ธ Troubleshooting
    • ๐Ÿ”— Connecting wallets
    • โŒ Failed transactions / trades
    • ๐Ÿ”Ž Viewing transactions
    • ๐Ÿ“ž Contact support
  • ๐Ÿ‘จโ€๐Ÿ’ป Developer docs
    • ๐Ÿ“„ Contracts overview
      • ๐Ÿ—ƒ๏ธ Types, structs and enums
      • ๐Ÿ“ก Router contract
      • ๐Ÿ’ฌ Quoter contract
      • ๐Ÿ‘“ ViewDataProvider
    • ๐Ÿ’ป Rho SDK
      • ๐Ÿ“š Technical Reference
  • ๐Ÿ”ง Deployed contracts
    • ๐Ÿงช Testnet addresses
    • ๐Ÿ”‘ Mainnet addresses
Powered by GitBook
On this page
  • Fixed Leg Calculation
  • Floating Leg Calculation
  • P&L Calculation
  1. ๐Ÿ—‚๏ธ Trading products: Technical specifications

๐Ÿงฎ P&L Calculation

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.

Fixed Leg Calculation

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

FVFixedLegi=Notionaliร—(1+Fixedย Rateiร—Tโˆ’t0,i365โˆ—24โˆ—60โˆ—60)\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)FVFixedLegiโ€‹โ€‹=Notionaliโ€‹ร—(1+Fixedย Rateiโ€‹ร—365โˆ—24โˆ—60โˆ—60Tโˆ’t0โ€‹,iโ€‹)

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.

FVFloatingLegi=Notionaliร—(1+FloatingIndex(t)-FloatingIndex(t0,i)+LastFixedRateร—Tโˆ’t365โˆ—24โˆ—60โˆ—60)\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)FVFloatingLegiโ€‹โ€‹=Notionaliโ€‹ร—(1+FloatingIndex(t)-FloatingIndex(t0,i)+LastFixedRateร—365โˆ—24โˆ—60โˆ—60Tโˆ’tโ€‹)

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

P&L Calculation

PnLreceiver=+FVFixedLegโˆ’FVFloatingLeg\text{PnL}_{receiver} =+\text{FV}_{Fixed Leg}-\text{FV}_{Floating Leg}PnLreceiverโ€‹=+FVFixedLegโ€‹โˆ’FVFloatingLegโ€‹
PnLpayer=โˆ’FVFixedLeg+FVFloatingLeg\text{PnL}_{payer} =-\text{FV}_{Fixed Leg}+\text{FV}_{Floating Leg}PnLpayerโ€‹=โˆ’FVFixedLegโ€‹+FVFloatingLegโ€‹
Previous๐Ÿ”จ Trading mechanisms and modelsNext๐Ÿงพ Fees Structure Overview

Last updated 11 months ago