Fixed APY Borrowing/Lending
Last updated
Last updated
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.
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
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 deltaRatio
is the amount of interest rate that can be hedged.
Next, APY can be compounded calculated with the remaining days, which is timeToMaturity
.
* 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.
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.
Similar to fixed interest borrowing, we can get
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.
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.