Implementation of an interest rate strategy with all parameters zeroed.
No, it can't.
reserve.currentVariableBorrowRate
gets used mainly in 2 internal functions of the protocol:
_updateIndexes()
. Once thereserve.currentVariableBorrowRate
on storage gets updated to 0, this will cause a multiplication by 0, makingcumulatedVariableBorrowInterest == 0
, and the variable borrow index to not change. CORRECT.getNormalizedDebt()
. This function returns a new "dynamics" variable debt index, adding the accrued growth since last update, based on time and the variable rate. As rate will be now 0, the effect will be that index will remain the same as before. Used bygetReserveNormalizedVariableDebt()
, that in turn gets used bybalanceOf()
andtotalSupply()
of the variable debt token. The final effect is that balances and supply of variable debt will be multiplied by the last updated index, not causing any growth, as expected. CORRECT.getMaxVariableBorrowRate()
(now returning 0) gets used in the protocol onvalidateRebalanceStableBorrowRate()
. In this particular case, there is no effect because stable rate is not enabled. However, even if stable rate would be active, there would be no practical consequence for the protocol, because this require will always return false (ascurrentLiquidityRate
would be > 0), which would mean no rebalance can be done, but rebalancing is non-logical, as the users will always close their stable rate positions to swap to variable at 0 rate. CORRECT
The effect is the same as with variable debt, no problem happens, apart from the high-level economical impact of allowing an user to borrow at stable rate locking a 0 rate, which should probably be avoided. Furthermore, the first use case (renFIL on Aave v2 Ethereum) doesn't have stable rate mode enabled, so no impact
cp .env.example .env
forge install
make test