From 158e021b90f9556f376b09ffd6814f9ad71b84ad Mon Sep 17 00:00:00 2001 From: CheyenneAtapour Date: Tue, 6 Aug 2024 12:58:51 -0700 Subject: [PATCH] feat: add all 4 params for borrow rate update --- src/contracts/misc/GhoAaveSteward.sol | 95 +++++++--- .../misc/interfaces/IGhoAaveSteward.sol | 40 ++-- src/test/TestGhoAaveSteward.t.sol | 177 +++++++++++++++--- 3 files changed, 254 insertions(+), 58 deletions(-) diff --git a/src/contracts/misc/GhoAaveSteward.sol b/src/contracts/misc/GhoAaveSteward.sol index c1384cf8..e97a2308 100644 --- a/src/contracts/misc/GhoAaveSteward.sol +++ b/src/contracts/misc/GhoAaveSteward.sol @@ -52,6 +52,8 @@ contract GhoAaveSteward is RiskCouncilControlled, IGhoAaveSteward { uint256 internal constant BPS_MAX = 100_00; + Config internal _riskConfig; + GhoDebounce internal _ghoTimelocks; /** @@ -77,7 +79,8 @@ contract GhoAaveSteward is RiskCouncilControlled, IGhoAaveSteward { address engine, address ghoToken, address fixedRateStrategyFactory, - address riskCouncil + address riskCouncil, + Config memory riskConfig ) RiskCouncilControlled(riskCouncil) { require(addressesProvider != address(0), 'INVALID_ADDRESSES_PROVIDER'); require(poolDataProvider != address(0), 'INVALID_DATA_PROVIDER'); @@ -90,15 +93,23 @@ contract GhoAaveSteward is RiskCouncilControlled, IGhoAaveSteward { CONFIG_ENGINE = engine; GHO_TOKEN = ghoToken; FIXED_RATE_STRATEGY_FACTORY = fixedRateStrategyFactory; + _riskConfig = riskConfig; } /// @inheritdoc IGhoAaveSteward function updateGhoBorrowRate( - /* TODO: Add all 4 parameters back */ - uint256 baseVariableBorrowRate + uint256 optimalUsageRatio, + uint256 baseVariableBorrowRate, + uint256 variableRateSlope1, + uint256 variableRateSlope2 ) external onlyRiskCouncil notTimelocked(_ghoTimelocks.ghoBorrowRateLastUpdate) { - _validateRatesUpdate(baseVariableBorrowRate); - _updateRates(baseVariableBorrowRate); + _validateRatesUpdate( + optimalUsageRatio, + baseVariableBorrowRate, + variableRateSlope1, + variableRateSlope2 + ); + _updateRates(optimalUsageRatio, baseVariableBorrowRate, variableRateSlope1, variableRateSlope2); _ghoTimelocks.ghoBorrowRateLastUpdate = uint40(block.timestamp); } @@ -141,6 +152,17 @@ contract GhoAaveSteward is RiskCouncilControlled, IGhoAaveSteward { .setSupplyCap(GHO_TOKEN, newSupplyCap); } + /// @inheritdoc IGhoAaveSteward + function setRiskConfig(Config calldata riskConfig) external onlyRiskCouncil { + _riskConfig = riskConfig; + emit RiskConfigSet(riskConfig); + } + + /// @inheritdoc IGhoAaveSteward + function getRiskConfig() external view returns (Config memory) { + return _riskConfig; + } + /// @inheritdoc IGhoAaveSteward function getGhoTimelocks() external view returns (GhoDebounce memory) { return _ghoTimelocks; @@ -166,22 +188,20 @@ contract GhoAaveSteward is RiskCouncilControlled, IGhoAaveSteward { return from < to ? to - from <= max : from - to <= max; } - function _updateRates(uint256 baseVariableBorrowRate) internal { - ( - uint256 currentOptimalUsageRatio, - , - uint256 currentVariableRateSlope1, - uint256 currentVariableRateSlope2 - ) = _getInterestRatesForAsset(GHO_TOKEN); - + function _updateRates( + uint256 optimalUsageRatio, + uint256 baseVariableBorrowRate, + uint256 variableRateSlope1, + uint256 variableRateSlope2 + ) internal { IEngine.RateStrategyUpdate[] memory ratesUpdate = new IEngine.RateStrategyUpdate[](1); ratesUpdate[0] = IEngine.RateStrategyUpdate({ asset: GHO_TOKEN, params: IEngine.InterestRateInputData({ - optimalUsageRatio: currentOptimalUsageRatio, + optimalUsageRatio: optimalUsageRatio, baseVariableBorrowRate: baseVariableBorrowRate, - variableRateSlope1: currentVariableRateSlope1, - variableRateSlope2: currentVariableRateSlope2 + variableRateSlope1: variableRateSlope1, + variableRateSlope2: variableRateSlope2 }) }); @@ -190,7 +210,12 @@ contract GhoAaveSteward is RiskCouncilControlled, IGhoAaveSteward { ); } - function _validateRatesUpdate(uint256 baseVariableBorrowRate) internal view { + function _validateRatesUpdate( + uint256 optimalUsageRatio, + uint256 baseVariableBorrowRate, + uint256 variableRateSlope1, + uint256 variableRateSlope2 + ) internal view { DataTypes.ReserveData memory ghoReserveData = IPool( IPoolAddressesProvider(POOL_ADDRESSES_PROVIDER).getPool() ).getReserveData(GHO_TOKEN); @@ -200,20 +225,48 @@ contract GhoAaveSteward is RiskCouncilControlled, IGhoAaveSteward { ); ( - uint256 optimalUsageRatio, + uint256 currentOptimalUsageRatio, uint256 currentBaseVariableBorrowRate, - uint256 variableRateSlope1, - uint256 variableRateSlope2 + uint256 currentVariableRateSlope1, + uint256 currentVariableRateSlope2 ) = _getInterestRatesForAsset(GHO_TOKEN); + + require( + _updateWithinAllowedRange( + currentOptimalUsageRatio, + optimalUsageRatio, + _riskConfig.optimalUsageRatio.maxPercentChange, + false + ), + 'INVALID_OPTIMAL_USAGE_RATIO' + ); require( _updateWithinAllowedRange( currentBaseVariableBorrowRate, baseVariableBorrowRate, - 0.05e4, + _riskConfig.baseVariableBorrowRate.maxPercentChange, false ), 'INVALID_BORROW_RATE_UPDATE' ); + require( + _updateWithinAllowedRange( + currentVariableRateSlope1, + variableRateSlope1, + _riskConfig.variableRateSlope1.maxPercentChange, + false + ), + 'INVALID_VARIABLE_RATE_SLOPE1' + ); + require( + _updateWithinAllowedRange( + currentVariableRateSlope2, + variableRateSlope2, + _riskConfig.variableRateSlope2.maxPercentChange, + false + ), + 'INVALID_VARIABLE_RATE_SLOPE2' + ); uint256 maxBorrowRate = IDefaultInterestRateStrategyV2( ghoReserveData.interestRateStrategyAddress diff --git a/src/contracts/misc/interfaces/IGhoAaveSteward.sol b/src/contracts/misc/interfaces/IGhoAaveSteward.sol index eefc22ac..6f7f31e5 100644 --- a/src/contracts/misc/interfaces/IGhoAaveSteward.sol +++ b/src/contracts/misc/interfaces/IGhoAaveSteward.sol @@ -7,6 +7,12 @@ pragma solidity ^0.8.10; * @notice Defines the basic interface of the GhoAaveSteward */ interface IGhoAaveSteward { + /** + * @notice Emitted when the risk configuration for the risk params has been set + * @param riskConfig struct containing the risk configurations + */ + event RiskConfigSet(Config indexed riskConfig); + /** * @notice Struct storing the last update by the steward of each risk param */ @@ -28,18 +34,10 @@ interface IGhoAaveSteward { * @notice Struct storing the risk configuration for all the risk param */ struct Config { - RiskParamConfig ltv; - RiskParamConfig liquidationThreshold; - RiskParamConfig liquidationBonus; - RiskParamConfig supplyCap; - RiskParamConfig borrowCap; - RiskParamConfig debtCeiling; + RiskParamConfig optimalUsageRatio; RiskParamConfig baseVariableBorrowRate; RiskParamConfig variableRateSlope1; RiskParamConfig variableRateSlope2; - RiskParamConfig optimalUsageRatio; - RiskParamConfig priceCapLst; - RiskParamConfig priceCapStable; } /** @@ -48,9 +46,17 @@ interface IGhoAaveSteward { * - the update changes up to `GHO_BORROW_RATE_CHANGE_MAX` upwards or downwards * - the update is lower than `GHO_BORROW_RATE_MAX` * @dev Only callable by Risk Council - * @param newBorrowRate The new variable borrow rate (expressed in ray) (e.g. 0.0150e27 results in 1.50%) + * @param optimalUsageRatio The new optimal usage ratio + * @param baseVariableBorrowRate The new base variable borrow rate + * @param variableRateSlope1 The new variable rate slope 1 + * @param variableRateSlope2 The new variable rate slope 2 */ - function updateGhoBorrowRate(uint256 newBorrowRate) external; + function updateGhoBorrowRate( + uint256 optimalUsageRatio, + uint256 baseVariableBorrowRate, + uint256 variableRateSlope1, + uint256 variableRateSlope2 + ) external; /** * @notice Updates the GHO borrow cap, only if: @@ -70,6 +76,18 @@ interface IGhoAaveSteward { */ function updateGhoSupplyCap(uint256 newSupplyCap) external; + /** + * @notice method called by the Risk Council to set the risk configuration for the risk params + * @param riskConfig struct containing the risk configurations + */ + function setRiskConfig(Config calldata riskConfig) external; + + /** + * @notice method to get the risk configuration set for all the risk params + * @return struct containing the risk configurations + */ + function getRiskConfig() external view returns (Config 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%) diff --git a/src/test/TestGhoAaveSteward.t.sol b/src/test/TestGhoAaveSteward.t.sol index d17a6587..db36883c 100644 --- a/src/test/TestGhoAaveSteward.t.sol +++ b/src/test/TestGhoAaveSteward.t.sol @@ -8,7 +8,34 @@ import {IDefaultInterestRateStrategyV2} from '../contracts/misc/deps/Dependencie contract TestGhoAaveSteward is TestGhoBase { using ReserveConfiguration for DataTypes.ReserveConfigurationMap; + IGhoAaveSteward.RiskParamConfig public defaultRiskParamConfig; + IGhoAaveSteward.Config public riskConfig; + + MockConfigEngine.InterestRateInputData defaultRateParams = + MockConfigEngine.InterestRateInputData({ + optimalUsageRatio: 1_00, + baseVariableBorrowRate: 0.25e4, + variableRateSlope1: 0, + variableRateSlope2: 0 + }); + function setUp() public { + defaultRiskParamConfig = IGhoAaveSteward.RiskParamConfig({ + minDelay: 2 days, + maxPercentChange: 10_00 // 10% + }); + IGhoAaveSteward.RiskParamConfig memory borrowRateConfig = IGhoAaveSteward.RiskParamConfig({ + minDelay: 2 days, + maxPercentChange: 5_00 // 5% + }); + + riskConfig = IGhoAaveSteward.Config({ + optimalUsageRatio: defaultRiskParamConfig, + baseVariableBorrowRate: borrowRateConfig, + variableRateSlope1: defaultRiskParamConfig, + variableRateSlope2: defaultRiskParamConfig + }); + // Deploy Gho Aave Steward MockConfigEngine engine = new MockConfigEngine(address(CONFIGURATOR), address(PROVIDER)); GHO_AAVE_STEWARD = new GhoAaveSteward( @@ -17,7 +44,8 @@ contract TestGhoAaveSteward is TestGhoBase { address(engine), address(GHO_TOKEN), address(FIXED_RATE_STRATEGY_FACTORY), - RISK_COUNCIL + RISK_COUNCIL, + riskConfig ); MockConfigEngine.RateStrategyUpdate[] memory update = new MockConfigEngine.RateStrategyUpdate[]( @@ -57,7 +85,8 @@ contract TestGhoAaveSteward is TestGhoBase { address(0x003), address(0x004), address(0x005), - address(0x006) + address(0x006), + riskConfig ); } @@ -69,7 +98,8 @@ contract TestGhoAaveSteward is TestGhoBase { address(0x003), address(0x004), address(0x005), - address(0x006) + address(0x006), + riskConfig ); } @@ -81,7 +111,8 @@ contract TestGhoAaveSteward is TestGhoBase { address(0), address(0x004), address(0x005), - address(0x006) + address(0x006), + riskConfig ); } @@ -93,7 +124,8 @@ contract TestGhoAaveSteward is TestGhoBase { address(0x003), address(0), address(0x005), - address(0x006) + address(0x006), + riskConfig ); } @@ -105,7 +137,8 @@ contract TestGhoAaveSteward is TestGhoBase { address(0x003), address(0x004), address(0), - address(0x006) + address(0x006), + riskConfig ); } @@ -117,7 +150,8 @@ contract TestGhoAaveSteward is TestGhoBase { address(0x003), address(0x004), address(0x005), - address(0) + address(0), + riskConfig ); } @@ -269,7 +303,12 @@ contract TestGhoAaveSteward is TestGhoBase { function testUpdateGhoBorrowRate() public { vm.prank(RISK_COUNCIL); - GHO_AAVE_STEWARD.updateGhoBorrowRate(0.26e4); + GHO_AAVE_STEWARD.updateGhoBorrowRate( + defaultRateParams.optimalUsageRatio, + 0.26e4, + defaultRateParams.variableRateSlope1, + defaultRateParams.variableRateSlope2 + ); assertEq(_getGhoBorrowRate(), 0.26e4); } @@ -277,7 +316,12 @@ contract TestGhoAaveSteward is TestGhoBase { uint256 oldBorrowRate = _getGhoBorrowRate(); uint256 newBorrowRate = oldBorrowRate + 1; vm.prank(RISK_COUNCIL); - GHO_AAVE_STEWARD.updateGhoBorrowRate(newBorrowRate); + GHO_AAVE_STEWARD.updateGhoBorrowRate( + defaultRateParams.optimalUsageRatio, + newBorrowRate, + defaultRateParams.variableRateSlope1, + defaultRateParams.variableRateSlope2 + ); uint256 currentBorrowRate = _getGhoBorrowRate(); assertEq(currentBorrowRate, newBorrowRate); } @@ -286,7 +330,12 @@ contract TestGhoAaveSteward is TestGhoBase { uint256 oldBorrowRate = _getGhoBorrowRate(); uint256 newBorrowRate = oldBorrowRate - 1; vm.prank(RISK_COUNCIL); - GHO_AAVE_STEWARD.updateGhoBorrowRate(newBorrowRate); + GHO_AAVE_STEWARD.updateGhoBorrowRate( + defaultRateParams.optimalUsageRatio, + newBorrowRate, + defaultRateParams.variableRateSlope1, + defaultRateParams.variableRateSlope2 + ); uint256 currentBorrowRate = _getGhoBorrowRate(); assertEq(currentBorrowRate, newBorrowRate); } @@ -295,7 +344,12 @@ contract TestGhoAaveSteward is TestGhoBase { uint256 ghoBorrowRateMax = GHO_AAVE_STEWARD.GHO_BORROW_RATE_MAX() / 1e23; _setGhoBorrowRateViaConfigurator(ghoBorrowRateMax - 1); vm.prank(RISK_COUNCIL); - GHO_AAVE_STEWARD.updateGhoBorrowRate(ghoBorrowRateMax); + GHO_AAVE_STEWARD.updateGhoBorrowRate( + defaultRateParams.optimalUsageRatio, + ghoBorrowRateMax, + defaultRateParams.variableRateSlope1, + defaultRateParams.variableRateSlope2 + ); uint256 currentBorrowRate = _getGhoBorrowRate(); assertEq(currentBorrowRate, ghoBorrowRateMax); } @@ -304,7 +358,12 @@ contract TestGhoAaveSteward is TestGhoBase { uint256 oldBorrowRate = _getGhoBorrowRate(); uint256 newBorrowRate = oldBorrowRate + GHO_AAVE_STEWARD.GHO_BORROW_RATE_CHANGE_MAX() / 1e23; vm.prank(RISK_COUNCIL); - GHO_AAVE_STEWARD.updateGhoBorrowRate(newBorrowRate); + GHO_AAVE_STEWARD.updateGhoBorrowRate( + defaultRateParams.optimalUsageRatio, + newBorrowRate, + defaultRateParams.variableRateSlope1, + defaultRateParams.variableRateSlope2 + ); uint256 currentBorrowRate = _getGhoBorrowRate(); assertEq(currentBorrowRate, newBorrowRate); } @@ -313,7 +372,12 @@ contract TestGhoAaveSteward is TestGhoBase { uint256 oldBorrowRate = _getGhoBorrowRate(); uint256 newBorrowRate = oldBorrowRate - 1; vm.prank(RISK_COUNCIL); - GHO_AAVE_STEWARD.updateGhoBorrowRate(newBorrowRate); + GHO_AAVE_STEWARD.updateGhoBorrowRate( + defaultRateParams.optimalUsageRatio, + newBorrowRate, + defaultRateParams.variableRateSlope1, + defaultRateParams.variableRateSlope2 + ); uint256 currentBorrowRate = _getGhoBorrowRate(); assertEq(currentBorrowRate, newBorrowRate); } @@ -323,13 +387,21 @@ contract TestGhoAaveSteward is TestGhoBase { // set a high borrow rate GHO_AAVE_STEWARD.updateGhoBorrowRate( - _getGhoBorrowRate() + GHO_AAVE_STEWARD.GHO_BORROW_RATE_CHANGE_MAX() / 1e23 + defaultRateParams.optimalUsageRatio, + _getGhoBorrowRate() + GHO_AAVE_STEWARD.GHO_BORROW_RATE_CHANGE_MAX() / 1e23, + 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() / 1e23; - GHO_AAVE_STEWARD.updateGhoBorrowRate(newBorrowRate); + GHO_AAVE_STEWARD.updateGhoBorrowRate( + defaultRateParams.optimalUsageRatio, + newBorrowRate, + defaultRateParams.variableRateSlope1, + defaultRateParams.variableRateSlope2 + ); uint256 currentBorrowRate = _getGhoBorrowRate(); assertEq(currentBorrowRate, newBorrowRate); @@ -339,7 +411,12 @@ contract TestGhoAaveSteward is TestGhoBase { function testUpdateGhoBorrowRateTimelock() public { uint256 oldBorrowRate = _getGhoBorrowRate(); vm.prank(RISK_COUNCIL); - GHO_AAVE_STEWARD.updateGhoBorrowRate(oldBorrowRate + 1); + GHO_AAVE_STEWARD.updateGhoBorrowRate( + defaultRateParams.optimalUsageRatio, + oldBorrowRate + 1, + defaultRateParams.variableRateSlope1, + defaultRateParams.variableRateSlope2 + ); IGhoAaveSteward.GhoDebounce memory ghoTimelocks = GHO_AAVE_STEWARD.getGhoTimelocks(); assertEq(ghoTimelocks.ghoBorrowRateLastUpdate, block.timestamp); } @@ -347,11 +424,21 @@ contract TestGhoAaveSteward is TestGhoBase { function testUpdateGhoBorrowRateAfterTimelock() public { uint256 oldBorrowRate = _getGhoBorrowRate(); vm.prank(RISK_COUNCIL); - GHO_AAVE_STEWARD.updateGhoBorrowRate(oldBorrowRate + 1); + GHO_AAVE_STEWARD.updateGhoBorrowRate( + defaultRateParams.optimalUsageRatio, + oldBorrowRate + 1, + defaultRateParams.variableRateSlope1, + defaultRateParams.variableRateSlope2 + ); skip(GHO_AAVE_STEWARD.MINIMUM_DELAY() + 1); uint256 newBorrowRate = oldBorrowRate + 2; vm.prank(RISK_COUNCIL); - GHO_AAVE_STEWARD.updateGhoBorrowRate(newBorrowRate); + GHO_AAVE_STEWARD.updateGhoBorrowRate( + defaultRateParams.optimalUsageRatio, + newBorrowRate, + defaultRateParams.variableRateSlope1, + defaultRateParams.variableRateSlope2 + ); uint256 currentBorrowRate = _getGhoBorrowRate(); assertEq(currentBorrowRate, newBorrowRate); } @@ -359,17 +446,32 @@ contract TestGhoAaveSteward is TestGhoBase { function testRevertUpdateGhoBorrowRateIfUnauthorized() public { vm.expectRevert('INVALID_CALLER'); vm.prank(ALICE); - GHO_AAVE_STEWARD.updateGhoBorrowRate(0.07e4); + GHO_AAVE_STEWARD.updateGhoBorrowRate( + defaultRateParams.optimalUsageRatio, + 0.07e4, + defaultRateParams.variableRateSlope1, + defaultRateParams.variableRateSlope2 + ); } function testRevertUpdateGhoBorrowRateIfUpdatedTooSoon() public { uint256 oldBorrowRate = _getGhoBorrowRate(); vm.prank(RISK_COUNCIL); uint256 newBorrowRate = oldBorrowRate + 1; - GHO_AAVE_STEWARD.updateGhoBorrowRate(newBorrowRate); + GHO_AAVE_STEWARD.updateGhoBorrowRate( + defaultRateParams.optimalUsageRatio, + newBorrowRate, + defaultRateParams.variableRateSlope1, + defaultRateParams.variableRateSlope2 + ); vm.prank(RISK_COUNCIL); vm.expectRevert('DEBOUNCE_NOT_RESPECTED'); - GHO_AAVE_STEWARD.updateGhoBorrowRate(newBorrowRate); + GHO_AAVE_STEWARD.updateGhoBorrowRate( + defaultRateParams.optimalUsageRatio, + newBorrowRate, + defaultRateParams.variableRateSlope1, + defaultRateParams.variableRateSlope2 + ); } function testRevertUpdateGhoBorrowRateIfInterestRateNotFound() public { @@ -383,7 +485,12 @@ contract TestGhoAaveSteward is TestGhoBase { ); vm.expectRevert('GHO_INTEREST_RATE_STRATEGY_NOT_FOUND'); vm.prank(RISK_COUNCIL); - GHO_AAVE_STEWARD.updateGhoBorrowRate(oldBorrowRate + 1); + GHO_AAVE_STEWARD.updateGhoBorrowRate( + defaultRateParams.optimalUsageRatio, + oldBorrowRate + 1, + defaultRateParams.variableRateSlope1, + defaultRateParams.variableRateSlope2 + ); } function testRevertUpdateGhoBorrowRateIfValueMoreThanMax() public { @@ -395,7 +502,12 @@ contract TestGhoAaveSteward is TestGhoBase { _setGhoBorrowRateViaConfigurator(maxGhoBorrowRate); vm.prank(RISK_COUNCIL); vm.expectRevert('BORROW_RATE_HIGHER_THAN_MAX'); - GHO_AAVE_STEWARD.updateGhoBorrowRate(maxGhoBorrowRate + 1); + GHO_AAVE_STEWARD.updateGhoBorrowRate( + defaultRateParams.optimalUsageRatio, + maxGhoBorrowRate + 1, + defaultRateParams.variableRateSlope1, + defaultRateParams.variableRateSlope2 + ); } function testRevertUpdateGhoBorrowRateIfMaxExceededUpwards() public { @@ -403,7 +515,12 @@ contract TestGhoAaveSteward is TestGhoBase { uint256 newBorrowRate = oldBorrowRate + GHO_AAVE_STEWARD.GHO_BORROW_RATE_CHANGE_MAX() + 1; vm.prank(RISK_COUNCIL); vm.expectRevert('INVALID_BORROW_RATE_UPDATE'); - GHO_AAVE_STEWARD.updateGhoBorrowRate(newBorrowRate); + GHO_AAVE_STEWARD.updateGhoBorrowRate( + defaultRateParams.optimalUsageRatio, + newBorrowRate, + defaultRateParams.variableRateSlope1, + defaultRateParams.variableRateSlope2 + ); } function testRevertUpdateGhoBorrowRateIfMaxExceededDownwards() public { @@ -411,7 +528,10 @@ contract TestGhoAaveSteward is TestGhoBase { // set a high borrow rate GHO_AAVE_STEWARD.updateGhoBorrowRate( - _getGhoBorrowRate() + GHO_AAVE_STEWARD.GHO_BORROW_RATE_CHANGE_MAX() / 1e23 + defaultRateParams.optimalUsageRatio, + _getGhoBorrowRate() + GHO_AAVE_STEWARD.GHO_BORROW_RATE_CHANGE_MAX() / 1e23, + defaultRateParams.variableRateSlope1, + defaultRateParams.variableRateSlope2 ); vm.warp(block.timestamp + GHO_AAVE_STEWARD.MINIMUM_DELAY() + 1); @@ -421,7 +541,12 @@ contract TestGhoAaveSteward is TestGhoBase { 1e23 - 1; vm.expectRevert('INVALID_BORROW_RATE_UPDATE'); - GHO_AAVE_STEWARD.updateGhoBorrowRate(newBorrowRate); + GHO_AAVE_STEWARD.updateGhoBorrowRate( + defaultRateParams.optimalUsageRatio, + newBorrowRate, + defaultRateParams.variableRateSlope1, + defaultRateParams.variableRateSlope2 + ); vm.stopPrank(); }