diff --git a/src/20240115_AaveV1Ethereum_AaveV1Deprecation/AaveV1Deprecation.md b/src/20240218_AaveV1Ethereum_AaveV1DeprecationPhase2/AaveV1Deprecation.md similarity index 61% rename from src/20240115_AaveV1Ethereum_AaveV1Deprecation/AaveV1Deprecation.md rename to src/20240218_AaveV1Ethereum_AaveV1DeprecationPhase2/AaveV1Deprecation.md index 34a62db34..81d0dc698 100644 --- a/src/20240115_AaveV1Ethereum_AaveV1Deprecation/AaveV1Deprecation.md +++ b/src/20240218_AaveV1Ethereum_AaveV1DeprecationPhase2/AaveV1Deprecation.md @@ -1,14 +1,14 @@ --- -title: "Aave V1 Deprecation" +title: "Aave V1 Deprecation Phase 2" author: "BGD Labs @bgdlabs" -discussions: "https://governance.aave.com/t/temp-check-bgd-further-aave-v1-deprecation-strategy/15893" +discussions: "https://governance.aave.com/t/temp-check-bgd-further-aave-v1-deprecation-strategy/15893/5" snapshot: "https://snapshot.org/#/aave.eth/proposal/0x7451f00809986c7cb8cce7ef4587efdfedad06089ebf2851d64122d00b035d9c" --- ## Simple Summary Approve further steps of Aave v1 off-boarding, to reduce operational overhead on deprecated Aave instances. -Therefore the proposal suggests to upgrade the pool logic to allow liquidation of healthy positions with a fixed 1% bonus, amongst other measures. +Therefore the proposal suggests to upgrade the liquidation manager to allow liquidation of healthy positions with a fixed 3% bonus. ## Motivation @@ -18,29 +18,27 @@ While Aave v1 has been deprecated for a long time, some liquidity is still stuck This creates meaningful overhead for all involved development & security teams, which directly adds cost to the Aave DAO. Additionally, the architecture of Aave v1 is quite different to Aave v2 & v3, making it the most ad-hoc instance of Aave. +On [6th of february](https://vote.onaave.com/proposal/?proposalId=15) a first set of measures was implemented by the DAO to accelerate the offboarding process. +The proposed changes are in line with was suggested in the original offboarding plan for [phase 2](https://governance.aave.com/t/temp-check-bgd-further-aave-v1-deprecation-strategy/15893). + ## Specification The proposal contract calls: - ADDRESSES_PROVIDER.setLendingPoolLiquidationManager(LIQUIDATION_MANAGER_IMPL); -- ADDRESSES_PROVIDER.setLendingPoolImpl(POOL_IMPL); -- CONFIGURATOR.setReserveInterestRateStrategyAddress(IR); on all assets where `IR` is a InterestRateStrategy with 0% base and 1%/2% slopes to update the implementations accordingly. This upgrade will: -- reduce the interest rates to a minimal value to incentivize withdrawals -- allow liquidations of collateralized positions with 1% liquidation bonus -- allow liquidations with 100% close factor -- disable flashloans +- allow liquidations of collateralized positions with 3% liquidation bonus by replacing the liquidation manager with [0x60eE8b61a13c67d0191c851BEC8F0bc850160710](https://etherscan.io/address/0x60eE8b61a13c67d0191c851BEC8F0bc850160710) ## References -- Implementation: [AaveV1Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/db41527447cb3d593a59abd21701e8e674821937/src/20240115_AaveV1Ethereum_AaveV1Deprecation/AaveV1Ethereum_AaveV1Deprecation_20240115.sol) -- Tests: [AaveV1Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/db41527447cb3d593a59abd21701e8e674821937/src/20240115_AaveV1Ethereum_AaveV1Deprecation/AaveV1Ethereum_AaveV1Deprecation_20240115.t.sol) +- Implementation: [AaveV1Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240218_AaveV1Ethereum_AaveV1DeprecationPhase2/AaveV1Ethereum_AaveV1Deprecation_20240218.sol) +- Tests: [AaveV1Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240218_AaveV1Ethereum_AaveV1DeprecationPhase2/AaveV1Ethereum_AaveV1Deprecation_20240218.t.sol) - [Snapshot](https://snapshot.org/#/aave.eth/proposal/0x7451f00809986c7cb8cce7ef4587efdfedad06089ebf2851d64122d00b035d9c) -- [Discussion](https://governance.aave.com/t/temp-check-bgd-further-aave-v1-deprecation-strategy/15893) +- [Discussion](https://governance.aave.com/t/temp-check-bgd-further-aave-v1-deprecation-strategy/15893/5) - [Updated Implementations](https://github.com/bgd-labs/v1-offboarding) ## Copyright diff --git a/src/20240115_AaveV1Ethereum_AaveV1Deprecation/AaveV1Deprecation_20240115.s.sol b/src/20240218_AaveV1Ethereum_AaveV1DeprecationPhase2/AaveV1Deprecation_20240218.s.sol similarity index 68% rename from src/20240115_AaveV1Ethereum_AaveV1Deprecation/AaveV1Deprecation_20240115.s.sol rename to src/20240218_AaveV1Ethereum_AaveV1DeprecationPhase2/AaveV1Deprecation_20240218.s.sol index d8f4b4681..5bff9c868 100644 --- a/src/20240115_AaveV1Ethereum_AaveV1Deprecation/AaveV1Deprecation_20240115.s.sol +++ b/src/20240218_AaveV1Ethereum_AaveV1DeprecationPhase2/AaveV1Deprecation_20240218.s.sol @@ -3,18 +3,18 @@ pragma solidity ^0.8.0; import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/GovV3Helpers.sol'; import {EthereumScript} from 'aave-helpers/ScriptUtils.sol'; -import {AaveV1Ethereum_AaveV1Deprecation_20240115} from './AaveV1Ethereum_AaveV1Deprecation_20240115.sol'; +import {AaveV1Ethereum_AaveV1Deprecation_20240218} from './AaveV1Ethereum_AaveV1Deprecation_20240218.sol'; /** * @dev Deploy Ethereum - * deploy-command: make deploy-ledger contract=src/20240115_AaveV1Ethereum_AaveV1Deprecation/AaveV1Deprecation_20240115.s.sol:DeployEthereum chain=mainnet - * verify-command: npx catapulta-verify -b broadcast/AaveV1Deprecation_20240115.s.sol/1/run-latest.json + * deploy-command: make deploy-ledger contract=src/20240218_AaveV1Ethereum_AaveV1DeprecationPhase2/AaveV1Deprecation_20240218.s.sol:DeployEthereum chain=mainnet + * verify-command: npx catapulta-verify -b broadcast/AaveV1Deprecation_20240218.s.sol/1/run-latest.json */ contract DeployEthereum is EthereumScript { function run() external broadcast { // deploy payloads address payload0 = GovV3Helpers.deployDeterministic( - type(AaveV1Ethereum_AaveV1Deprecation_20240115).creationCode + type(AaveV1Ethereum_AaveV1Deprecation_20240218).creationCode ); // compose action @@ -29,7 +29,7 @@ contract DeployEthereum is EthereumScript { /** * @dev Create Proposal - * command: make deploy-ledger contract=src/20240115_AaveV1Ethereum_AaveV1Deprecation/AaveV1Deprecation_20240115.s.sol:CreateProposal chain=mainnet + * command: make deploy-ledger contract=src/20240218_AaveV1Ethereum_AaveV1DeprecationPhase2/AaveV1Deprecation_20240218.s.sol:CreateProposal chain=mainnet */ contract CreateProposal is EthereumScript { function run() external { @@ -40,7 +40,7 @@ contract CreateProposal is EthereumScript { IPayloadsControllerCore.ExecutionAction[] memory actionsEthereum = new IPayloadsControllerCore.ExecutionAction[](1); actionsEthereum[0] = GovV3Helpers.buildAction( - type(AaveV1Ethereum_AaveV1Deprecation_20240115).creationCode + type(AaveV1Ethereum_AaveV1Deprecation_20240218).creationCode ); payloads[0] = GovV3Helpers.buildMainnetPayload(vm, actionsEthereum); @@ -51,7 +51,7 @@ contract CreateProposal is EthereumScript { payloads, GovV3Helpers.ipfsHashFile( vm, - 'src/20240115_AaveV1Ethereum_AaveV1Deprecation/AaveV1Deprecation.md' + 'src/20240218_AaveV1Ethereum_AaveV1DeprecationPhase2/AaveV1Deprecation.md' ) ); } diff --git a/src/20240115_AaveV1Ethereum_AaveV1Deprecation/AaveV1Ethereum_AaveV1Deprecation_20240115.sol b/src/20240218_AaveV1Ethereum_AaveV1DeprecationPhase2/AaveV1Ethereum_AaveV1Deprecation_20240218.sol similarity index 64% rename from src/20240115_AaveV1Ethereum_AaveV1Deprecation/AaveV1Ethereum_AaveV1Deprecation_20240115.sol rename to src/20240218_AaveV1Ethereum_AaveV1DeprecationPhase2/AaveV1Ethereum_AaveV1Deprecation_20240218.sol index c14c78f12..2af898010 100644 --- a/src/20240115_AaveV1Ethereum_AaveV1Deprecation/AaveV1Ethereum_AaveV1Deprecation_20240115.sol +++ b/src/20240218_AaveV1Ethereum_AaveV1DeprecationPhase2/AaveV1Ethereum_AaveV1Deprecation_20240218.sol @@ -31,34 +31,19 @@ interface IPoolConfigurator { } /** - * @title Aave V1 Deprecation + * @title Aave V1 Deprecation Phase 2 * @author BGD Labs @bgdlabs * - Snapshot: https://snapshot.org/#/aave.eth/proposal/0x7451f00809986c7cb8cce7ef4587efdfedad06089ebf2851d64122d00b035d9c - * - Discussion: https://governance.aave.com/t/temp-check-bgd-further-aave-v1-deprecation-strategy/15893 + * - Discussion: https://governance.aave.com/t/temp-check-bgd-further-aave-v1-deprecation-strategy/15893/5 */ -contract AaveV1Ethereum_AaveV1Deprecation_20240115 is IProposalGenericExecutor { +contract AaveV1Ethereum_AaveV1Deprecation_20240218 is IProposalGenericExecutor { ILendingPoolAddressesProvider public constant ADDRESSES_PROVIDER = ILendingPoolAddressesProvider(0x24a42fD28C976A61Df5D00D0599C34c4f90748c8); - ILendingPoolCore public constant CORE = - ILendingPoolCore(0x3dfd23A6c5E8BbcFc9581d2E864a68feb6a076d3); - - IPoolConfigurator public constant CONFIGURATOR = - IPoolConfigurator(0x4965f6FA20fE9728deCf5165016fc338a5a85aBF); - address public constant LIQUIDATION_MANAGER_IMPL = - address(0x1a7Dde6344d5F2888209DdB446756FE292e1325e); - - address public constant POOL_IMPL = address(0x89A943BAc327c9e217d70E57DCD57C7f2a8C3fA9); - - address public constant MINIMAL_IR = address(0x9Bf9df78b1f7c76a473588c41321B5059b62981e); + address(0x60eE8b61a13c67d0191c851BEC8F0bc850160710); function execute() external { ADDRESSES_PROVIDER.setLendingPoolLiquidationManager(LIQUIDATION_MANAGER_IMPL); - ADDRESSES_PROVIDER.setLendingPoolImpl(POOL_IMPL); - address[] memory reserves = CORE.getReserves(); - for (uint256 i = 0; i < reserves.length; i++) { - CONFIGURATOR.setReserveInterestRateStrategyAddress(reserves[i], MINIMAL_IR); - } } } diff --git a/src/20240115_AaveV1Ethereum_AaveV1Deprecation/AaveV1Ethereum_AaveV1Deprecation_20240115.t.sol b/src/20240218_AaveV1Ethereum_AaveV1DeprecationPhase2/AaveV1Ethereum_AaveV1Deprecation_20240218.t.sol similarity index 82% rename from src/20240115_AaveV1Ethereum_AaveV1Deprecation/AaveV1Ethereum_AaveV1Deprecation_20240115.t.sol rename to src/20240218_AaveV1Ethereum_AaveV1DeprecationPhase2/AaveV1Ethereum_AaveV1Deprecation_20240218.t.sol index 49886471d..eec6f6623 100644 --- a/src/20240115_AaveV1Ethereum_AaveV1Deprecation/AaveV1Ethereum_AaveV1Deprecation_20240115.t.sol +++ b/src/20240218_AaveV1Ethereum_AaveV1DeprecationPhase2/AaveV1Ethereum_AaveV1Deprecation_20240218.t.sol @@ -3,8 +3,9 @@ pragma solidity ^0.8.0; import 'forge-std/Test.sol'; import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol'; +import {AaveV2EthereumAssets} from 'aave-address-book/AaveV2Ethereum.sol'; import {ProtocolV2TestBase, ReserveConfig} from 'aave-helpers/ProtocolV2TestBase.sol'; -import {AaveV1Ethereum_AaveV1Deprecation_20240115, ILendingPoolAddressesProvider, ILendingPoolCore} from './AaveV1Ethereum_AaveV1Deprecation_20240115.sol'; +import {AaveV1Ethereum_AaveV1Deprecation_20240218, ILendingPoolAddressesProvider, ILendingPoolCore} from './AaveV1Ethereum_AaveV1Deprecation_20240218.sol'; interface ILendingPool { function liquidationCall( @@ -79,10 +80,10 @@ interface IAToken { } /** - * @dev Test for AaveV1Ethereum_AaveV1Deprecation_20240115 - * command: make test-contract filter=AaveV1Ethereum_AaveV1Deprecation_20240115 + * @dev Test for AaveV1Ethereum_AaveV1Deprecation_20240218 + * command: make test-contract filter=AaveV1Ethereum_AaveV1Deprecation_20240218 */ -contract AaveV1Ethereum_AaveV1Deprecation_20240115_Test is ProtocolV2TestBase { +contract AaveV1Ethereum_AaveV1Deprecation_20240218_Test is ProtocolV2TestBase { struct V1User { address payable user; address collateral; @@ -97,22 +98,11 @@ contract AaveV1Ethereum_AaveV1Deprecation_20240115_Test is ProtocolV2TestBase { ILendingPool public constant POOL = ILendingPool(0x398eC7346DcD622eDc5ae82352F02bE94C62d119); - AaveV1Ethereum_AaveV1Deprecation_20240115 internal proposal; + AaveV1Ethereum_AaveV1Deprecation_20240218 internal proposal; function setUp() public { - vm.createSelectFork(vm.rpcUrl('mainnet'), 19111804); - proposal = new AaveV1Ethereum_AaveV1Deprecation_20240115(); - } - - /** - * Check the IR is updated correctly - */ - function test_ir() public { - executePayload(vm, address(proposal)); - address[] memory reserves = CORE.getReserves(); - for (uint256 i = 0; i < reserves.length; i++) { - assertEq(CORE.getReserveInterestRateStrategyAddress(reserves[i]), proposal.MINIMAL_IR()); - } + vm.createSelectFork(vm.rpcUrl('mainnet'), 19254674); + proposal = new AaveV1Ethereum_AaveV1Deprecation_20240218(); } function test_repay() public { @@ -210,7 +200,7 @@ contract AaveV1Ethereum_AaveV1Deprecation_20240115_Test is ProtocolV2TestBase { uint256 collateralDiff = totalCollateralETHBefore - totalCollateralETHAfter; uint256 borrowsDiff = totalBorrowsETHBefore - totalBorrowsETHAfter; assertGt(collateralDiff, borrowsDiff); - assertApproxEqAbs((borrowsDiff * 1 ether) / collateralDiff, 0.99 ether, 0.001 ether); // should be ~1% + rounding + assertApproxEqAbs((borrowsDiff * 1 ether) / collateralDiff, 0.97 ether, 0.001 ether); // should be ~3% + rounding } } @@ -218,24 +208,26 @@ contract AaveV1Ethereum_AaveV1Deprecation_20240115_Test is ProtocolV2TestBase { V1User[] memory users = new V1User[](4); users[0] = V1User( payable(0x1F0aeAeE69468727BA258B0cf692E6bfecc2E286), - 0x514910771AF9Ca656af840dff83E8264EcF986CA, // LINK - 0x0000000000085d4780B73119b644AE5ecd22b376 // TUSD + AaveV2EthereumAssets.LINK_UNDERLYING, // LINK + AaveV2EthereumAssets.TUSD_UNDERLYING // TUSD ); users[1] = V1User( - payable(0x1F0aeAeE69468727BA258B0cf692E6bfecc2E286), - 0x514910771AF9Ca656af840dff83E8264EcF986CA, // LINK - 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 // USDC + payable(0x9F3C2254414c852b83C727B257b6EaB9418cF914), + 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE, // ETH + AaveV2EthereumAssets.USDC_UNDERLYING // USDC ); users[2] = V1User( - payable(0x310D5C8EE1512D5092ee4377061aE82E48973689), - 0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599, // WBTC - 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE // weth + payable(0x9F3C2254414c852b83C727B257b6EaB9418cF914), + 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE, // ETH + AaveV2EthereumAssets.DAI_UNDERLYING // weth ); users[3] = V1User( - payable(0xb570de1e7f1696DE9623e1784122EBCA1d6907e5), - 0x514910771AF9Ca656af840dff83E8264EcF986CA, // LINK - 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 // USDC + payable(0x9F3C2254414c852b83C727B257b6EaB9418cF914), + 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE, // ETH + AaveV2EthereumAssets.BUSD_UNDERLYING // USDC ); return users; } + + fallback() external payable {} } diff --git a/src/20240115_AaveV1Ethereum_AaveV1Deprecation/config.ts b/src/20240218_AaveV1Ethereum_AaveV1DeprecationPhase2/config.ts similarity index 96% rename from src/20240115_AaveV1Ethereum_AaveV1Deprecation/config.ts rename to src/20240218_AaveV1Ethereum_AaveV1DeprecationPhase2/config.ts index 92806cfbd..a54826366 100644 --- a/src/20240115_AaveV1Ethereum_AaveV1Deprecation/config.ts +++ b/src/20240218_AaveV1Ethereum_AaveV1DeprecationPhase2/config.ts @@ -5,7 +5,7 @@ export const config: ConfigFile = { pools: ['AaveV1Ethereum'], title: 'Aave V1 Deprecation', shortName: 'AaveV1Deprecation', - date: '20240115', + date: '20240218', discussion: 'https://governance.aave.com/t/temp-check-bgd-further-aave-v1-deprecation-strategy/15893', snapshot: