Honey Finance
Try nowForumBlogFeedback
  • 👋Welcome to Honey
  • 🎓Learn
    • DeFi lending
    • Risks
  • Lending protocol
    • Overview
    • Borrowing
      • Bulk loan
    • Lending
    • Fees
    • Liquidations
    • Lending pool admins
      • Pool creation
    • Interest Rates
      • Protocol math (Solana)
        • Low risk model
        • Default risk model
        • High risk model
      • Protocol math (Ethereum)
    • Risk
      • Security
      • Risk Methodology
      • Protocol risks
  • Honey P2P
    • Overview
    • Borrowing
    • Lending
    • Refinancing
    • Protocol fees
  • Tokenomics
    • HONEY
    • veHONEY
    • pHONEY (old)
    • Genesis NFTs
      • Liquidity Mining
      • Alpha program
      • NFT vs Token benefits
  • About Us
    • Whitepaper
    • Developers
    • Roadmap
    • Branding
  • Tutorials
    • Tutorials
      • Create a market
      • Create a loan
      • Repay a loan
      • (OLD) pHONEY conversion tutorial
      • (OLD) pHONEY locking tutorial
    • Support
  • FAQ
    • FAQ
      • Farms FAQ
      • Genesis Bee NFT FAQ
      • Peer-to-Peer FAQ
      • Lending & Borrowing FAQ
  • LINKS
    • Early Beta
    • Code
    • SDK
    • Resources
    • Discord
    • Website
    • Farm addresses
  • Legal
    • FAQ Legal Questions
    • Terms and Conditions
    • NFT sale disclaimer
Powered by GitBook
On this page
  1. Lending protocol
  2. Interest Rates

Protocol math (Solana)

Solana's programs use linear functions to derive interest rates. Thus, all of the interest rates on the Solana lending programs can be expressed as:

y = ax + b

Where y is the interest rate for a given utilisation rate x.

Variable a is the slope of the curve, determining how fast or slow interest accrues given a change in utilisation.

// Example of interest calculation when current utilisation is below 1st optimal rate 

interestRate = ((BORROW_RATE_ONE - BASE_BORROW_RATE) / ( OPTIMAL_RATIO_ONE - 0 )) * utilizationRate + (-1*((BORROW_RATE_ONE - BASE_BORROW_RATE) / ( OPTIMAL_RATIO_ONE - 0  )) * 0 + BASE_BORROW_RATE )

/* y = interestRate
 * a = (x2 - x1) / (y2-y1)
 * x = utilizationRate
 * b = -ax + y
 *
 * Meaning that:
 *
 * y = interestRate
 * a = ((BORROW_RATE_ONE - BASE_BORROW_RATE) / ( OPTIMAL_RATIO_ONE - 0 ))
 * x = utilizationRate
 * b = (-1*((BORROW_RATE_ONE - BASE_BORROW_RATE) / ( OPTIMAL_RATIO_ONE - 0  )) * 0 + BASE_BORROW_RATE )
*/ 

Varying risk parameters and collaterals will result in different values for ax + b

// InterestRate.ts
// Parameters used in the default risk model

export const OPTIMAL_RATIO_ONE = 0.4;
export const OPTIMAL_RATIO_TWO = 0.8;
export const BASE_BORROW_RATE = 0.1;
export const BORROW_RATE_ONE = 0.25;
export const BORROW_RATE_TWO = 0.4;
export const BORROW_RATE_THREE = 1.4;
PreviousInterest RatesNextLow risk model

Last updated 2 years ago