🎰

# Supply & Interest Rate Calculations

When users supply or borrow assets on PsyLend, they affect interest rates. Lenders (users who supply) are incentivized with a Supply APY, which is derived from the Interest APY for Borrowers. When more capital becomes available for lending, rates go down, and vice-versa, when a larger portion of the capital available is borrowed.
Note that all loans have a variable rate: your interest will change dynamically as other users borrow or supply funds.

### Interest Rate Calculations

Interest rates are calculated dynamically, and interest is compounded continuously based on the utilization ratio of an asset which the user has deposited or borrowed from. Utilization is defined as the total borrow divided by total supply of the asset in the lending market.
Utilization Example - SOL Lending Market
• Total SOL Supplied = 10000
• Total SOL Borrowed = 2000
• Utilization = 2000/10000 = 20%
This utilization ratio drives the interest rate for borrowers and lenders, and is defined along an interest rate curve. As the utilization rate increases, the interest rate also increases to reflect the supply and demand forces in the market. PsyLend has adopted a three segment interest rate curve, to provide more flexibility to control interest rates.
A three segment curve can be imagined as straight lines connecting the following points key points, which are defined as protocol parameters for each lending market:
Example Parameters For A Lending Market
 ​ Utilization Ratio Interest Rate Starting Point 0 0 First Point 50 8 Second point 75 80 Last point 100 100
The interest rate curve moves linearly between the points above. For example, if the utilization ratio is 20%, we are between points 0 and 50. In this case, the interest rate is:
• 0% + 20/50 * (8-0)% = 3.2%.
If the utilization ratio moves to 80%, we are between points 75 and 100. The interest rate is the starting rate for the range, plus how far along we are within the range:
• 80% + (80-75)/(100-75) * (100%-80%) = 84%

### Supply Rates

Users who supply assets into pools are rewarded with the interest rate the borrowers are paying minus any fees. The total interest rate paid is divided proportionally to all suppliers based on their percentage of the supplied assets.
Interest rates are paid out in the same asset that the user has supplied into the lending market. For example, a user that lends out SOL will be paid interest in SOL. Lenders will typically collect interest only when closing their lending position: interest earned while the position is open is automatically compounded.