diff --git a/diffs/AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210_before_AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210_after.md b/diffs/AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210_before_AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210_after.md new file mode 100644 index 000000000..b3d087f7b --- /dev/null +++ b/diffs/AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210_before_AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210_after.md @@ -0,0 +1,38 @@ +## Reserve changes + +### Reserve altered + +#### USDC ([0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174](https://polygonscan.com/address/0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174)) + +| description | value before | value after | +| --- | --- | --- | +| ltv | 75 % [7500] | 0 % [0] | + + +#### DAI ([0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063](https://polygonscan.com/address/0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063)) + +| description | value before | value after | +| --- | --- | --- | +| ltv | 63 % [6300] | 0 % [0] | + + +## Raw diff + +```json +{ + "reserves": { + "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174": { + "ltv": { + "from": 7500, + "to": 0 + } + }, + "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063": { + "ltv": { + "from": 6300, + "to": 0 + } + } + } +} +``` \ No newline at end of file diff --git a/diffs/AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210_before_AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210_after.md b/diffs/AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210_before_AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210_after.md new file mode 100644 index 000000000..ee482a109 --- /dev/null +++ b/diffs/AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210_before_AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210_after.md @@ -0,0 +1,225 @@ +## Reserve changes + +### Reserve altered + +#### USDC ([0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174](https://polygonscan.com/address/0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174)) + +| description | value before | value after | +| --- | --- | --- | +| ltv | 75 % [7500] | 0 % [0] | +| reserveFactor | 50 % [5000] | 60 % [6000] | + + +#### USDC ([0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359](https://polygonscan.com/address/0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359)) + +| description | value before | value after | +| --- | --- | --- | +| ltv | 75 % [7500] | 0 % [0] | +| reserveFactor | 10 % [1000] | 20 % [2000] | + + +#### DAI ([0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063](https://polygonscan.com/address/0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063)) + +| description | value before | value after | +| --- | --- | --- | +| ltv | 63 % [6300] | 0 % [0] | + + +#### USDT ([0xc2132D05D31c914a87C6611C10748AEb04B58e8F](https://polygonscan.com/address/0xc2132D05D31c914a87C6611C10748AEb04B58e8F)) + +| description | value before | value after | +| --- | --- | --- | +| ltv | 75 % [7500] | 0 % [0] | +| reserveFactor | 10 % [1000] | 25 % [2500] | + + +## Raw diff + +```json +{ + "reserves": { + "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174": { + "ltv": { + "from": 7500, + "to": 0 + }, + "reserveFactor": { + "from": 5000, + "to": 6000 + } + }, + "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359": { + "ltv": { + "from": 7500, + "to": 0 + }, + "reserveFactor": { + "from": 1000, + "to": 2000 + } + }, + "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063": { + "ltv": { + "from": 6300, + "to": 0 + } + }, + "0xc2132D05D31c914a87C6611C10748AEb04B58e8F": { + "ltv": { + "from": 7500, + "to": 0 + }, + "reserveFactor": { + "from": 1000, + "to": 2500 + } + } + }, + "raw": { + "0x401b5d0294e23637c18fcc38b1bca814cda2637c": { + "label": null, + "balanceDiff": null, + "stateDiff": {} + }, + "0x4816b2c2895f97fb918f1ae7da403750a0ee372e": { + "label": null, + "balanceDiff": null, + "stateDiff": {} + }, + "0x56076f960980d453b5b749cb6a1c4d2e4e138b1a": { + "label": null, + "balanceDiff": null, + "stateDiff": {} + }, + "0x5dfb8c777c19d3cedcdc7398d2eef1fb0b9b05c9": { + "label": null, + "balanceDiff": null, + "stateDiff": { + "0x436c14203ee76e79d5652d508249351bf2aad2332f57381e04c70b85c9582d7c": { + "previousValue": "0x100000000000000000000103e8005f5e1000055d4a8003e8850629041e781d4c", + "newValue": "0x100000000000000000000103e8005f5e1000055d4a8007d0850629041e780000" + }, + "0x436c14203ee76e79d5652d508249351bf2aad2332f57381e04c70b85c9582d7d": { + "previousValue": "0x0000000000246c52f2ace581a52b1f5600000000038b0d191d5a36fa9d00fa41", + "newValue": "0x0000000000206049fa7b258aa3a23ffd00000000038b0d1fc13552e54123060b" + }, + "0x436c14203ee76e79d5652d508249351bf2aad2332f57381e04c70b85c9582d7e": { + "previousValue": "0x00000000003b71ab36075b30854e1b2d00000000039ea09d22cc626b9ab7a966", + "newValue": "0x00000000003b71ab700f8625823aad5200000000039ea0a834e7d15060411f18" + }, + "0x436c14203ee76e79d5652d508249351bf2aad2332f57381e04c70b85c9582d7f": { + "previousValue": "0x00000000000000000000140067b385a100000000000000000000000000000000", + "newValue": "0x00000000000000000000140067b385f100000000000000000000000000000000" + }, + "0x436c14203ee76e79d5652d508249351bf2aad2332f57381e04c70b85c9582d84": { + "previousValue": "0x00000000000000000000000000000000000000000000000000000000670ffb4b", + "newValue": "0x000000000000000000000000000000000000000000000000000000006719a2ee" + }, + "0x5086f8006fb47d4e8b7d07ce95e816ef3f62d9d614c3cca018dfb9c36698b59e": { + "previousValue": "0x100000000000000000000103e8002dc6c0000297c1e01388a50629041e781d4c", + "newValue": "0x100000000000000000000103e8002dc6c0000297c1e01770a50629041e780000" + }, + "0x5086f8006fb47d4e8b7d07ce95e816ef3f62d9d614c3cca018dfb9c36698b59f": { + "previousValue": "0x00000000002178eb64e8f1abb0fa30780000000003aa66ed8aa4e72f5a1e8426", + "newValue": "0x00000000001ac722cb7c3d6e91c056570000000003aa66f10384e44ad2853053" + }, + "0x5086f8006fb47d4e8b7d07ce95e816ef3f62d9d614c3cca018dfb9c36698b5a0": { + "previousValue": "0x0000000000506080eb973e13c79d85240000000003f7557ad7d2819cfd1205e0", + "newValue": "0x00000000005060810a24b0050392e6f60000000003f75583dd426c09300517a5" + }, + "0x5086f8006fb47d4e8b7d07ce95e816ef3f62d9d614c3cca018dfb9c36698b5a1": { + "previousValue": "0x00000000000000000000020067b385c500000000000000000000000000000000", + "newValue": "0x00000000000000000000020067b385f100000000000000000000000000000000" + }, + "0x5086f8006fb47d4e8b7d07ce95e816ef3f62d9d614c3cca018dfb9c36698b5a6": { + "previousValue": "0x00000000000000000000000000000000000000000000000000000000940ababf", + "newValue": "0x00000000000000000000000000000000000000000000000000000000941223a1" + }, + "0x7bdd64832954533ce1bb06477375d759a0b8390bd9a186c07915b18bf5315b0c": { + "previousValue": "0x100000000000000000000103e80055d4a8000510ff4003e8a50629041e781d4c", + "newValue": "0x100000000000000000000103e80055d4a8000510ff4009c4a50629041e780000" + }, + "0x7bdd64832954533ce1bb06477375d759a0b8390bd9a186c07915b18bf5315b0d": { + "previousValue": "0x000000000026cf2696a263bcea3321a20000000003c2e779000b731984a16157", + "newValue": "0x000000000020574b6a9c43d829c690960000000003c2e78bc6e4e0ea1e8b7da5" + }, + "0x7bdd64832954533ce1bb06477375d759a0b8390bd9a186c07915b18bf5315b0e": { + "previousValue": "0x00000000003d5c35957354c276952aa50000000003f00b6f78a5677ea864f1cc", + "newValue": "0x00000000003d5c362567e52e1438ade00000000003f00b8e8cea9c74b3ce8cd0" + }, + "0x7bdd64832954533ce1bb06477375d759a0b8390bd9a186c07915b18bf5315b0f": { + "previousValue": "0x00000000000000000000050067b3852900000000000000000000000000000000", + "newValue": "0x00000000000000000000050067b385f100000000000000000000000000000000" + }, + "0x7bdd64832954533ce1bb06477375d759a0b8390bd9a186c07915b18bf5315b14": { + "previousValue": "0x0000000000000000000000000000000000000000000000000000000076f3b737", + "newValue": "0x00000000000000000000000000000000000000000000000000000000770f62ad" + }, + "0x9690560edd96b8ad42bbefadc2405558072125d86547c092bfe966b61dcb42f5": { + "previousValue": "0x100000000000000000000103e8002aea540001c9c38009c4a51229041e14189c", + "newValue": "0x100000000000000000000103e8002aea540001c9c38009c4a51229041e140000" + } + } + }, + "0x794a61358d6845594f94dc1db02a252b5b4814ad": { + "label": null, + "balanceDiff": null, + "stateDiff": {} + }, + "0x79b5e91037ae441de0d9e6fd3fd85b96b83d4e93": { + "label": null, + "balanceDiff": null, + "stateDiff": {} + }, + "0x8145edddf43f50276641b55bd3ad95944510021e": { + "label": null, + "balanceDiff": null, + "stateDiff": {} + }, + "0xa72636cbcaa8f5ff95b2cc47f3cdee83f3294a0b": { + "label": null, + "balanceDiff": null, + "stateDiff": {} + }, + "0xa97684ead0e402dc232d5a977953df7ecbab3cdb": { + "label": null, + "balanceDiff": null, + "stateDiff": {} + }, + "0xb962dcd6d9f0bfb4cb2936c6c5e5c7c3f0d3c778": { + "label": null, + "balanceDiff": null, + "stateDiff": { + "0x6b16ef514f22b74729cbea5cc7babfecbdc2309e530ca716643d11fe929eed2e": { + "previousValue": "0x0067b385f0000000000002000000000000000000000000000000000000000000", + "newValue": "0x0067b385f0000000000003000000000000000000000000000000000000000000" + }, + "0x6b16ef514f22b74729cbea5cc7babfecbdc2309e530ca716643d11fe929eed2f": { + "previousValue": "0x000000000000000000093a8000000000000067e1aa7100000000000000000000", + "newValue": "0x000000000000000000093a8000000000000067e1aa7100000000000067b385f1" + } + } + }, + "0xdf7d0e6454db638881302729f5ba99936eaab233": { + "label": null, + "balanceDiff": null, + "stateDiff": {} + }, + "0xe701126012ec0290822eea17b794454d1af8b030": { + "label": null, + "balanceDiff": null, + "stateDiff": {} + }, + "0xfb00ac187a8eb5afae4eace434f493eb62672df7": { + "label": null, + "balanceDiff": null, + "stateDiff": {} + }, + "0xfccf3cabbe80101232d343252614b6a3ee81c989": { + "label": null, + "balanceDiff": null, + "stateDiff": {} + } + } +} +``` \ No newline at end of file diff --git a/lib/aave-helpers b/lib/aave-helpers index b4f5861ab..2ddee4d46 160000 --- a/lib/aave-helpers +++ b/lib/aave-helpers @@ -1 +1 @@ -Subproject commit b4f5861abd9897356205fefd6cae7c7a93bcb805 +Subproject commit 2ddee4d460e8a50a5f91e6fc0ce7294828298408 diff --git a/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.sol b/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.sol new file mode 100644 index 000000000..7f21455e0 --- /dev/null +++ b/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; +import {AaveV2Polygon, AaveV2PolygonAssets} from 'aave-address-book/AaveV2Polygon.sol'; +/** + * @title Adjust Risk Parameters for Aave V2 and V3 on Polygon + * @author Aave-chan Initiative + * - Snapshot: https://snapshot.box/#/s:aave.eth/proposal/0x48cb2ca277c9cfa0855e8561878836eea182e45dea0e140c03786e533519c2dc + * - Discussion: https://governance.aave.com/t/arfc-adjust-risk-parameters-for-aave-v2-and-v3-on-polygon/20211 + */ +contract AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210 is + IProposalGenericExecutor +{ + function execute() external { + AaveV2Polygon.POOL_CONFIGURATOR.configureReserveAsCollateral( + AaveV2PolygonAssets.USDC_UNDERLYING, + 0, + 8450, + 10500 + ); + + AaveV2Polygon.POOL_CONFIGURATOR.configureReserveAsCollateral( + AaveV2PolygonAssets.DAI_UNDERLYING, + 0, + 7700, + 10500 + ); + } +} diff --git a/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.t.sol b/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.t.sol new file mode 100644 index 000000000..c071fa3ef --- /dev/null +++ b/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.t.sol @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV2Polygon} from 'aave-address-book/AaveV2Polygon.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV2TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV2TestBase.sol'; +import {AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210} from './AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.sol'; + +/** + * @dev Test for AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210 + * command: FOUNDRY_PROFILE=polygon forge test --match-path=src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.t.sol -vv + */ +contract AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210_Test is + ProtocolV2TestBase +{ + AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('polygon'), 68044431); + proposal = new AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210', + AaveV2Polygon.POOL, + address(proposal) + ); + } +} diff --git a/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.sol b/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.sol new file mode 100644 index 000000000..661ae6a08 --- /dev/null +++ b/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.sol @@ -0,0 +1,97 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3PolygonAssets} from 'aave-address-book/AaveV3Polygon.sol'; +import {AaveV3PayloadPolygon} from 'aave-helpers/src/v3-config-engine/AaveV3PayloadPolygon.sol'; +import {EngineFlags} from 'aave-v3-origin/contracts/extensions/v3-config-engine/EngineFlags.sol'; +import {IAaveV3ConfigEngine} from 'aave-v3-origin/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol'; +/** + * @title Adjust Risk Parameters for Aave V2 and V3 on Polygon + * @author Aave-chan Initiative + * - Snapshot: https://snapshot.box/#/s:aave.eth/proposal/0x48cb2ca277c9cfa0855e8561878836eea182e45dea0e140c03786e533519c2dc + * - Discussion: https://governance.aave.com/t/arfc-adjust-risk-parameters-for-aave-v2-and-v3-on-polygon/20211 + */ +contract AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210 is + AaveV3PayloadPolygon +{ + function collateralsUpdates() + public + pure + override + returns (IAaveV3ConfigEngine.CollateralUpdate[] memory) + { + IAaveV3ConfigEngine.CollateralUpdate[] + memory collateralUpdate = new IAaveV3ConfigEngine.CollateralUpdate[](4); + + collateralUpdate[0] = IAaveV3ConfigEngine.CollateralUpdate({ + asset: AaveV3PolygonAssets.DAI_UNDERLYING, + ltv: 0, + liqThreshold: EngineFlags.KEEP_CURRENT, + liqBonus: EngineFlags.KEEP_CURRENT, + debtCeiling: EngineFlags.KEEP_CURRENT, + liqProtocolFee: EngineFlags.KEEP_CURRENT + }); + collateralUpdate[1] = IAaveV3ConfigEngine.CollateralUpdate({ + asset: AaveV3PolygonAssets.USDC_UNDERLYING, + ltv: 0, + liqThreshold: EngineFlags.KEEP_CURRENT, + liqBonus: EngineFlags.KEEP_CURRENT, + debtCeiling: EngineFlags.KEEP_CURRENT, + liqProtocolFee: EngineFlags.KEEP_CURRENT + }); + collateralUpdate[2] = IAaveV3ConfigEngine.CollateralUpdate({ + asset: AaveV3PolygonAssets.USDT_UNDERLYING, + ltv: 0, + liqThreshold: EngineFlags.KEEP_CURRENT, + liqBonus: EngineFlags.KEEP_CURRENT, + debtCeiling: EngineFlags.KEEP_CURRENT, + liqProtocolFee: EngineFlags.KEEP_CURRENT + }); + collateralUpdate[3] = IAaveV3ConfigEngine.CollateralUpdate({ + asset: AaveV3PolygonAssets.USDCn_UNDERLYING, + ltv: 0, + liqThreshold: EngineFlags.KEEP_CURRENT, + liqBonus: EngineFlags.KEEP_CURRENT, + debtCeiling: EngineFlags.KEEP_CURRENT, + liqProtocolFee: EngineFlags.KEEP_CURRENT + }); + + return collateralUpdate; + } + function borrowsUpdates() + public + pure + override + returns (IAaveV3ConfigEngine.BorrowUpdate[] memory) + { + IAaveV3ConfigEngine.BorrowUpdate[] + memory borrowUpdates = new IAaveV3ConfigEngine.BorrowUpdate[](3); + + borrowUpdates[0] = IAaveV3ConfigEngine.BorrowUpdate({ + asset: AaveV3PolygonAssets.USDC_UNDERLYING, + enabledToBorrow: EngineFlags.KEEP_CURRENT, + flashloanable: EngineFlags.KEEP_CURRENT, + borrowableInIsolation: EngineFlags.KEEP_CURRENT, + withSiloedBorrowing: EngineFlags.KEEP_CURRENT, + reserveFactor: 60_00 + }); + borrowUpdates[1] = IAaveV3ConfigEngine.BorrowUpdate({ + asset: AaveV3PolygonAssets.USDT_UNDERLYING, + enabledToBorrow: EngineFlags.KEEP_CURRENT, + flashloanable: EngineFlags.KEEP_CURRENT, + borrowableInIsolation: EngineFlags.KEEP_CURRENT, + withSiloedBorrowing: EngineFlags.KEEP_CURRENT, + reserveFactor: 25_00 + }); + borrowUpdates[2] = IAaveV3ConfigEngine.BorrowUpdate({ + asset: AaveV3PolygonAssets.USDCn_UNDERLYING, + enabledToBorrow: EngineFlags.KEEP_CURRENT, + flashloanable: EngineFlags.KEEP_CURRENT, + borrowableInIsolation: EngineFlags.KEEP_CURRENT, + withSiloedBorrowing: EngineFlags.KEEP_CURRENT, + reserveFactor: 20_00 + }); + + return borrowUpdates; + } +} diff --git a/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.t.sol b/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.t.sol new file mode 100644 index 000000000..f1db85f1f --- /dev/null +++ b/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.t.sol @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Polygon} from 'aave-address-book/AaveV3Polygon.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210} from './AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.sol'; + +/** + * @dev Test for AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210 + * command: FOUNDRY_PROFILE=polygon forge test --match-path=src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.t.sol -vv + */ +contract AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210_Test is + ProtocolV3TestBase +{ + AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('polygon'), 68044431); + proposal = new AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210', + AaveV3Polygon.POOL, + address(proposal) + ); + } +} diff --git a/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AdjustRiskParametersForAaveV2AndV3OnPolygon.md b/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AdjustRiskParametersForAaveV2AndV3OnPolygon.md new file mode 100644 index 000000000..904307c99 --- /dev/null +++ b/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AdjustRiskParametersForAaveV2AndV3OnPolygon.md @@ -0,0 +1,64 @@ +--- +title: "Adjust Risk Parameters for Aave V2 and V3 on Polygon" +author: "Aave-chan Initiative" +discussions: "https://governance.aave.com/t/arfc-adjust-risk-parameters-for-aave-v2-and-v3-on-polygon/20211" +snapshot: "https://snapshot.box/#/s:aave.eth/proposal/0x48cb2ca277c9cfa0855e8561878836eea182e45dea0e140c03786e533519c2dc" +--- + +## Simple Summary + +This proposal will update the risk parameters for Aave V2 and V3 instances on the Polygon network. The adjustments are in response to an upcoming proposal that will significantly impact the risk profiles of bridged assets within the Polygon network. + +## Motivation + +Polygon governance was evaluating [a proposal](https://forum.polygon.technology/t/pre-pip-polygon-pos-bridge-liquidity-program/20284) that would redefine the risk profile of bridged assets on the Polygon network. This change could have substantial implications for the risk profiles of Aave V2 and V3 deployments on Polygon PoS. + +Historically, bridge vulnerabilities have caused the largest losses in the DeFi ecosystem, including: + +1. [Ronin](https://rekt.news/ronin-rekt/) - $624M +2. [BNB “Bridge”](https://rekt.news/bnb-bridge-rekt/) - $586M +3. [Wormhole](https://rekt.news/wormhole-rekt/) - $326M +4. [Nomad](https://rekt.news/nomad-rekt/) - $190M +5. [Multichain](https://rekt.news/multichain-rekt2/) - $126M +6. [Harmony](https://rekt.news/harmony-rekt/) - $100M + +The Aave ecosystem has experienced both indirect and direct impacts from bridge vulnerabilities, notably the Multichain and Harmony bridge hacks. Additionally, depositing user funds into unsafe protocols has historically resulted in significant losses. For example, the Angle Protocol deposited EURA funds into Euler a week before its hack, which caused EURA to lose its peg temporarily, impacting Aave users. + +This AIP aims to mitigate potential losses for Aave users by: + +1. Soliciting immediate feedback from risk service providers (@ChaosLabs and @LlamaRisk) to determine appropriate adjustments to risk parameters. +2. Engaging @TokenLogic to design a user position migration initiative, leveraging Merit (rewards for closing positions on Polygon and reopening equivalent positions on other networks). +3. Inviting L2 networks interested in attracting Aave Polygon users to participate in Merit co-incentive programs. + +> Sonic team announced a 20m$ incentives plan for their [TEMP CHECK](https://governance.aave.com/t/temp-check-deploy-aave-v3-on-sonic/20259) with 10% allocated for migration incentives. + +4. Seeking feedback from @bgdlabs to migrate Aave Governance V3 voting infrastructure to a more secure L2 network. +5. Requesting support from @AaveLabs to develop front-end migration tools and provide Merit support for a seamless user experience. + +## Specification + +The following recommendations are proposed to mitigate risk and incentivize migration from the Polygon network: + +@ChaosLabs recommend the following risk parameters change: + +| Deployment | Asset | Current LTV | Proposed LTV | Current RF | Proposed RF | +| ---------- | ------ | ----------- | ------------ | ---------- | ----------- | +| Polygon V3 | DAI | 63% | 0% | 25% | - | +| Polygon V3 | USDC.e | 75% | 0% | 50% | 60% | +| Polygon V3 | USDT | 75% | 0% | 10% | 25% | +| Polygon V3 | USDC | 75% | 0% | 10% | 20% | +| Polygon V2 | USDC.e | 75% | 0% | 99.9% | - | +| Polygon V2 | DAI | 63% | 0% | 99.9% | - | + +2. Remove support for Aave V3 Polygon in the Safety Module and cancel the umbrella deployment on Polygon. + +## References + +- Implementation: [AaveV2Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.sol), [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.sol) +- Tests: [AaveV2Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.t.sol), [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.t.sol) +- [Snapshot](https://snapshot.box/#/s:aave.eth/proposal/0x48cb2ca277c9cfa0855e8561878836eea182e45dea0e140c03786e533519c2dc) +- [Discussion](https://governance.aave.com/t/arfc-adjust-risk-parameters-for-aave-v2-and-v3-on-polygon/20211) + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). diff --git a/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.s.sol b/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.s.sol new file mode 100644 index 000000000..7e0ebf38a --- /dev/null +++ b/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.s.sol @@ -0,0 +1,68 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/src/GovV3Helpers.sol'; +import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol'; +import {EthereumScript, PolygonScript} from 'solidity-utils/contracts/utils/ScriptUtils.sol'; +import {AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210} from './AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.sol'; +import {AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210} from './AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.sol'; + +/** + * @dev Deploy Polygon + * deploy-command: make deploy-ledger contract=src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.s.sol:DeployPolygon chain=polygon + * verify-command: FOUNDRY_PROFILE=polygon npx catapulta-verify -b broadcast/AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.s.sol/137/run-latest.json + */ +contract DeployPolygon is PolygonScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210).creationCode + ); + address payload1 = GovV3Helpers.deployDeterministic( + type(AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](2); + actions[0] = GovV3Helpers.buildAction(payload0); + actions[1] = GovV3Helpers.buildAction(payload1); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Create Proposal + * command: make deploy-ledger contract=src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210.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 actionsPolygon = new IPayloadsControllerCore.ExecutionAction[](2); + actionsPolygon[0] = GovV3Helpers.buildAction( + type(AaveV2Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210).creationCode + ); + actionsPolygon[1] = GovV3Helpers.buildAction( + type(AaveV3Polygon_AdjustRiskParametersForAaveV2AndV3OnPolygon_20250210).creationCode + ); + payloads[0] = GovV3Helpers.buildPolygonPayload(vm, actionsPolygon); + + // create proposal + vm.startBroadcast(); + GovV3Helpers.createProposal( + vm, + payloads, + GovernanceV3Ethereum.VOTING_PORTAL_ETH_POL, + GovV3Helpers.ipfsHashFile( + vm, + 'src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/AdjustRiskParametersForAaveV2AndV3OnPolygon.md' + ) + ); + } +} diff --git a/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/config.ts b/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/config.ts new file mode 100644 index 000000000..eb2894079 --- /dev/null +++ b/src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/config.ts @@ -0,0 +1,86 @@ +import {ConfigFile} from '../../generator/types'; +export const config: ConfigFile = { + rootOptions: { + configFile: 'src/20250210_Multi_AdjustRiskParametersForAaveV2AndV3OnPolygon/config.ts', + force: true, + update: true, + author: 'Aave-chan Initiative', + pools: ['AaveV2Polygon', 'AaveV3Polygon'], + title: 'Adjust Risk Parameters for Aave V2 and V3 on Polygon', + shortName: 'AdjustRiskParametersForAaveV2AndV3OnPolygon', + date: '20250210', + discussion: + 'https://governance.aave.com/t/arfc-adjust-risk-parameters-for-aave-v2-and-v3-on-polygon/20211', + snapshot: + 'https://snapshot.box/#/s:aave.eth/proposal/0x48cb2ca277c9cfa0855e8561878836eea182e45dea0e140c03786e533519c2dc', + votingNetwork: 'POLYGON', + }, + poolOptions: { + AaveV2Polygon: {configs: {OTHERS: {}}, cache: {blockNumber: 68044431}}, + AaveV3Polygon: { + configs: { + COLLATERALS_UPDATE: [ + { + asset: 'DAI', + ltv: '0', + liqThreshold: '', + liqBonus: '', + debtCeiling: '', + liqProtocolFee: '', + }, + { + asset: 'USDC', + ltv: '0', + liqThreshold: '', + liqBonus: '', + debtCeiling: '', + liqProtocolFee: '', + }, + { + asset: 'USDT', + ltv: '0', + liqThreshold: '', + liqBonus: '', + debtCeiling: '', + liqProtocolFee: '', + }, + { + asset: 'USDCn', + ltv: '0', + liqThreshold: '', + liqBonus: '', + debtCeiling: '', + liqProtocolFee: '', + }, + ], + BORROWS_UPDATE: [ + { + enabledToBorrow: 'KEEP_CURRENT', + flashloanable: 'KEEP_CURRENT', + borrowableInIsolation: 'KEEP_CURRENT', + withSiloedBorrowing: 'KEEP_CURRENT', + reserveFactor: '60', + asset: 'USDC', + }, + { + enabledToBorrow: 'KEEP_CURRENT', + flashloanable: 'KEEP_CURRENT', + borrowableInIsolation: 'KEEP_CURRENT', + withSiloedBorrowing: 'KEEP_CURRENT', + reserveFactor: '25', + asset: 'USDT', + }, + { + enabledToBorrow: 'KEEP_CURRENT', + flashloanable: 'KEEP_CURRENT', + borrowableInIsolation: 'KEEP_CURRENT', + withSiloedBorrowing: 'KEEP_CURRENT', + reserveFactor: '20', + asset: 'USDCn', + }, + ], + }, + cache: {blockNumber: 68044431}, + }, + }, +};