Skip to main content

Protocol Math

Exchange Rate

Each rToken (Rheofi's interest-bearing token) has an exchange rate that determines how many underlying tokens one rToken is worth. The exchange rate increases over time as interest accrues:

exchangeRate=totalCash+totalBorrowstotalReservestotalSupply of rTokens\text{exchangeRate} = \frac{\text{totalCash} + \text{totalBorrows} - \text{totalReserves}}{\text{totalSupply of rTokens}}

When you supply assets, you receive rTokens based on the current exchange rate. When you redeem, you receive more underlying tokens than you originally deposited, reflecting the interest earned.

Utilization Rate

The utilization rate measures how much of the supplied liquidity is currently being borrowed:

U=totalBorrowstotalCash+totalBorrowstotalReservesU = \frac{\text{totalBorrows}}{\text{totalCash} + \text{totalBorrows} - \text{totalReserves}}

A higher utilization rate indicates greater demand for borrowing and typically leads to higher interest rates.

Interest Rate Calculations

Rheofi uses a jump rate model for most markets. The borrow rate is calculated per block:

  • When UUkinkU \leq U_{\text{kink}}: borrowRate=U×multiplier+baseRate\text{borrowRate} = U \times \text{multiplier} + \text{baseRate}
  • When U>UkinkU > U_{\text{kink}}: borrowRate=Ukink×multiplier+(UUkink)×jumpMultiplier+baseRate\text{borrowRate} = U_{\text{kink}} \times \text{multiplier} + (U - U_{\text{kink}}) \times \text{jumpMultiplier} + \text{baseRate}

The supply rate is derived from the borrow rate:

supplyRate=U×borrowRate×(1reserveFactor)\text{supplyRate} = U \times \text{borrowRate} \times (1 - \text{reserveFactor})

Collateral Factor

Each asset has a collateral factor (between 0 and 1) that determines how much borrowing power it provides:

borrowingPower=(suppliedValuei×collateralFactori)\text{borrowingPower} = \sum (\text{suppliedValue}_i \times \text{collateralFactor}_i)

A collateral factor of 0.75 means that for every 100ofcollateralsupplied,youcanborrowupto100 of collateral supplied, you can borrow up to 75.

Health Factor

The health factor determines whether a position is at risk of liquidation:

healthFactor=(collateralValuei×liquidationThresholdi)totalBorrowValue\text{healthFactor} = \frac{\sum (\text{collateralValue}_i \times \text{liquidationThreshold}_i)}{\text{totalBorrowValue}}

A health factor below 1 means the position is under-collateralized and eligible for liquidation. Users should maintain a health factor well above 1 to provide a safety buffer against price volatility.