Fixes PVE013

This commit is contained in:
The3D 2020-10-26 11:18:25 +01:00
parent c5d7bb5e80
commit 14c4b750e1

View File

@ -356,9 +356,10 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
}
/**
* @dev rebalances the stable interest rate of a user if current liquidity rate > user stable rate.
* this is regulated by Aave to ensure that the protocol is not abused, and the user is paying a fair
* rate. Anyone can call this function.
* @dev rebalances the stable interest rate of a user. Users can be rebalanced if the following conditions are satisfied:
* 1. Usage ratio is above 95%
* 2. the current deposit APY is below REBALANCE_UP_THRESHOLD * maxVariableBorrowRate, which means that too much has been
* borrowed at a stable rate and depositors are not earning enough.
* @param asset the address of the reserve
* @param user the address of the user to be rebalanced
**/
@ -373,7 +374,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
uint256 stableBorrowBalance = IERC20(stableDebtToken).balanceOf(user);
//if the utilization rate is below 95%, no rebalances are needed
//if the usage ratio is below 95%, no rebalances are needed
uint256 totalBorrows = stableDebtToken
.totalSupply()
.add(variableDebtToken.totalSupply())