-
Notifications
You must be signed in to change notification settings - Fork 47
feat: Risk Stewards V4 Activation #1180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Kogaroshi
wants to merge
8
commits into
main
Choose a base branch
from
feat/v4-risk-stewards
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
145eba2
feat: Risk Stewards V4 Activation
Kogaroshi 353509b
fix: address pr comments
Kogaroshi 812aa3b
fix: extend tests
Kogaroshi fd98d60
feat: configurator domain role breakdown
Kogaroshi 4a9a526
fix: update .md
Kogaroshi 21a2f88
Merge remote-tracking branch 'origin/main' into feat/v4-risk-stewards
Kogaroshi 7baf486
fix: update configs
Kogaroshi fe41453
fix: update config params
Kogaroshi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
1,248 changes: 1,248 additions & 0 deletions
1,248
..._20260807_before_AaveV4Avalanche_AaveV4RiskStewardsActivation_20260807_after.md
Large diffs are not rendered by default.
Oops, something went wrong.
1,323 changes: 1,323 additions & 0 deletions
1,323
...n_20260807_before_AaveV4Ethereum_AaveV4RiskStewardsActivation_20260807_after.md
Large diffs are not rendered by default.
Oops, something went wrong.
165 changes: 165 additions & 0 deletions
165
...ti_AaveV4RiskStewardsActivation/AaveV4Avalanche_AaveV4RiskStewardsActivation_20260807.sol
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,165 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8.0; | ||
|
|
||
| import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; | ||
| import {AaveV3Avalanche} from 'aave-address-book/AaveV3Avalanche.sol'; | ||
| import {AaveV4Avalanche} from 'aave-address-book/AaveV4Avalanche.sol'; | ||
| import {IRiskStewardV4} from 'src/interfaces/IRiskStewardV4.sol'; | ||
| import {AaveV4ConfiguratorRoles} from './AaveV4ConfiguratorRoles.sol'; | ||
|
|
||
| /** | ||
| * @title AaveV4RiskStewardsActivation | ||
| * @author Aave Labs | ||
| * - Snapshot: TODO | ||
| * - Discussion: https://governance.aave.com/t/arfc-activate-aave-risk-stewards-on-aave-v4/25510 | ||
| */ | ||
| contract AaveV4Avalanche_AaveV4RiskStewardsActivation_20260807 is IProposalGenericExecutor { | ||
| // https://snowscan.xyz/address/0xd8d7AbC42c1c938BdEC94fF8da1b3cd5b7e3b107 | ||
| address public constant RISK_STEWARD = 0xd8d7AbC42c1c938BdEC94fF8da1b3cd5b7e3b107; | ||
|
|
||
| function execute() external override { | ||
| AaveV4ConfiguratorRoles.breakDownDomainAdminRoles( | ||
| AaveV4Avalanche.ACCESS_MANAGER, | ||
| AaveV4Avalanche.HUB_CONFIGURATOR, | ||
| AaveV4Avalanche.SPOKE_CONFIGURATOR | ||
| ); | ||
| _grantRoles(); | ||
| IRiskStewardV4(RISK_STEWARD).setConfig(_riskStewardConfig()); | ||
| } | ||
|
|
||
| /// @dev The steward only needs risk management to run its own entrypoints; emergency is granted | ||
| /// alongside it so it can also de-risk without a new proposal. | ||
| function _grantRoles() internal { | ||
| AaveV4Avalanche.ACCESS_MANAGER.grantRole({ | ||
| roleId: AaveV4ConfiguratorRoles.HUB_CONFIGURATOR_RISK_MANAGEMENT_ROLE, | ||
| account: RISK_STEWARD, | ||
| executionDelay: 0 | ||
| }); | ||
| AaveV4Avalanche.ACCESS_MANAGER.grantRole({ | ||
| roleId: AaveV4ConfiguratorRoles.HUB_CONFIGURATOR_EMERGENCY_ROLE, | ||
| account: RISK_STEWARD, | ||
| executionDelay: 0 | ||
| }); | ||
| AaveV4Avalanche.ACCESS_MANAGER.grantRole({ | ||
| roleId: AaveV4ConfiguratorRoles.SPOKE_CONFIGURATOR_RISK_MANAGEMENT_ROLE, | ||
| account: RISK_STEWARD, | ||
| executionDelay: 0 | ||
| }); | ||
| AaveV4Avalanche.ACCESS_MANAGER.grantRole({ | ||
| roleId: AaveV4ConfiguratorRoles.SPOKE_CONFIGURATOR_EMERGENCY_ROLE, | ||
| account: RISK_STEWARD, | ||
| executionDelay: 0 | ||
| }); | ||
| // the CAPO adapters behind the v4 price sources gate setCapParameters on the v3 ACL manager | ||
| AaveV3Avalanche.ACL_MANAGER.addRiskAdmin(RISK_STEWARD); | ||
| } | ||
|
|
||
| function _riskStewardConfig() internal pure returns (IRiskStewardV4.Config memory) { | ||
| return | ||
| IRiskStewardV4.Config({ | ||
| hub: IRiskStewardV4.HubConfig({ | ||
| configurator: AaveV4Avalanche.HUB_CONFIGURATOR, | ||
| rate: IRiskStewardV4.HubRateConfig({ | ||
| optimalUsageRatio: IRiskStewardV4.RiskParamConfig({ | ||
| minDelay: 36 hours, | ||
| maxPercentChange: 3_00, | ||
| isChangeRelative: false | ||
| }), | ||
| baseDrawnRate: IRiskStewardV4.RiskParamConfig({ | ||
| minDelay: 36 hours, | ||
| maxPercentChange: 3_00, | ||
| isChangeRelative: false | ||
| }), | ||
| rateGrowthBeforeOptimal: IRiskStewardV4.RiskParamConfig({ | ||
| minDelay: 36 hours, | ||
| maxPercentChange: 3_00, | ||
| isChangeRelative: false | ||
| }), | ||
| rateGrowthAfterOptimal: IRiskStewardV4.RiskParamConfig({ | ||
| minDelay: 36 hours, | ||
| maxPercentChange: 20_00, | ||
| isChangeRelative: false | ||
| }) | ||
| }), | ||
| cap: IRiskStewardV4.HubCapConfig({ | ||
| addCap: IRiskStewardV4.RiskParamConfig({ | ||
| minDelay: 36 hours, | ||
| maxPercentChange: 100_00, | ||
| isChangeRelative: true | ||
| }), | ||
| drawCap: IRiskStewardV4.RiskParamConfig({ | ||
| minDelay: 36 hours, | ||
| maxPercentChange: 100_00, | ||
| isChangeRelative: true | ||
| }) | ||
| }) | ||
| }), | ||
| spoke: IRiskStewardV4.SpokeConfig({ | ||
| configurator: AaveV4Avalanche.SPOKE_CONFIGURATOR, | ||
| collateralRisk: IRiskStewardV4.RiskParamConfig({ | ||
| minDelay: 36 hours, | ||
| maxPercentChange: 300_00, | ||
| isChangeRelative: false | ||
| }), | ||
| dynamicUpdate: IRiskStewardV4.SpokeDynamicConfig({ | ||
| collateralFactor: IRiskStewardV4.RiskParamConfig({ | ||
| minDelay: 72 hours, | ||
| maxPercentChange: 50, | ||
| isChangeRelative: false | ||
| }), | ||
| maxLiquidationBonus: IRiskStewardV4.RiskParamConfig({ | ||
| minDelay: 72 hours, | ||
| maxPercentChange: 50, | ||
| isChangeRelative: false | ||
| }) | ||
| }), | ||
| dynamicAdd: IRiskStewardV4.SpokeDynamicConfig({ | ||
| collateralFactor: IRiskStewardV4.RiskParamConfig({ | ||
| minDelay: 72 hours, | ||
| maxPercentChange: 5_00, | ||
| isChangeRelative: false | ||
| }), | ||
| maxLiquidationBonus: IRiskStewardV4.RiskParamConfig({ | ||
| minDelay: 72 hours, | ||
| maxPercentChange: 50, | ||
| isChangeRelative: false | ||
| }) | ||
| }), | ||
| liquidation: IRiskStewardV4.SpokeLiquidationConfig({ | ||
| targetHealthFactor: IRiskStewardV4.RiskParamConfig({ | ||
| minDelay: 72 hours, | ||
| maxPercentChange: 5_00, | ||
| isChangeRelative: true | ||
| }), | ||
| healthFactorForMaxBonus: IRiskStewardV4.RiskParamConfig({ | ||
| minDelay: 72 hours, | ||
| maxPercentChange: 5_00, | ||
| isChangeRelative: true | ||
| }), | ||
| liquidationBonusFactor: IRiskStewardV4.RiskParamConfig({ | ||
| minDelay: 72 hours, | ||
| maxPercentChange: 5_00, | ||
| isChangeRelative: false | ||
| }) | ||
| }) | ||
| }), | ||
| oracle: IRiskStewardV4.OracleConfig({ | ||
| priceCapLst: IRiskStewardV4.RiskParamConfig({ | ||
| minDelay: 72 hours, | ||
| maxPercentChange: 5_00, | ||
| isChangeRelative: true | ||
| }), | ||
| priceCapStable: IRiskStewardV4.RiskParamConfig({ | ||
| minDelay: 72 hours, | ||
| maxPercentChange: 50, | ||
| isChangeRelative: true | ||
| }), | ||
| discountRatePendle: IRiskStewardV4.RiskParamConfig({ | ||
| minDelay: 48 hours, | ||
| maxPercentChange: 0.025e18, | ||
| isChangeRelative: false | ||
| }) | ||
| }) | ||
| }); | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.