diff --git a/diffs/AaveV2Avalanche_ReserveFactorUpgrades_20240411_before_AaveV2Avalanche_ReserveFactorUpgrades_20240411_after.md b/diffs/AaveV2Avalanche_ReserveFactorUpgrades_20240411_before_AaveV2Avalanche_ReserveFactorUpgrades_20240411_after.md new file mode 100644 index 000000000..f93e7d463 --- /dev/null +++ b/diffs/AaveV2Avalanche_ReserveFactorUpgrades_20240411_before_AaveV2Avalanche_ReserveFactorUpgrades_20240411_after.md @@ -0,0 +1,90 @@ +## Reserve changes + +### Reserve altered + +#### WETH.e ([0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB](https://snowscan.xyz/address/0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB)) + +| description | value before | value after | +| --- | --- | --- | +| reserveFactor | 35 % | 40 % | + + +#### WBTC.e ([0x50b7545627a5162F82A992c33b87aDc75187B218](https://snowscan.xyz/address/0x50b7545627a5162F82A992c33b87aDc75187B218)) + +| description | value before | value after | +| --- | --- | --- | +| reserveFactor | 40 % | 45 % | + + +#### USDC.e ([0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664](https://snowscan.xyz/address/0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664)) + +| description | value before | value after | +| --- | --- | --- | +| reserveFactor | 35 % | 40 % | + + +#### WAVAX ([0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7](https://snowscan.xyz/address/0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7)) + +| description | value before | value after | +| --- | --- | --- | +| reserveFactor | 35 % | 40 % | + + +#### USDT.e ([0xc7198437980c041c805A1EDcbA50c1Ce5db95118](https://snowscan.xyz/address/0xc7198437980c041c805A1EDcbA50c1Ce5db95118)) + +| description | value before | value after | +| --- | --- | --- | +| reserveFactor | 35 % | 40 % | + + +#### DAI.e ([0xd586E7F844cEa2F87f50152665BCbc2C279D8d70](https://snowscan.xyz/address/0xd586E7F844cEa2F87f50152665BCbc2C279D8d70)) + +| description | value before | value after | +| --- | --- | --- | +| reserveFactor | 35 % | 40 % | + + +## Raw diff + +```json +{ + "reserves": { + "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB": { + "reserveFactor": { + "from": 3500, + "to": 4000 + } + }, + "0x50b7545627a5162F82A992c33b87aDc75187B218": { + "reserveFactor": { + "from": 4000, + "to": 4500 + } + }, + "0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664": { + "reserveFactor": { + "from": 3500, + "to": 4000 + } + }, + "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7": { + "reserveFactor": { + "from": 3500, + "to": 4000 + } + }, + "0xc7198437980c041c805A1EDcbA50c1Ce5db95118": { + "reserveFactor": { + "from": 3500, + "to": 4000 + } + }, + "0xd586E7F844cEa2F87f50152665BCbc2C279D8d70": { + "reserveFactor": { + "from": 3500, + "to": 4000 + } + } + } +} +``` \ No newline at end of file diff --git a/diffs/AaveV2Ethereum_ReserveFactorUpgrades_20240411_before_AaveV2Ethereum_ReserveFactorUpgrades_20240411_after.md b/diffs/AaveV2Ethereum_ReserveFactorUpgrades_20240411_before_AaveV2Ethereum_ReserveFactorUpgrades_20240411_after.md new file mode 100644 index 000000000..d3c5716e2 --- /dev/null +++ b/diffs/AaveV2Ethereum_ReserveFactorUpgrades_20240411_before_AaveV2Ethereum_ReserveFactorUpgrades_20240411_after.md @@ -0,0 +1,155 @@ +## Reserve changes + +### Reserve altered + +#### GUSD ([0x056Fd409E1d7A124BD7017459dFEa2F387b6d5Cd](https://etherscan.io/address/0x056Fd409E1d7A124BD7017459dFEa2F387b6d5Cd)) + +| description | value before | value after | +| --- | --- | --- | +| reserveFactor | 35 % | 40 % | + + +#### WBTC ([0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599](https://etherscan.io/address/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599)) + +| description | value before | value after | +| --- | --- | --- | +| reserveFactor | 45 % | 50 % | + + +#### LINK ([0x514910771AF9Ca656af840dff83E8264EcF986CA](https://etherscan.io/address/0x514910771AF9Ca656af840dff83E8264EcF986CA)) + +| description | value before | value after | +| --- | --- | --- | +| reserveFactor | 45 % | 50 % | + + +#### sUSD ([0x57Ab1ec28D129707052df4dF418D58a2D46d5f51](https://etherscan.io/address/0x57Ab1ec28D129707052df4dF418D58a2D46d5f51)) + +| description | value before | value after | +| --- | --- | --- | +| reserveFactor | 45 % | 50 % | + + +#### LUSD ([0x5f98805A4E8be255a32880FDeC7F6728C6568bA0](https://etherscan.io/address/0x5f98805A4E8be255a32880FDeC7F6728C6568bA0)) + +| description | value before | value after | +| --- | --- | --- | +| reserveFactor | 40 % | 45 % | + + +#### DAI ([0x6B175474E89094C44Da98b954EedeAC495271d0F](https://etherscan.io/address/0x6B175474E89094C44Da98b954EedeAC495271d0F)) + +| description | value before | value after | +| --- | --- | --- | +| reserveFactor | 40 % | 45 % | + + +#### FRAX ([0x853d955aCEf822Db058eb8505911ED77F175b99e](https://etherscan.io/address/0x853d955aCEf822Db058eb8505911ED77F175b99e)) + +| description | value before | value after | +| --- | --- | --- | +| reserveFactor | 45 % | 50 % | + + +#### USDP ([0x8E870D67F660D95d5be530380D0eC0bd388289E1](https://etherscan.io/address/0x8E870D67F660D95d5be530380D0eC0bd388289E1)) + +| description | value before | value after | +| --- | --- | --- | +| reserveFactor | 35 % | 40 % | + + +#### USDC ([0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48](https://etherscan.io/address/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48)) + +| description | value before | value after | +| --- | --- | --- | +| reserveFactor | 40 % | 45 % | + + +#### WETH ([0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2](https://etherscan.io/address/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2)) + +| description | value before | value after | +| --- | --- | --- | +| reserveFactor | 40 % | 45 % | + + +#### USDT ([0xdAC17F958D2ee523a2206206994597C13D831ec7](https://etherscan.io/address/0xdAC17F958D2ee523a2206206994597C13D831ec7)) + +| description | value before | value after | +| --- | --- | --- | +| reserveFactor | 40 % | 45 % | + + +## Raw diff + +```json +{ + "reserves": { + "0x056Fd409E1d7A124BD7017459dFEa2F387b6d5Cd": { + "reserveFactor": { + "from": 3500, + "to": 4000 + } + }, + "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599": { + "reserveFactor": { + "from": 4500, + "to": 5000 + } + }, + "0x514910771AF9Ca656af840dff83E8264EcF986CA": { + "reserveFactor": { + "from": 4500, + "to": 5000 + } + }, + "0x57Ab1ec28D129707052df4dF418D58a2D46d5f51": { + "reserveFactor": { + "from": 4500, + "to": 5000 + } + }, + "0x5f98805A4E8be255a32880FDeC7F6728C6568bA0": { + "reserveFactor": { + "from": 4000, + "to": 4500 + } + }, + "0x6B175474E89094C44Da98b954EedeAC495271d0F": { + "reserveFactor": { + "from": 4000, + "to": 4500 + } + }, + "0x853d955aCEf822Db058eb8505911ED77F175b99e": { + "reserveFactor": { + "from": 4500, + "to": 5000 + } + }, + "0x8E870D67F660D95d5be530380D0eC0bd388289E1": { + "reserveFactor": { + "from": 3500, + "to": 4000 + } + }, + "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48": { + "reserveFactor": { + "from": 4000, + "to": 4500 + } + }, + "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2": { + "reserveFactor": { + "from": 4000, + "to": 4500 + } + }, + "0xdAC17F958D2ee523a2206206994597C13D831ec7": { + "reserveFactor": { + "from": 4000, + "to": 4500 + } + } + } +} +``` \ No newline at end of file diff --git a/src/20240411_Multi_ReserveFactorUpgrades/AaveV2Avalanche_ReserveFactorUpgrades_20240411.sol b/src/20240411_Multi_ReserveFactorUpgrades/AaveV2Avalanche_ReserveFactorUpgrades_20240411.sol new file mode 100644 index 000000000..dc2b79bdc --- /dev/null +++ b/src/20240411_Multi_ReserveFactorUpgrades/AaveV2Avalanche_ReserveFactorUpgrades_20240411.sol @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: MIT +/* + _ ΞΞΞΞ _ + /_;-.__ / _\ _.-;_\ + `-._`'`_/'`.-' + `\ /` + | / + /-.( + \_._\ + \ \`; + > |/ + / // + |// + \(\ + `` + defijesus.eth +*/ +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; +import {AaveV2Avalanche, AaveV2AvalancheAssets, ILendingPoolConfigurator} from 'aave-address-book/AaveV2Avalanche.sol'; + +/** + * @title Reserve Factor Upgrades + * @author karpatkey_TokenLogic + * - Snapshot: https://snapshot.org/#/aave.eth/proposal/0x770ff4e02634c77aaa09952345551168920f7878b32ab03fcef92763a5fb70ab + * - Discussion: https://governance.aave.com/t/arfc-avalanche-v2-reserve-factor-adjustment/17040/2 + */ +contract AaveV2Avalanche_ReserveFactorUpgrades_20240411 is IProposalGenericExecutor { + ILendingPoolConfigurator public constant POOL_CONFIGURATOR = + ILendingPoolConfigurator(AaveV2Avalanche.POOL_CONFIGURATOR); + + uint256 public constant DAIe_RF = 40_00; + uint256 public constant USDCe_RF = 40_00; + uint256 public constant USDTe_RF = 40_00; + uint256 public constant WAVAX_RF = 40_00; + uint256 public constant WBTCe_RF = 45_00; + uint256 public constant WETHe_RF = 40_00; + + function execute() external { + POOL_CONFIGURATOR.setReserveFactor(AaveV2AvalancheAssets.DAIe_UNDERLYING, DAIe_RF); + POOL_CONFIGURATOR.setReserveFactor(AaveV2AvalancheAssets.USDCe_UNDERLYING, USDCe_RF); + POOL_CONFIGURATOR.setReserveFactor(AaveV2AvalancheAssets.USDTe_UNDERLYING, USDTe_RF); + POOL_CONFIGURATOR.setReserveFactor(AaveV2AvalancheAssets.WAVAX_UNDERLYING, WAVAX_RF); + POOL_CONFIGURATOR.setReserveFactor(AaveV2AvalancheAssets.WBTCe_UNDERLYING, WBTCe_RF); + POOL_CONFIGURATOR.setReserveFactor(AaveV2AvalancheAssets.WETHe_UNDERLYING, WETHe_RF); + } +} diff --git a/src/20240411_Multi_ReserveFactorUpgrades/AaveV2Avalanche_ReserveFactorUpgrades_20240411.t.sol b/src/20240411_Multi_ReserveFactorUpgrades/AaveV2Avalanche_ReserveFactorUpgrades_20240411.t.sol new file mode 100644 index 000000000..c5c77615a --- /dev/null +++ b/src/20240411_Multi_ReserveFactorUpgrades/AaveV2Avalanche_ReserveFactorUpgrades_20240411.t.sol @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV2Avalanche, AaveV2AvalancheAssets} from 'aave-address-book/AaveV2Avalanche.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV2TestBase, ReserveConfig} from 'aave-helpers/ProtocolV2TestBase.sol'; +import {AaveV2Avalanche_ReserveFactorUpgrades_20240411} from './AaveV2Avalanche_ReserveFactorUpgrades_20240411.sol'; + +/** + * @dev Test for AaveV2Avalanche_ReserveFactorUpgrades_20240411 + * command: make test-contract filter=AaveV2Avalanche_ReserveFactorUpgrades_20240411 + */ +contract AaveV2Avalanche_ReserveFactorUpgrades_20240411_Test is ProtocolV2TestBase { + AaveV2Avalanche_ReserveFactorUpgrades_20240411 internal proposal; + + struct Changes { + address asset; + uint256 reserveFactor; + } + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('avalanche'), 44280713); + proposal = new AaveV2Avalanche_ReserveFactorUpgrades_20240411(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + (ReserveConfig[] memory allConfigsBefore, ReserveConfig[] memory allConfigsAfter) = defaultTest( + 'AaveV2Avalanche_ReserveFactorUpgrades_20240411', + AaveV2Avalanche.POOL, + address(proposal) + ); + + address[] memory assetsChanged = new address[](6); + assetsChanged[0] = AaveV2AvalancheAssets.DAIe_UNDERLYING; + assetsChanged[1] = AaveV2AvalancheAssets.USDCe_UNDERLYING; + assetsChanged[2] = AaveV2AvalancheAssets.USDTe_UNDERLYING; + assetsChanged[3] = AaveV2AvalancheAssets.WAVAX_UNDERLYING; + assetsChanged[4] = AaveV2AvalancheAssets.WBTCe_UNDERLYING; + assetsChanged[5] = AaveV2AvalancheAssets.WETHe_UNDERLYING; + + Changes[] memory assetChanges = new Changes[](6); + assetChanges[0] = Changes({ + asset: AaveV2AvalancheAssets.DAIe_UNDERLYING, + reserveFactor: proposal.DAIe_RF() + }); + assetChanges[1] = Changes({ + asset: AaveV2AvalancheAssets.USDCe_UNDERLYING, + reserveFactor: proposal.USDCe_RF() + }); + assetChanges[2] = Changes({ + asset: AaveV2AvalancheAssets.USDTe_UNDERLYING, + reserveFactor: proposal.USDTe_RF() + }); + assetChanges[3] = Changes({ + asset: AaveV2AvalancheAssets.WAVAX_UNDERLYING, + reserveFactor: proposal.WAVAX_RF() + }); + assetChanges[4] = Changes({ + asset: AaveV2AvalancheAssets.WBTCe_UNDERLYING, + reserveFactor: proposal.WBTCe_RF() + }); + assetChanges[5] = Changes({ + asset: AaveV2AvalancheAssets.WETHe_UNDERLYING, + reserveFactor: proposal.WETHe_RF() + }); + + _noReservesConfigsChangesApartFrom(allConfigsBefore, allConfigsAfter, assetsChanged); + + for (uint i = 0; i < assetChanges.length; i++) { + ReserveConfig memory cfg = _findReserveConfig(allConfigsAfter, assetChanges[i].asset); + assertEq(cfg.reserveFactor, assetChanges[i].reserveFactor); + } + } +} diff --git a/src/20240411_Multi_ReserveFactorUpgrades/AaveV2Ethereum_ReserveFactorUpgrades_20240411.sol b/src/20240411_Multi_ReserveFactorUpgrades/AaveV2Ethereum_ReserveFactorUpgrades_20240411.sol new file mode 100644 index 000000000..b05434086 --- /dev/null +++ b/src/20240411_Multi_ReserveFactorUpgrades/AaveV2Ethereum_ReserveFactorUpgrades_20240411.sol @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: MIT +/* + _ ΞΞΞΞ _ + /_;-.__ / _\ _.-;_\ + `-._`'`_/'`.-' + `\ /` + | / + /-.( + \_._\ + \ \`; + > |/ + / // + |// + \(\ + `` + defijesus.eth +*/ +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; +import {AaveV2Ethereum, AaveV2EthereumAssets, ILendingPoolConfigurator} from 'aave-address-book/AaveV2Ethereum.sol'; + +/** + * @title Reserve Factor Upgrades + * @author karpatkey_TokenLogic + * - Snapshot: https://snapshot.org/#/aave.eth/proposal/0x26a03c08359c340f63b78b0c3e96d37aa0adeda65814643b0886d4719048ea7e + * - Discussion: https://governance.aave.com/t/arfc-ethereum-v2-reserve-factor-adjustment/16764/7 + */ +contract AaveV2Ethereum_ReserveFactorUpgrades_20240411 is IProposalGenericExecutor { + ILendingPoolConfigurator public constant POOL_CONFIGURATOR = + ILendingPoolConfigurator(AaveV2Ethereum.POOL_CONFIGURATOR); + + uint256 public constant DAI_RF = 45_00; + uint256 public constant FRAX_RF = 50_00; + uint256 public constant GUSD_RF = 40_00; + uint256 public constant LINK_RF = 50_00; + uint256 public constant LUSD_RF = 45_00; + uint256 public constant sUSD_RF = 50_00; + uint256 public constant USDC_RF = 45_00; + uint256 public constant USDP_RF = 40_00; + uint256 public constant USDT_RF = 45_00; + uint256 public constant WBTC_RF = 50_00; + uint256 public constant WETH_RF = 45_00; + + function execute() external { + POOL_CONFIGURATOR.setReserveFactor(AaveV2EthereumAssets.DAI_UNDERLYING, DAI_RF); + POOL_CONFIGURATOR.setReserveFactor(AaveV2EthereumAssets.FRAX_UNDERLYING, FRAX_RF); + POOL_CONFIGURATOR.setReserveFactor(AaveV2EthereumAssets.GUSD_UNDERLYING, GUSD_RF); + POOL_CONFIGURATOR.setReserveFactor(AaveV2EthereumAssets.LINK_UNDERLYING, LINK_RF); + POOL_CONFIGURATOR.setReserveFactor(AaveV2EthereumAssets.LUSD_UNDERLYING, LUSD_RF); + POOL_CONFIGURATOR.setReserveFactor(AaveV2EthereumAssets.sUSD_UNDERLYING, sUSD_RF); + POOL_CONFIGURATOR.setReserveFactor(AaveV2EthereumAssets.USDC_UNDERLYING, USDC_RF); + POOL_CONFIGURATOR.setReserveFactor(AaveV2EthereumAssets.USDP_UNDERLYING, USDP_RF); + POOL_CONFIGURATOR.setReserveFactor(AaveV2EthereumAssets.USDT_UNDERLYING, USDT_RF); + POOL_CONFIGURATOR.setReserveFactor(AaveV2EthereumAssets.WBTC_UNDERLYING, WBTC_RF); + POOL_CONFIGURATOR.setReserveFactor(AaveV2EthereumAssets.WETH_UNDERLYING, WETH_RF); + } +} diff --git a/src/20240411_Multi_ReserveFactorUpgrades/AaveV2Ethereum_ReserveFactorUpgrades_20240411.t.sol b/src/20240411_Multi_ReserveFactorUpgrades/AaveV2Ethereum_ReserveFactorUpgrades_20240411.t.sol new file mode 100644 index 000000000..b46008153 --- /dev/null +++ b/src/20240411_Multi_ReserveFactorUpgrades/AaveV2Ethereum_ReserveFactorUpgrades_20240411.t.sol @@ -0,0 +1,103 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV2Ethereum, AaveV2EthereumAssets} from 'aave-address-book/AaveV2Ethereum.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV2TestBase, ReserveConfig} from 'aave-helpers/ProtocolV2TestBase.sol'; +import {AaveV2Ethereum_ReserveFactorUpgrades_20240411} from './AaveV2Ethereum_ReserveFactorUpgrades_20240411.sol'; + +/** + * @dev Test for AaveV2Ethereum_ReserveFactorUpgrades_20240411 + * command: make test-contract filter=AaveV2Ethereum_ReserveFactorUpgrades_20240411 + */ +contract AaveV2Ethereum_ReserveFactorUpgrades_20240411_Test is ProtocolV2TestBase { + AaveV2Ethereum_ReserveFactorUpgrades_20240411 internal proposal; + + struct Changes { + address asset; + uint256 reserveFactor; + } + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('mainnet'), 19668943); + proposal = new AaveV2Ethereum_ReserveFactorUpgrades_20240411(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + (ReserveConfig[] memory allConfigsBefore, ReserveConfig[] memory allConfigsAfter) = defaultTest( + 'AaveV2Ethereum_ReserveFactorUpgrades_20240411', + AaveV2Ethereum.POOL, + address(proposal) + ); + + address[] memory assetsChanged = new address[](11); + assetsChanged[0] = AaveV2EthereumAssets.DAI_UNDERLYING; + assetsChanged[1] = AaveV2EthereumAssets.FRAX_UNDERLYING; + assetsChanged[2] = AaveV2EthereumAssets.GUSD_UNDERLYING; + assetsChanged[3] = AaveV2EthereumAssets.LINK_UNDERLYING; + assetsChanged[4] = AaveV2EthereumAssets.LUSD_UNDERLYING; + assetsChanged[5] = AaveV2EthereumAssets.sUSD_UNDERLYING; + assetsChanged[6] = AaveV2EthereumAssets.USDC_UNDERLYING; + assetsChanged[7] = AaveV2EthereumAssets.USDP_UNDERLYING; + assetsChanged[8] = AaveV2EthereumAssets.USDT_UNDERLYING; + assetsChanged[9] = AaveV2EthereumAssets.WBTC_UNDERLYING; + assetsChanged[10] = AaveV2EthereumAssets.WETH_UNDERLYING; + + Changes[] memory assetChanges = new Changes[](11); + assetChanges[0] = Changes({ + asset: AaveV2EthereumAssets.DAI_UNDERLYING, + reserveFactor: proposal.DAI_RF() + }); + assetChanges[1] = Changes({ + asset: AaveV2EthereumAssets.FRAX_UNDERLYING, + reserveFactor: proposal.FRAX_RF() + }); + assetChanges[2] = Changes({ + asset: AaveV2EthereumAssets.GUSD_UNDERLYING, + reserveFactor: proposal.GUSD_RF() + }); + assetChanges[3] = Changes({ + asset: AaveV2EthereumAssets.LINK_UNDERLYING, + reserveFactor: proposal.LINK_RF() + }); + assetChanges[4] = Changes({ + asset: AaveV2EthereumAssets.LUSD_UNDERLYING, + reserveFactor: proposal.LUSD_RF() + }); + assetChanges[5] = Changes({ + asset: AaveV2EthereumAssets.sUSD_UNDERLYING, + reserveFactor: proposal.sUSD_RF() + }); + assetChanges[6] = Changes({ + asset: AaveV2EthereumAssets.USDC_UNDERLYING, + reserveFactor: proposal.USDC_RF() + }); + assetChanges[7] = Changes({ + asset: AaveV2EthereumAssets.USDP_UNDERLYING, + reserveFactor: proposal.USDP_RF() + }); + assetChanges[8] = Changes({ + asset: AaveV2EthereumAssets.USDT_UNDERLYING, + reserveFactor: proposal.USDT_RF() + }); + assetChanges[9] = Changes({ + asset: AaveV2EthereumAssets.WBTC_UNDERLYING, + reserveFactor: proposal.WBTC_RF() + }); + assetChanges[10] = Changes({ + asset: AaveV2EthereumAssets.WETH_UNDERLYING, + reserveFactor: proposal.WETH_RF() + }); + + _noReservesConfigsChangesApartFrom(allConfigsBefore, allConfigsAfter, assetsChanged); + + for (uint i = 0; i < assetChanges.length; i++) { + ReserveConfig memory cfg = _findReserveConfig(allConfigsAfter, assetChanges[i].asset); + assertEq(cfg.reserveFactor, assetChanges[i].reserveFactor); + } + } +} diff --git a/src/20240411_Multi_ReserveFactorUpgrades/ReserveFactorUpgrades.md b/src/20240411_Multi_ReserveFactorUpgrades/ReserveFactorUpgrades.md new file mode 100644 index 000000000..1c4ebde39 --- /dev/null +++ b/src/20240411_Multi_ReserveFactorUpgrades/ReserveFactorUpgrades.md @@ -0,0 +1,61 @@ +--- +title: "Reserve Factor Updates" +author: "karpatkey_TokenLogic" +discussions: "https://governance.aave.com/t/arfc-ethereum-v2-reserve-factor-adjustment/16764/7" +snapshot: "https://snapshot.org/#/aave.eth/proposal/0x26a03c08359c340f63b78b0c3e96d37aa0adeda65814643b0886d4719048ea7e" +--- + +## Simple Summary + +This AIP is composed of two actions: (1) a continuation of proposal 73 on Governance V3 that increases the Reserve Factor (RF) for assets on Ethereum V2 by 5.00%, up to a maximum of 99.99%; and (2) to start periodically increasing the RF across Avalanche V2. + +## Motivation + +This AIP will reduce deposit yield for assets on Ethereum & Avalanche V2 by increasing the RF. With this upgrade being passed, users will be further encouraged to migrate from Ethereum V2 to V3. + +Increasing the RF routes a larger portion of the interest paid by users to Aave DAO's Treasury. User's funds are not at risk of liquidation and the borrowing rate remains unchanged. + +Of the assets with an RF set at 99.99%, there is no change. All other asset reserves will have the RF increased by up to 5.00%. + +## Specification + +For Ethereum V2, the following parameters are to be updated as follows: + +| Asset | Previous Reserve Factor | New Reserve Factor | +| :---: | :---------------------: | :----------------: | +| DAI | 40.00% | 45.00% | +| FRAX | 45.00% | 50.00% | +| GUSD | 35.00% | 40.00% | +| LINK | 45.00% | 50.00% | +| LUSD | 40.00% | 45.00% | +| sUSD | 45.00% | 50.00% | +| USDC | 40.00% | 45.00% | +| USDP | 35.00% | 40.00% | +| USDT | 40.00% | 45.00% | +| WBTC | 45.00% | 50.00% | +| WETH | 40.00% | 45.00% | + +For Avalanche V2, the following parameters are to be updated as follows: + +| Asset | Previous Reserve Factor | New Reserve Factor | +| :---: | :---------------------: | :----------------: | +| DAIe | 35.00% | 40.00% | +| USDCe | 35.00% | 40.00% | +| USDTe | 35.00% | 40.00% | +| WAVAX | 35.00% | 40.00% | +| WBTCe | 40.00% | 45.00% | +| WETHe | 35.00% | 40.00% | + +## References + +- Implementation: [AaveV2Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240411_Multi_ReserveFactorUpgrades/AaveV2Ethereum_ReserveFactorUpgrades_20240411.sol), [AaveV2Avalanche](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240411_Multi_ReserveFactorUpgrades/AaveV2Avalanche_ReserveFactorUpgrades_20240411.sol) +- Tests: [AaveV2Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240411_Multi_ReserveFactorUpgrades/AaveV2Ethereum_ReserveFactorUpgrades_20240411.t.sol), [AaveV2Avalanche](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240411_Multi_ReserveFactorUpgrades/AaveV2Avalanche_ReserveFactorUpgrades_20240411.t.sol) +- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0x26a03c08359c340f63b78b0c3e96d37aa0adeda65814643b0886d4719048ea7e) +- [Discussion for Ethereum Reserve Factor Updates](https://governance.aave.com/t/arfc-ethereum-v2-reserve-factor-adjustment/16764/7) +- [Snapshot for Ethereum Reserve Factor Updates](https://snapshot.org/#/aave.eth/proposal/0x26a03c08359c340f63b78b0c3e96d37aa0adeda65814643b0886d4719048ea7e) +- [Discussion for Avalanche Reserve Factor Updates](https://governance.aave.com/t/arfc-avalanche-v2-reserve-factor-adjustment/17040/3) +- [Snapshot for Avalanche Reserve Factor Updates](https://snapshot.org/#/aave.eth/proposal/0x770ff4e02634c77aaa09952345551168920f7878b32ab03fcef92763a5fb70ab) + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). diff --git a/src/20240411_Multi_ReserveFactorUpgrades/ReserveFactorUpgrades_20240411.s.sol b/src/20240411_Multi_ReserveFactorUpgrades/ReserveFactorUpgrades_20240411.s.sol new file mode 100644 index 000000000..1b555300e --- /dev/null +++ b/src/20240411_Multi_ReserveFactorUpgrades/ReserveFactorUpgrades_20240411.s.sol @@ -0,0 +1,88 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/GovV3Helpers.sol'; +import {EthereumScript, AvalancheScript} from 'aave-helpers/ScriptUtils.sol'; +import {AaveV2Ethereum_ReserveFactorUpgrades_20240411} from './AaveV2Ethereum_ReserveFactorUpgrades_20240411.sol'; +import {AaveV2Avalanche_ReserveFactorUpgrades_20240411} from './AaveV2Avalanche_ReserveFactorUpgrades_20240411.sol'; + +/** + * @dev Deploy Ethereum + * deploy-command: make deploy-ledger contract=src/20240411_Multi_ReserveFactorUpgrades/ReserveFactorUpgrades_20240411.s.sol:DeployEthereum chain=mainnet + * verify-command: npx catapulta-verify -b broadcast/ReserveFactorUpgrades_20240411.s.sol/1/run-latest.json + */ +contract DeployEthereum is EthereumScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV2Ethereum_ReserveFactorUpgrades_20240411).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Avalanche + * deploy-command: make deploy-ledger contract=src/20240411_Multi_ReserveFactorUpgrades/ReserveFactorUpgrades_20240411.s.sol:DeployAvalanche chain=avalanche + * verify-command: npx catapulta-verify -b broadcast/ReserveFactorUpgrades_20240411.s.sol/43114/run-latest.json + */ +contract DeployAvalanche is AvalancheScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV2Avalanche_ReserveFactorUpgrades_20240411).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Create Proposal + * command: make deploy-ledger contract=src/20240411_Multi_ReserveFactorUpgrades/ReserveFactorUpgrades_20240411.s.sol:CreateProposal chain=mainnet + */ +contract CreateProposal is EthereumScript { + function run() external { + // create payloads + PayloadsControllerUtils.Payload[] memory payloads = new PayloadsControllerUtils.Payload[](2); + + // compose actions for validation + IPayloadsControllerCore.ExecutionAction[] + memory actionsEthereum = new IPayloadsControllerCore.ExecutionAction[](1); + actionsEthereum[0] = GovV3Helpers.buildAction( + type(AaveV2Ethereum_ReserveFactorUpgrades_20240411).creationCode + ); + payloads[0] = GovV3Helpers.buildMainnetPayload(vm, actionsEthereum); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsAvalanche = new IPayloadsControllerCore.ExecutionAction[](1); + actionsAvalanche[0] = GovV3Helpers.buildAction( + type(AaveV2Avalanche_ReserveFactorUpgrades_20240411).creationCode + ); + payloads[1] = GovV3Helpers.buildAvalanchePayload(vm, actionsAvalanche); + + // create proposal + vm.startBroadcast(); + GovV3Helpers.createProposal( + vm, + payloads, + GovV3Helpers.ipfsHashFile( + vm, + 'src/20240411_Multi_ReserveFactorUpgrades/ReserveFactorUpgrades.md' + ) + ); + } +} diff --git a/src/20240411_Multi_ReserveFactorUpgrades/config.ts b/src/20240411_Multi_ReserveFactorUpgrades/config.ts new file mode 100644 index 000000000..a912f9597 --- /dev/null +++ b/src/20240411_Multi_ReserveFactorUpgrades/config.ts @@ -0,0 +1,17 @@ +import {ConfigFile} from '../../generator/types'; +export const config: ConfigFile = { + rootOptions: { + pools: ['AaveV2Ethereum', 'AaveV2Avalanche'], + title: 'Reserve Factor Upgrades', + shortName: 'ReserveFactorUpgrades', + date: '20240411', + author: 'karpatkey_TokenLogic', + discussion: 'https://governance.aave.com/t/arfc-ethereum-v2-reserve-factor-adjustment/16764/7', + snapshot: + 'https://snapshot.org/#/aave.eth/proposal/0x26a03c08359c340f63b78b0c3e96d37aa0adeda65814643b0886d4719048ea7e', + }, + poolOptions: { + AaveV2Ethereum: {configs: {OTHERS: {}}, cache: {blockNumber: 19668943}}, + AaveV2Avalanche: {configs: {OTHERS: {}}, cache: {blockNumber: 44280713}}, + }, +};