From 4561c226205110d166e1485d184293db5fdb3fa5 Mon Sep 17 00:00:00 2001 From: eyalovadya <38078004+eyalovadya@users.noreply.github.com> Date: Mon, 5 Feb 2024 15:16:00 +0200 Subject: [PATCH] [Chaos Labs] Ethereum V2 LT Reductions (#197) * Ethereum V2 LT Reductions * Fix title * Update src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/ChaosLabsV2EthereumLTReductions.md Co-authored-by: Lukas --------- Co-authored-by: Lukas --- ...bsV2EthereumLTReductions_20240201_after.md | 90 +++++++++++++++++++ ...aosLabsV2EthereumLTReductions_20240201.sol | 57 ++++++++++++ ...sLabsV2EthereumLTReductions_20240201.t.sol | 89 ++++++++++++++++++ .../ChaosLabsV2EthereumLTReductions.md | 45 ++++++++++ ...sLabsV2EthereumLTReductions_20240201.s.sol | 58 ++++++++++++ .../config.ts | 13 +++ 6 files changed, 352 insertions(+) create mode 100644 diffs/AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201_before_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201_after.md create mode 100644 src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201.sol create mode 100644 src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201.t.sol create mode 100644 src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/ChaosLabsV2EthereumLTReductions.md create mode 100644 src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/ChaosLabsV2EthereumLTReductions_20240201.s.sol create mode 100644 src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/config.ts diff --git a/diffs/AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201_before_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201_after.md b/diffs/AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201_before_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201_after.md new file mode 100644 index 000000000..9e142f5a5 --- /dev/null +++ b/diffs/AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201_before_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201_after.md @@ -0,0 +1,90 @@ +## Reserve changes + +### Reserve altered + +#### UNI ([0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984](https://etherscan.io/address/0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984)) + +| description | value before | value after | +| --- | --- | --- | +| liquidationThreshold | 20 % | 14 % | + + +#### LINK ([0x514910771AF9Ca656af840dff83E8264EcF986CA](https://etherscan.io/address/0x514910771AF9Ca656af840dff83E8264EcF986CA)) + +| description | value before | value after | +| --- | --- | --- | +| liquidationThreshold | 74 % | 72 % | + + +#### MKR ([0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2](https://etherscan.io/address/0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2)) + +| description | value before | value after | +| --- | --- | --- | +| liquidationThreshold | 18 % | 14 % | + + +#### ENS ([0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72](https://etherscan.io/address/0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72)) + +| description | value before | value after | +| --- | --- | --- | +| liquidationThreshold | 24 % | 0.05 % | + + +#### CRV ([0xD533a949740bb3306d119CC777fa900bA034cd52](https://etherscan.io/address/0xD533a949740bb3306d119CC777fa900bA034cd52)) + +| description | value before | value after | +| --- | --- | --- | +| liquidationThreshold | 18 % | 14 % | + + +#### ZRX ([0xE41d2489571d322189246DaFA5ebDe1F4699F498](https://etherscan.io/address/0xE41d2489571d322189246DaFA5ebDe1F4699F498)) + +| description | value before | value after | +| --- | --- | --- | +| liquidationThreshold | 12 % | 8 % | + + +## Raw diff + +```json +{ + "reserves": { + "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984": { + "liquidationThreshold": { + "from": 2000, + "to": 1400 + } + }, + "0x514910771AF9Ca656af840dff83E8264EcF986CA": { + "liquidationThreshold": { + "from": 7400, + "to": 7200 + } + }, + "0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2": { + "liquidationThreshold": { + "from": 1800, + "to": 1400 + } + }, + "0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72": { + "liquidationThreshold": { + "from": 2400, + "to": 5 + } + }, + "0xD533a949740bb3306d119CC777fa900bA034cd52": { + "liquidationThreshold": { + "from": 1800, + "to": 1400 + } + }, + "0xE41d2489571d322189246DaFA5ebDe1F4699F498": { + "liquidationThreshold": { + "from": 1200, + "to": 800 + } + } + } +} +``` \ No newline at end of file diff --git a/src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201.sol b/src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201.sol new file mode 100644 index 000000000..c44a7dd56 --- /dev/null +++ b/src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201.sol @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; +import {AaveV2Ethereum, AaveV2EthereumAssets} from 'aave-address-book/AaveV2Ethereum.sol'; + +/** + * @title Chaos Labs V2 Ethereum LT Reductions + * @author Chaos Labs - Eyal Ovadya + * - Snapshot: No snapshot for Direct-to-AIP + * - Discussion: https://governance.aave.com/t/arfc-v2-ethereum-lt-reductions-01-30-2024/16468 + */ +contract AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201 is IProposalGenericExecutor { + function execute() external { + AaveV2Ethereum.POOL_CONFIGURATOR.configureReserveAsCollateral( + AaveV2EthereumAssets.CRV_UNDERLYING, + 0, + 14_00, + 108_00 + ); + + AaveV2Ethereum.POOL_CONFIGURATOR.configureReserveAsCollateral( + AaveV2EthereumAssets.ENS_UNDERLYING, + 0, + 5, + 108_00 + ); + + AaveV2Ethereum.POOL_CONFIGURATOR.configureReserveAsCollateral( + AaveV2EthereumAssets.LINK_UNDERLYING, + 0, + 72_00, + 107_00 + ); + + AaveV2Ethereum.POOL_CONFIGURATOR.configureReserveAsCollateral( + AaveV2EthereumAssets.MKR_UNDERLYING, + 0, + 14_00, + 107_50 + ); + + AaveV2Ethereum.POOL_CONFIGURATOR.configureReserveAsCollateral( + AaveV2EthereumAssets.UNI_UNDERLYING, + 0, + 14_00, + 109_00 + ); + + AaveV2Ethereum.POOL_CONFIGURATOR.configureReserveAsCollateral( + AaveV2EthereumAssets.ZRX_UNDERLYING, + 0, + 8_00, + 110_00 + ); + } +} diff --git a/src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201.t.sol b/src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201.t.sol new file mode 100644 index 000000000..8e052b427 --- /dev/null +++ b/src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201.t.sol @@ -0,0 +1,89 @@ +// 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_ChaosLabsV2EthereumLTReductions_20240201} from './AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201.sol'; + +/** + * @dev Test for AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201 + * command: make test-contract filter=AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201 + */ +contract AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201_Test is ProtocolV2TestBase { + AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('mainnet'), 19133686); + proposal = new AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + (ReserveConfig[] memory allConfigsBefore, ReserveConfig[] memory allConfigsAfter) = defaultTest( + 'AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201', + AaveV2Ethereum.POOL, + address(proposal) + ); + + address[] memory assetsChanged = new address[](6); + + assetsChanged[0] = AaveV2EthereumAssets.CRV_UNDERLYING; + assetsChanged[1] = AaveV2EthereumAssets.ENS_UNDERLYING; + assetsChanged[2] = AaveV2EthereumAssets.LINK_UNDERLYING; + assetsChanged[3] = AaveV2EthereumAssets.MKR_UNDERLYING; + assetsChanged[4] = AaveV2EthereumAssets.UNI_UNDERLYING; + assetsChanged[5] = AaveV2EthereumAssets.ZRX_UNDERLYING; + + _noReservesConfigsChangesApartFrom(allConfigsBefore, allConfigsAfter, assetsChanged); + + { + ReserveConfig memory CRV_UNDERLYING_CONFIG = _findReserveConfig( + allConfigsBefore, + AaveV2EthereumAssets.CRV_UNDERLYING + ); + CRV_UNDERLYING_CONFIG.liquidationThreshold = 14_00; + _validateReserveConfig(CRV_UNDERLYING_CONFIG, allConfigsAfter); + + ReserveConfig memory ENS_UNDERLYING_CONFIG = _findReserveConfig( + allConfigsBefore, + AaveV2EthereumAssets.ENS_UNDERLYING + ); + ENS_UNDERLYING_CONFIG.liquidationThreshold = 5; + _validateReserveConfig(ENS_UNDERLYING_CONFIG, allConfigsAfter); + + ReserveConfig memory LINK_UNDERLYING_CONFIG = _findReserveConfig( + allConfigsBefore, + AaveV2EthereumAssets.LINK_UNDERLYING + ); + LINK_UNDERLYING_CONFIG.liquidationThreshold = 72_00; + _validateReserveConfig(LINK_UNDERLYING_CONFIG, allConfigsAfter); + } + + { + ReserveConfig memory MKR_UNDERLYING_CONFIG = _findReserveConfig( + allConfigsBefore, + AaveV2EthereumAssets.MKR_UNDERLYING + ); + MKR_UNDERLYING_CONFIG.liquidationThreshold = 14_00; + _validateReserveConfig(MKR_UNDERLYING_CONFIG, allConfigsAfter); + + ReserveConfig memory UNI_UNDERLYING_CONFIG = _findReserveConfig( + allConfigsBefore, + AaveV2EthereumAssets.UNI_UNDERLYING + ); + UNI_UNDERLYING_CONFIG.liquidationThreshold = 14_00; + _validateReserveConfig(UNI_UNDERLYING_CONFIG, allConfigsAfter); + + ReserveConfig memory ZRX_UNDERLYING_CONFIG = _findReserveConfig( + allConfigsBefore, + AaveV2EthereumAssets.ZRX_UNDERLYING + ); + ZRX_UNDERLYING_CONFIG.liquidationThreshold = 8_00; + _validateReserveConfig(ZRX_UNDERLYING_CONFIG, allConfigsAfter); + } + } +} diff --git a/src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/ChaosLabsV2EthereumLTReductions.md b/src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/ChaosLabsV2EthereumLTReductions.md new file mode 100644 index 000000000..10fe01be2 --- /dev/null +++ b/src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/ChaosLabsV2EthereumLTReductions.md @@ -0,0 +1,45 @@ +--- +title: "V2 Ethereum LT Reductions" +author: "Chaos Labs - Eyal Ovadya" +discussions: "https://governance.aave.com/t/arfc-v2-ethereum-lt-reductions-01-30-2024/16468" +--- + +## Simple Summary + +A proposal to reduce Liquidation Thresholds on Aave V2 Ethereum. + +## Motivation + +Following the v2 deprecation framework, Chaos Labs and Gauntlet advise implementing the subsequent parameter changes to the frozen assets on Aave v2 Ethereum and Polygon + +As Liquidation Threshold reductions may lead to user accounts being eligible for liquidations upon their approval, we want to clarify the full implications to the community at each step. We will publicly communicate the planned amendments and list of affected accounts leading to the on-chain execution. + +## Specification + +Chaos and Gauntlet align on following recommendations, choosing the higher value between Gauntlet’s aggressive and Chaos’s moderate approach for each asset: + +##### Aave v2 Ethereum + +| Asset | Current LT | Recommended LT | +| ----- | ---------- | -------------- | +| CRV | 18% | 14% | +| ENS | 24% | 0.05% | +| LINK | 74% | 72% | +| MKR | 18% | 14% | +| UNI | 20% | 14% | +| ZRX | 12% | 8% | + +| | Value liquidated | Accounts liquidated | +| ----- | ---------------- | ------------------- | +| Total | $67,480 | 47 | + +## References + +- Implementation: [AaveV2Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201.sol) +- Tests: [AaveV2Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201.t.sol) +- [Snapshot](No snapshot for Direct-to-AIP) +- [Discussion](https://governance.aave.com/t/arfc-v2-ethereum-lt-reductions-01-30-2024/16468) + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). diff --git a/src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/ChaosLabsV2EthereumLTReductions_20240201.s.sol b/src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/ChaosLabsV2EthereumLTReductions_20240201.s.sol new file mode 100644 index 000000000..ff4dd00cb --- /dev/null +++ b/src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/ChaosLabsV2EthereumLTReductions_20240201.s.sol @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/GovV3Helpers.sol'; +import {EthereumScript} from 'aave-helpers/ScriptUtils.sol'; +import {AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201} from './AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201.sol'; + +/** + * @dev Deploy Ethereum + * deploy-command: make deploy-ledger contract=src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/ChaosLabsV2EthereumLTReductions_20240201.s.sol:DeployEthereum chain=mainnet + * verify-command: npx catapulta-verify -b broadcast/ChaosLabsV2EthereumLTReductions_20240201.s.sol/1/run-latest.json + */ +contract DeployEthereum is EthereumScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201).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/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/ChaosLabsV2EthereumLTReductions_20240201.s.sol:CreateProposal chain=mainnet + */ +contract CreateProposal is EthereumScript { + function run() external { + // create payloads + PayloadsControllerUtils.Payload[] memory payloads = new PayloadsControllerUtils.Payload[](1); + + // compose actions for validation + IPayloadsControllerCore.ExecutionAction[] + memory actionsEthereum = new IPayloadsControllerCore.ExecutionAction[](1); + actionsEthereum[0] = GovV3Helpers.buildAction( + type(AaveV2Ethereum_ChaosLabsV2EthereumLTReductions_20240201).creationCode + ); + payloads[0] = GovV3Helpers.buildMainnetPayload(vm, actionsEthereum); + + // create proposal + vm.startBroadcast(); + GovV3Helpers.createProposal( + vm, + payloads, + GovV3Helpers.ipfsHashFile( + vm, + 'src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/ChaosLabsV2EthereumLTReductions.md' + ) + ); + } +} diff --git a/src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/config.ts b/src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/config.ts new file mode 100644 index 000000000..e9ee0a688 --- /dev/null +++ b/src/20240201_AaveV2Ethereum_ChaosLabsV2EthereumLTReductions/config.ts @@ -0,0 +1,13 @@ +import {ConfigFile} from '../../generator/types'; +export const config: ConfigFile = { + rootOptions: { + author: 'Chaos Labs - Eyal Ovadya', + pools: ['AaveV2Ethereum'], + title: 'Chaos Labs V2 Ethereum LT Reductions', + discussion: 'https://governance.aave.com/t/arfc-v2-ethereum-lt-reductions-01-30-2024/16468', + shortName: 'ChaosLabsV2EthereumLTReductions', + date: '20240201', + snapshot: 'No snapshot for Direct-to-AIP', + }, + poolOptions: {AaveV2Ethereum: {configs: {OTHERS: {}}, cache: {blockNumber: 19133686}}}, +};