Price Settlement
Currently, iGain IRS supports Aave and Yearn, and the settlement price of Long tokens will be calculated along with accumulated interests.
The implementation steps are as follows.
For Aave
Fetch the real-time exchange rate while initializing contract:
initialRate = AAVE.getReserveNormalizedVariableDebt(asset)
Fetch real-time exchange rate as the term is expired:
endRate = AAVE.getReserveNormalizedVariableDebt(asset)
With
initialRate
andendRate,
the growth rate of floating interest rate in the periodratio
can be calculated
ratio = (endRate - initialRate) / initialRate
For example, if the ratio on expiry day is 0.04, that means the accumulated borrowing interest rate reaches 4%. With this rate, the settled price of Long token is $0.04 while the price of Short token is $0.96.
To enhance capital efficiency, we can add an appropriate leverage level according to the backtesting history records. As stated above, with 10x leverage, the settled price of Long token will become $0.4 while the Short token will be priced at $0.6.
_bPrice = leverage * ratio
Long token is priced as bPrice
($0 ≤ Long token price ≤ $1, if the settlement price is higher than $1, then calculate with $1), and the calculation is as below.
Settled price of Long token: bPrice = min(_bPrice, 1)
Settled price of Short token:1 - bPrice
How to decide leverage level
The leverage level will affect the capital efficiency and the range of hedgeable interest rates. The higher the leverage level, the better capital efficiency. And the shorter the period, the less the accumulated interest. Hence, we are supposed to set a higher leverage level. The actual leverage will be determined by backtesting data.
With the premise of zero-leverage (10x), the corresponding interest rate is 100% as the Long Token is settled with $1. The system can hedge the future interest rate change from 0% to 100%. If the leverage level is higher, the maximum hedgeable interest will be lower and the actual figure can be deduced from (100/leverage)%. Take 20x leverage for instance. The hedgeable interest range goes up from 0% to 5%, and the capital efficiency thereby increases by 20 times. On the other hand, this strategy limits the range of hedging.
We can investigate the most suitable leverage figures through backtesting the history data on Aave platform. In the period between 22 December 2021 and 9 August 2021, the average monthly borrowing interest rate reached 2.35% (= 0.0235), so 20x leverage will be one of the best choices if the investors expect the Long and Short Tokens are settled with the prices of around $0.5 respectively. That strategy can maximize capital efficiency and minimize the impermanent loss for liquidity providers (LP).
The more the interest accumulates, the higher the settlement price of the Long Token can reach; in contrast, the settlement price of Short Token will be lower in the same situation.
Borrowing interest rate v.s. Lending interest rate
In lending protocol, borrowing interest rate is highly relevant to lending (deposit) interest rate. Meanwhile, the deposit interest rate must be lower than the borrowing interest rate because borrowers pay interest to the lending pool but the utilization rate is less than 100%, and part of the interest belongs to protocol.
Aside from interest incomes, lenders (supply side) can also earn flash loans fee. That mechanism may result in a temporary soar in deposit interest rate. As a result, iGain IRS select borrowing interest rate as settled rate.
Using borrowing interest rates as a settlement index can effectively avoid price manipulations. That also indicates the system cannot fully hedge the future uncertainties in interest rate from lenders' perspective. Therefore, the interest incomes lenders earned may be different from the estimated figure on the interface.
For Yearn:
The process of price settlement for Yearn is almost the same as on Aave; the only difference is the function we used to fetch exchange rate:
Fetch the real-time exchange rate while initializing contract:
initialRate = vault.pricePerShare()
Fetch real-time exchange rate as the term is expired:
endRate = vault.pricePerShare()
With
initialRate
andendRate,
the growth rate of floating interest rate in the periodratio
can be calculated
ratio = (endRate - initialRate) / initialRate
Other steps are basically the same except that there is no borrowing function on Yearn, only lending.
Dynamic Trading Fee
As the time gets closer to the maturity date, the effect of the fee on the annualized interest rate is greater. In order to provide better fixed interest rates for lenders and borrowers, the fee will be reduced over time, linearly decreasing from the initial 3% to 0.3%.
Last updated