mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
refactoring of DefaultReserveInterestRateStrategy to follow the stuileguide
This commit is contained in:
parent
dfe865fc76
commit
da5b6738c1
|
@ -11,7 +11,7 @@ interface IReserveInterestRateStrategy {
|
|||
* @dev returns the base variable borrow rate, in rays
|
||||
*/
|
||||
|
||||
function getBaseVariableBorrowRate() external view returns (uint256);
|
||||
function baseVariableBorrowRate() external view returns (uint256);
|
||||
|
||||
/**
|
||||
* @dev calculates the liquidity, stable, and variable rates depending on the current utilization rate
|
||||
|
|
|
@ -69,23 +69,23 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
|
|||
* @dev accessors
|
||||
*/
|
||||
|
||||
function getVariableRateSlope1() external view returns (uint256) {
|
||||
function variableRateSlope1() external view returns (uint256) {
|
||||
return _variableRateSlope1;
|
||||
}
|
||||
|
||||
function getVariableRateSlope2() external view returns (uint256) {
|
||||
function variableRateSlope2() external view returns (uint256) {
|
||||
return _variableRateSlope2;
|
||||
}
|
||||
|
||||
function getStableRateSlope1() external view returns (uint256) {
|
||||
function stableRateSlope1() external view returns (uint256) {
|
||||
return _stableRateSlope1;
|
||||
}
|
||||
|
||||
function getStableRateSlope2() external view returns (uint256) {
|
||||
function stableRateSlope2() external view returns (uint256) {
|
||||
return _stableRateSlope2;
|
||||
}
|
||||
|
||||
function getBaseVariableBorrowRate() external override view returns (uint256) {
|
||||
function baseVariableBorrowRate() external override view returns (uint256) {
|
||||
return _baseVariableBorrowRate;
|
||||
}
|
||||
|
||||
|
@ -121,7 +121,7 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
|
|||
uint256 currentStableBorrowRate = 0;
|
||||
uint256 currentLiquidityRate = 0;
|
||||
|
||||
uint256 utilizationRate = (totalBorrows == 0 && availableLiquidity == 0)
|
||||
uint256 utilizationRate = totalBorrows == 0
|
||||
? 0
|
||||
: totalBorrows.rayDiv(availableLiquidity.add(totalBorrows));
|
||||
|
||||
|
@ -157,9 +157,7 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
|
|||
)
|
||||
.rayMul(utilizationRate);
|
||||
|
||||
return (currentLiquidityRate,
|
||||
currentStableBorrowRate,
|
||||
currentVariableBorrowRate);
|
||||
return (currentLiquidityRate, currentStableBorrowRate, currentVariableBorrowRate);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user