diff --git a/src/contracts/misc/GhoAaveSteward.sol b/src/contracts/misc/GhoAaveSteward.sol index 2a54251f..6083a430 100644 --- a/src/contracts/misc/GhoAaveSteward.sol +++ b/src/contracts/misc/GhoAaveSteward.sol @@ -24,9 +24,6 @@ contract GhoAaveSteward is RiskCouncilControlled, IGhoAaveSteward { using ReserveConfiguration for DataTypes.ReserveConfigurationMap; using Address for address; - /// @inheritdoc IGhoAaveSteward - uint256 public constant GHO_BORROW_RATE_CHANGE_MAX = 0.05e4; // 5.00% - /// @inheritdoc IGhoAaveSteward uint256 public constant GHO_BORROW_RATE_MAX = 0.25e4; // 25.00% diff --git a/src/contracts/misc/interfaces/IGhoAaveSteward.sol b/src/contracts/misc/interfaces/IGhoAaveSteward.sol index 6f64b27a..038b39a2 100644 --- a/src/contracts/misc/interfaces/IGhoAaveSteward.sol +++ b/src/contracts/misc/interfaces/IGhoAaveSteward.sol @@ -44,7 +44,7 @@ interface IGhoAaveSteward { /** * @notice Updates the borrow rate of GHO, only if: * - respects `MINIMUM_DELAY`, the minimum time delay between updates - * - the update changes up to `GHO_BORROW_RATE_CHANGE_MAX` upwards or downwards + * - the update changes up to 5% upwards or downwards * - the update is lower than `GHO_BORROW_RATE_MAX` * @dev Only callable by Risk Council * @param optimalUsageRatio The new optimal usage ratio @@ -95,12 +95,6 @@ interface IGhoAaveSteward { */ function getGhoTimelocks() external view returns (GhoDebounce memory); - /** - * @notice Returns the maximum increase/decrease for GHO borrow rate updates. - * @return The maximum increase change for borrow rate updates in ray (e.g. 0.010e27 results in 1.00%) - */ - function GHO_BORROW_RATE_CHANGE_MAX() external view returns (uint256); - /** * @notice Returns maximum value that can be assigned to GHO borrow rate. * @return The maximum value that can be assigned to GHO borrow rate in ray (e.g. 0.01e27 results in 1.0%) diff --git a/src/test/TestGhoAaveSteward.t.sol b/src/test/TestGhoAaveSteward.t.sol index 8b643294..80c42daf 100644 --- a/src/test/TestGhoAaveSteward.t.sol +++ b/src/test/TestGhoAaveSteward.t.sol @@ -2,6 +2,7 @@ pragma solidity ^0.8.0; import './TestGhoBase.t.sol'; +import {Constants} from './helpers/Constants.sol'; import {IGhoAaveSteward} from '../contracts/misc/interfaces/IGhoAaveSteward.sol'; import {IDefaultInterestRateStrategyV2} from '../contracts/misc/deps/Dependencies.sol'; import {DefaultReserveInterestRateStrategyV2} from '../contracts/misc/deps/Dependencies.sol'; @@ -292,7 +293,7 @@ contract TestGhoAaveSteward is TestGhoBase { function testUpdateGhoBorrowRateMaxIncrement() public { uint256 oldBorrowRate = _getGhoBorrowRate(); - uint256 newBorrowRate = oldBorrowRate + GHO_AAVE_STEWARD.GHO_BORROW_RATE_CHANGE_MAX(); + uint256 newBorrowRate = oldBorrowRate + GHO_BORROW_RATE_CHANGE_MAX; vm.prank(RISK_COUNCIL); GHO_AAVE_STEWARD.updateGhoBorrowRate( defaultRateParams.optimalUsageRatio, @@ -324,14 +325,14 @@ contract TestGhoAaveSteward is TestGhoBase { // set a high borrow rate GHO_AAVE_STEWARD.updateGhoBorrowRate( defaultRateParams.optimalUsageRatio, - _getGhoBorrowRate() + GHO_AAVE_STEWARD.GHO_BORROW_RATE_CHANGE_MAX(), + _getGhoBorrowRate() + GHO_BORROW_RATE_CHANGE_MAX, defaultRateParams.variableRateSlope1, defaultRateParams.variableRateSlope2 ); vm.warp(block.timestamp + GHO_AAVE_STEWARD.MINIMUM_DELAY() + 1); uint256 oldBorrowRate = _getGhoBorrowRate(); - uint256 newBorrowRate = oldBorrowRate - GHO_AAVE_STEWARD.GHO_BORROW_RATE_CHANGE_MAX(); + uint256 newBorrowRate = oldBorrowRate - GHO_BORROW_RATE_CHANGE_MAX; GHO_AAVE_STEWARD.updateGhoBorrowRate( defaultRateParams.optimalUsageRatio, newBorrowRate, @@ -448,7 +449,7 @@ contract TestGhoAaveSteward is TestGhoBase { function testRevertUpdateGhoBorrowRateIfMaxExceededUpwards() public { uint256 oldBorrowRate = _getGhoBorrowRate(); - uint256 newBorrowRate = oldBorrowRate + GHO_AAVE_STEWARD.GHO_BORROW_RATE_CHANGE_MAX() + 1; + uint256 newBorrowRate = oldBorrowRate + GHO_BORROW_RATE_CHANGE_MAX + 1; vm.prank(RISK_COUNCIL); vm.expectRevert('INVALID_BORROW_RATE_UPDATE'); GHO_AAVE_STEWARD.updateGhoBorrowRate( @@ -465,14 +466,14 @@ contract TestGhoAaveSteward is TestGhoBase { // set a high borrow rate GHO_AAVE_STEWARD.updateGhoBorrowRate( defaultRateParams.optimalUsageRatio, - _getGhoBorrowRate() + GHO_AAVE_STEWARD.GHO_BORROW_RATE_CHANGE_MAX(), + _getGhoBorrowRate() + GHO_BORROW_RATE_CHANGE_MAX, defaultRateParams.variableRateSlope1, defaultRateParams.variableRateSlope2 ); vm.warp(block.timestamp + GHO_AAVE_STEWARD.MINIMUM_DELAY() + 1); uint256 oldBorrowRate = _getGhoBorrowRate(); - uint256 newBorrowRate = oldBorrowRate - GHO_AAVE_STEWARD.GHO_BORROW_RATE_CHANGE_MAX() - 1; + uint256 newBorrowRate = oldBorrowRate - GHO_BORROW_RATE_CHANGE_MAX - 1; vm.expectRevert('INVALID_BORROW_RATE_UPDATE'); GHO_AAVE_STEWARD.updateGhoBorrowRate( defaultRateParams.optimalUsageRatio, diff --git a/src/test/helpers/Constants.sol b/src/test/helpers/Constants.sol index 79ff304d..66feb547 100644 --- a/src/test/helpers/Constants.sol +++ b/src/test/helpers/Constants.sol @@ -55,7 +55,7 @@ contract Constants { uint40 constant STEWARD_LIFESPAN = 90 days; // Gho Stewards - uint256 constant GHO_BORROW_RATE_CHANGE_MAX = 0.0500e27; + uint256 constant GHO_BORROW_RATE_CHANGE_MAX = 0.05e4; uint256 constant GSM_FEE_RATE_CHANGE_MAX = 0.0050e4; uint256 constant GHO_BORROW_RATE_MAX = 0.2500e27; uint256 constant MINIMUM_DELAY_V2 = 2 days;