SeahorseFi
  • 🌊Introduction
    • Introduction to SeahorseFi.xyz
    • Diagrammatic Representation
  • Protocol
    • Interest Rates
      • Interest Rate Model
      • Get Supply Rate
      • Get Borrow Rate
      • Get Utilization
      • Variable Interest Rates
    • Risk Management
    • Collaterization Model
    • Liquidation
      • Reserves
    • Contracts
    • Reserve Factor
  • ⚖️Governance
    • Governance
    • Protocol Fees
    • Roadmap
    • Treasury
    • Treasury Management
  • Tokenomics
    • Token Distribution
  • Legal
    • Terms & Conditions
Powered by GitBook
On this page
  1. Protocol
  2. Interest Rates

Get Supply Rate

Get Supply Rate

This function returns the per second supply rate as the decimal representation of a percentage scaled up by 10 ^ 18. The formula for producing the supply rate is:

## If the Utilization is less than or equal to the Kink parameter

SupplyRate = supplyPerSecondInterestRateBase + supplyPerSecondInterestRateSlopeLow * utilization

## Else

SupplyRate = supplyPerSecondInterestRateBase + supplyPerSecondInterestRateSlopeLow * supplyKink + supplyPerSecondInterestRateSlopeHigh * (utilization - supplyKink)

To calculate the supply APR as a percentage, pass the current utilization to this function, and divide the result by 10 ^ 18 and multiply by the approximate number of seconds in one year and scale up by 100.

Seconds Per Year = 60 * 60 * 24 * 365
Utilization = getUtilization()
Supply Rate = getSupplyRate(Utilization)
Supply APR = Supply Rate / (10 ^ 18) * Seconds Per Year * 100

  • utilization: The utilization at which to calculate the rate.

  • RETURNS: The per second supply rate as the decimal representation of a percentage scaled up by 10 ^ 18. E.g. 317100000 indicates, roughly, a 1% APR.

PreviousInterest Rate ModelNextGet Borrow Rate

Last updated 1 year ago