Comment on page
🏦

# Lending Pool

### Interest models & numbers for different types of deposited assets

• Stayking Protocol's lending pool interest model uses Alpaca Finance's Triple Slope Model, a proven and widely used model in the De-Fi market.
• The TripleSlopeModel is characterized by a structure where the x-axis is the utilization rate value of the lending pool, ranging from 0 to 100%, and the y-axis is the interest rate on the lending pool loan.
• The constant values of m, b, which are calculated based on the x-axis value of the lending pool utilization rate, are calculated through the first-order function
$y = m*x + b$
. Utilization
Min Interest Rate
Max Interest Rate
m
b
0 - 60%
0
20
0.333
0
60 - 90%
20
20
0
0.2
90 - 100%
20
40
2
-1.6
• You can define the loan interest formula and the interest formula that goes to the actual lender as below.
$Interest(Loan)= m*UtilizationRate+b$
$Interest(Deposit)=Interest(Loan)*UtiliztionRate*(1-PerformanceFee)$

### Ex. How Stayking Protocol Interest Calculation Methods

When a staker creates a leveraged staking position, they will be charged interest on a block-by-block basis through that lending pool's interest model. It depending on which part of the lending pool they borrowed the asset from.
• Currently, the Staying Protocol is generating a block every 5 seconds of block time. Calculated in years, it is generating a total of 6,307,200 blocks.
• At this point, we use the formula above to find the loan interest based on the utilization rate, and then calculate the loan interest due on a block-by-block basis to ensure that the stakers pay interest on what they have borrowed.
$BlockPerInterest=BorrowingInterest/6307200$
• Based on the calculated per-block lending interest, protocol fees are deducted and given to stakers, while the per-block deposit interest received by actual lenders is calculated and reflected in the ExchangeRate, which is managed per lending pool. - The actual amount of tokens deposited into the lending pool will be higher than the amount calculated by the Exchange rate because it only reflects the exchange rate, excluding protocol fees. - The amount of tokens in the lending pool may be higher than the amount calculated by the Exchange rate because lenders are paid based on utilization based on the amount of interest paid on the loan.
• It's important to note that interest is calculated in the form of compounding, not a single amount. - This is because every epoch, the user unstakes and pays back the interest after the unbonding period, which means that every block adds interest to the debt asset unless the debt is repaid. - Therefore, it is important to know that if the interest based on utilization in the TripleSlopeModel is a value of 50%, it is actually 64.8% due to the compounding calculation.
• Let's use the following assumptions to see what kind of return a renderer can expect to earn by calculating principal and interest based on the length of time they've been depositing.
• Assumptions TripleSlopeModel numbers are the same 50% utilization at token deposit ( 5000 / 10000 ) 10% Protocol Fee Tx Gas Fee is not considered
• Problem If you deposit 1,000 tokens and withdraw them exactly 1 day later under the above assumptions, what is the expected interest income?
• Answer Number of blocks generated per day = 606024/5 = 17,280 blocks
50% interest > 64.8% compounded interest
1 day LI = ((0.648*0.333 + 0) / 6,307,200) * 17,280 = 0.000591
1-day loan interest settlement (total amount of interest payable by borrowers)
0.000591 * 5,000 → 2.955 Token
1 day LDI = 0.000591 * 0.648 * (1 - 0.1) = 0.000344
1-day deposit interest minus loan interest equals total stake
0.000344 * 5,000 → 1.72 Token
• Conclusion You will get back 1/5 stake + 1.72 token interest / 1 day = 1,000.344 tokens.

### Collateral EVMOS + Lending Pool's EVMOS

Set the TripleSlopeModel value for each token lending pool based on the expected return on APY based on the leverage multiplier per token
2023.06
APY x1.0
APY x1.5
APY x2.0
APY x2.5
EVMOS (/w Fee)
47.35%
78.86%
117.10%
163.51% $Interest(Loan)= m*UtilizationRate+b$
Utilization
Min Interest Rate
Max Interest Rate
m
b
0 - 60%
0
10
0.167
0
60 - 80%
10
20
0.51
-0.206
80 - 100%
20
150
6.5
-5