Fixed APY Borrowing/Lending

Fixed Interest Rate Borrowing on Aave

The interest rate will change along with the utilization rate in Aave after borrowing and deposit.

If investors want to borrow crypto with a fixed interest rate, then they need to buy a corresponding amount of Long tokens to 'long' interest rate and lock future borrowing costs.

After buying the corresponding amount of the Long token, the uncertainty of future interest change can be hedged because the total interest amount is locked until maturity. In the following, the mechanism of token purchase and interest amount will be further elaborated.

Required purchased number

If investors want to hedge future interest changes of their borrowing position, they need to buy a specific amount of Long tokens to 'long' interest rate. The number is relevant to leverage level. If the leverage level is higher, then the required purchased number of Long tokens is fewer, and vice versa.

Take Dai borrowing for example. Without leverage, the total borrowing position of 1,000 Dai requires 1,000 Long tokens to hedge the change in interest rate. But if the leverage is 10x, only 1,000/10 = 100 Long tokens are needed.

Required purchased number = Total borrowing number / Leverage level

Fixed interest rate

According to the previous introduction, the price of Long token is calculated by accumulated interest.

The settlement price of Long token can be deduced from nowRatio, the realized interest rate. Similarly, we can use averaged trading price of Long token to calculate the corresponding internet rate markRatio. The difference between the two rates deltaRatiois the amount of interest rate that can be hedged.

nowRatio=nowRateinitialRatenowRatio = \frac{nowRate}{initialRate}
markRatio=longPriceleverage+1markRatio = \frac{longPrice}{leverage}+1
deltaRatio=markRationowRatiodeltaRatio = \frac{markRatio} {nowRatio}

Next, APY can be compounded calculated with the remaining days, which is timeToMaturity .

timeToMaturity=timestampEndtimestampNowtimeToMaturity = timestampEnd - timestampNow
APY=(deltaRatio36586400timeToMaturity1)100%APY = (deltaRatio^{\frac{365 * 86400}{timeToMaturity}}-1)*100\%

* Note that due to the settlement price in IRS is calculated with borrowing interest rate, hence, there are some inevitable errors for lending sides to perfectly hedge against interest rate changes.

Fixed Interest Rate Lending on Aave

If investors want to deposit crypto with a fixed interest rate, then they need to buy a corresponding amount of Short tokens to 'short' interest rate and lock future lending yield. To hedge lending borrowing interest rates, the calculation method of the required purchased amount of Short tokens is basically the same as the fixed borrowing approach.

Required purchased number = Total deposit number / Leverage level

For APY calculation, we only need to replace markRatio calculation method with Short token traded price.

markRatio=1shortPriceleverage+1markRatio = \frac{1-shortPrice}{leverage}+1

Similar to fixed interest borrowing, we can get

APY=(deltaRatio36586400timeToMaturity1)100%APY = (deltaRatio^{\frac{365 * 86400}{timeToMaturity}}-1)*100\%

However, on Aave, the borrow interest rates paid are distributed to the lenders and ecosystem reserve, so the deposit APY is always lower to borrow APY.

As we mentioned in the Price Settlement section, we use the rate for borrowing AAVE.getReserveNormalizedVariableDebt(asset) to calculate the settlement price. To better hedge against lending rates fluctuations, we need to adjust the APY above according to the relation in Aave document. The actual formulas we implemented for the conversion are in here. Note that it's estimation with assumptions. Although it's not an exact solution, It can still be closer to the real lending rate on Aave.

Fixed Interest Rate Lending on Yearn

In yield aggregators like Yearn, the profit value will be gradually accumulated into the yToken. As a consequence, the exchange rate of the yToken will progressively increase, and the concept will be similar to lending. Therefore, we can realize fixed APY lending on Yearn via iGain IRS. Procedures on Yearn are similar to those on Aave on every aspect, except for the borrowing service as it is unavailable on Yearn.

Last updated