From 9a651a89b364d8b676e418397bb578e7bccfa433 Mon Sep 17 00:00:00 2001 From: yonikesel Date: Sun, 12 Nov 2023 17:21:10 +0200 Subject: [PATCH 1/2] Update Caps on Gnosis + add support for Gnosis --- Makefile | 1 + ...1112_post_gnosis_caps_increase_20231112.md | 92 +++++++++++++++++++ foundry.toml | 1 + lib/aave-address-book | 2 +- lib/aave-helpers | 2 +- lib/forge-std | 2 +- scripts/CapsPlusRiskStewardGnosis.s.sol | 10 ++ src/GnosisCapsIncrease_20231112.s.sol | 60 ++++++++++++ 8 files changed, 167 insertions(+), 3 deletions(-) create mode 100644 diffs/pre_gnosis_caps_increase_20231112_post_gnosis_caps_increase_20231112.md create mode 100644 scripts/CapsPlusRiskStewardGnosis.s.sol create mode 100644 src/GnosisCapsIncrease_20231112.s.sol diff --git a/Makefile b/Makefile index 808df32..d2dfdee 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,7 @@ optimism-contract:; forge script ${contract_path} --rpc-url optimism --sig "run( arbitrum-contract:; forge script ${contract_path} --rpc-url arbitrum --sig "run(bool)" false -vv metis-contract:; forge script ${contract_path} --rpc-url metis --sig "run(bool)" false -vv base-contract:; forge script ${contract_path} --rpc-url base --sig "run(bool)" false -vv +gnosis-contract:; forge script ${contract_path} --rpc-url gnosis --sig "run(bool)" false -vv # only emit mainnet-example:; forge script src/MainnetExample.s.sol:MainnetExample --rpc-url mainnet --sig "run(bool)" false -vv diff --git a/diffs/pre_gnosis_caps_increase_20231112_post_gnosis_caps_increase_20231112.md b/diffs/pre_gnosis_caps_increase_20231112_post_gnosis_caps_increase_20231112.md new file mode 100644 index 0000000..885bd68 --- /dev/null +++ b/diffs/pre_gnosis_caps_increase_20231112_post_gnosis_caps_increase_20231112.md @@ -0,0 +1,92 @@ +## Reserve changes + +### Reserve altered + +#### wstETH ([0x6C76971f98945AE98dD7d4DFcA8711ebea946eA6](https://blockscout.com/xdai/mainnet/address/0x6C76971f98945AE98dD7d4DFcA8711ebea946eA6)) + +| description | value before | value after | +| --- | --- | --- | +| supplyCap | 4,000 wstETH | 5,000 wstETH | + + +#### USDC ([0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83](https://blockscout.com/xdai/mainnet/address/0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83)) + +| description | value before | value after | +| --- | --- | --- | +| supplyCap | 1,000,000 USDC | 2,000,000 USDC | +| borrowCap | 1,000,000 USDC | 1,800,000 USDC | + + +#### sDAI ([0xaf204776c7245bF4147c2612BF6e5972Ee483701](https://blockscout.com/xdai/mainnet/address/0xaf204776c7245bF4147c2612BF6e5972Ee483701)) + +| description | value before | value after | +| --- | --- | --- | +| supplyCap | 1,500,000 sDAI | 3,000,000 sDAI | + + +#### EURe ([0xcB444e90D8198415266c6a2724b7900fb12FC56E](https://blockscout.com/xdai/mainnet/address/0xcB444e90D8198415266c6a2724b7900fb12FC56E)) + +| description | value before | value after | +| --- | --- | --- | +| supplyCap | 500,000 EURe | 1,000,000 EURe | +| borrowCap | 500,000 EURe | 900,000 EURe | + + +#### WXDAI ([0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d](https://blockscout.com/xdai/mainnet/address/0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d)) + +| description | value before | value after | +| --- | --- | --- | +| supplyCap | 1,500,000 WXDAI | 3,000,000 WXDAI | +| borrowCap | 1,500,000 WXDAI | 2,700,000 WXDAI | + + +## Raw diff + +```json +{ + "reserves": { + "0x6C76971f98945AE98dD7d4DFcA8711ebea946eA6": { + "supplyCap": { + "from": 4000, + "to": 5000 + } + }, + "0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83": { + "borrowCap": { + "from": 1000000, + "to": 1800000 + }, + "supplyCap": { + "from": 1000000, + "to": 2000000 + } + }, + "0xaf204776c7245bF4147c2612BF6e5972Ee483701": { + "supplyCap": { + "from": 1500000, + "to": 3000000 + } + }, + "0xcB444e90D8198415266c6a2724b7900fb12FC56E": { + "borrowCap": { + "from": 500000, + "to": 900000 + }, + "supplyCap": { + "from": 500000, + "to": 1000000 + } + }, + "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d": { + "borrowCap": { + "from": 1500000, + "to": 2700000 + }, + "supplyCap": { + "from": 1500000, + "to": 3000000 + } + } + } +} +``` \ No newline at end of file diff --git a/foundry.toml b/foundry.toml index b474197..f58dfe6 100644 --- a/foundry.toml +++ b/foundry.toml @@ -19,6 +19,7 @@ fantom = "${RPC_FANTOM}" harmony = "${RPC_HARMONY}" metis = "${RPC_METIS}" base = "${RPC_BASE}" +gnosis = "${RPC_GNOSIS}" [etherscan] mainnet = { key="${ETHERSCAN_API_KEY_MAINNET}", chainId=1 } diff --git a/lib/aave-address-book b/lib/aave-address-book index 5f2424a..ceaac85 160000 --- a/lib/aave-address-book +++ b/lib/aave-address-book @@ -1 +1 @@ -Subproject commit 5f2424a89e4174914b397351eaeb56376748f913 +Subproject commit ceaac85c9b4eadc68295211fb194e3641215ca7c diff --git a/lib/aave-helpers b/lib/aave-helpers index 8460740..a4676d2 160000 --- a/lib/aave-helpers +++ b/lib/aave-helpers @@ -1 +1 @@ -Subproject commit 84607407f1d29791a4e4bcb6bcb33990e67d7b4a +Subproject commit a4676d29ce2e017ffa6d89da51d1eeb545f555b7 diff --git a/lib/forge-std b/lib/forge-std index 1d9650e..37a37ab 160000 --- a/lib/forge-std +++ b/lib/forge-std @@ -1 +1 @@ -Subproject commit 1d9650e951204a0ddce9ff89c32f1997984cef4d +Subproject commit 37a37ab73364d6644bfe11edf88a07880f99bd56 diff --git a/scripts/CapsPlusRiskStewardGnosis.s.sol b/scripts/CapsPlusRiskStewardGnosis.s.sol new file mode 100644 index 0000000..34e1853 --- /dev/null +++ b/scripts/CapsPlusRiskStewardGnosis.s.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveGovernanceV2} from 'aave-address-book/AaveGovernanceV2.sol'; +import {AaveV3Gnosis} from 'aave-address-book/AaveV3Gnosis.sol'; +import {CapsPlusRiskStewardBase} from './CapsPlusRiskStewardBase.s.sol'; + +abstract contract CapsPlusRiskStewardGnosis is CapsPlusRiskStewardBase { + constructor() CapsPlusRiskStewardBase(AaveV3Gnosis.POOL, AaveV3Gnosis.CAPS_PLUS_RISK_STEWARD) {} +} diff --git a/src/GnosisCapsIncrease_20231112.s.sol b/src/GnosisCapsIncrease_20231112.s.sol new file mode 100644 index 0000000..aca7b13 --- /dev/null +++ b/src/GnosisCapsIncrease_20231112.s.sol @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3GnosisAssets} from 'aave-address-book/AaveV3Gnosis.sol'; +import {IAaveV3ConfigEngine} from 'aave-helpers/v3-config-engine/IAaveV3ConfigEngine.sol'; +import {EngineFlags} from 'aave-helpers/v3-config-engine/EngineFlags.sol'; +import {CapsPlusRiskStewardGnosis} from '../scripts/CapsPlusRiskStewardGnosis.s.sol'; + +/** + * @title Update Caps on Gnosis V3 + * @author Chaos Labs + * - Discussion: https://governance.aave.com/t/arfc-chaos-labs-risk-stewards-increase-supply-and-borrow-caps-on-v3-gnosis-11-10-2023/15469 + */ +contract GnosisCapsIncrease_20231112 is CapsPlusRiskStewardGnosis { + /** + * @return string name identifier used for the diff + */ + function name() internal pure override returns (string memory) { + return 'gnosis_caps_increase_20231112'; + } + + /** + * @return IAaveV3ConfigEngine.CapsUpdate[] capUpdates to be performed + */ + function capsUpdates() internal pure override returns (IAaveV3ConfigEngine.CapsUpdate[] memory) { + IAaveV3ConfigEngine.CapsUpdate[] memory capUpdates = new IAaveV3ConfigEngine.CapsUpdate[](5); + + capUpdates[0] = IAaveV3ConfigEngine.CapsUpdate( + AaveV3GnosisAssets.wstETH_UNDERLYING, + 5_000, + EngineFlags.KEEP_CURRENT + ); + + capUpdates[1] = IAaveV3ConfigEngine.CapsUpdate( + AaveV3GnosisAssets.WXDAI_UNDERLYING, + 3_000_000, + 2_700_000 + ); + + capUpdates[2] = IAaveV3ConfigEngine.CapsUpdate( + AaveV3GnosisAssets.sDAI_UNDERLYING, + 3_000_000, + EngineFlags.KEEP_CURRENT + ); + + capUpdates[3] = IAaveV3ConfigEngine.CapsUpdate( + AaveV3GnosisAssets.USDC_UNDERLYING, + 2_000_000, + 1_800_000 + ); + + capUpdates[4] = IAaveV3ConfigEngine.CapsUpdate( + AaveV3GnosisAssets.EURe_UNDERLYING, + 1_000_000, + 900_000 + ); + + return capUpdates; + } +} From 6e3e75421dedd54e8040407b74a2da97de5e23bd Mon Sep 17 00:00:00 2001 From: yonikesel Date: Tue, 14 Nov 2023 18:09:43 +0200 Subject: [PATCH 2/2] Update caps --- ...1112_post_gnosis_caps_increase_20231112.md | 24 +++++++++---------- src/GnosisCapsIncrease_20231112.s.sol | 12 +++++----- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/diffs/pre_gnosis_caps_increase_20231112_post_gnosis_caps_increase_20231112.md b/diffs/pre_gnosis_caps_increase_20231112_post_gnosis_caps_increase_20231112.md index 885bd68..f389e04 100644 --- a/diffs/pre_gnosis_caps_increase_20231112_post_gnosis_caps_increase_20231112.md +++ b/diffs/pre_gnosis_caps_increase_20231112_post_gnosis_caps_increase_20231112.md @@ -13,8 +13,8 @@ | description | value before | value after | | --- | --- | --- | -| supplyCap | 1,000,000 USDC | 2,000,000 USDC | -| borrowCap | 1,000,000 USDC | 1,800,000 USDC | +| supplyCap | 1,000,000 USDC | 1,500,000 USDC | +| borrowCap | 1,000,000 USDC | 1,500,000 USDC | #### sDAI ([0xaf204776c7245bF4147c2612BF6e5972Ee483701](https://blockscout.com/xdai/mainnet/address/0xaf204776c7245bF4147c2612BF6e5972Ee483701)) @@ -28,16 +28,16 @@ | description | value before | value after | | --- | --- | --- | -| supplyCap | 500,000 EURe | 1,000,000 EURe | -| borrowCap | 500,000 EURe | 900,000 EURe | +| supplyCap | 500,000 EURe | 750,000 EURe | +| borrowCap | 500,000 EURe | 750,000 EURe | #### WXDAI ([0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d](https://blockscout.com/xdai/mainnet/address/0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d)) | description | value before | value after | | --- | --- | --- | -| supplyCap | 1,500,000 WXDAI | 3,000,000 WXDAI | -| borrowCap | 1,500,000 WXDAI | 2,700,000 WXDAI | +| supplyCap | 1,500,000 WXDAI | 2,300,000 WXDAI | +| borrowCap | 1,500,000 WXDAI | 2,300,000 WXDAI | ## Raw diff @@ -54,11 +54,11 @@ "0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83": { "borrowCap": { "from": 1000000, - "to": 1800000 + "to": 1500000 }, "supplyCap": { "from": 1000000, - "to": 2000000 + "to": 1500000 } }, "0xaf204776c7245bF4147c2612BF6e5972Ee483701": { @@ -70,21 +70,21 @@ "0xcB444e90D8198415266c6a2724b7900fb12FC56E": { "borrowCap": { "from": 500000, - "to": 900000 + "to": 750000 }, "supplyCap": { "from": 500000, - "to": 1000000 + "to": 750000 } }, "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d": { "borrowCap": { "from": 1500000, - "to": 2700000 + "to": 2300000 }, "supplyCap": { "from": 1500000, - "to": 3000000 + "to": 2300000 } } } diff --git a/src/GnosisCapsIncrease_20231112.s.sol b/src/GnosisCapsIncrease_20231112.s.sol index aca7b13..094fc6c 100644 --- a/src/GnosisCapsIncrease_20231112.s.sol +++ b/src/GnosisCapsIncrease_20231112.s.sol @@ -33,8 +33,8 @@ contract GnosisCapsIncrease_20231112 is CapsPlusRiskStewardGnosis { capUpdates[1] = IAaveV3ConfigEngine.CapsUpdate( AaveV3GnosisAssets.WXDAI_UNDERLYING, - 3_000_000, - 2_700_000 + 2_300_000, + 2_300_000 ); capUpdates[2] = IAaveV3ConfigEngine.CapsUpdate( @@ -45,14 +45,14 @@ contract GnosisCapsIncrease_20231112 is CapsPlusRiskStewardGnosis { capUpdates[3] = IAaveV3ConfigEngine.CapsUpdate( AaveV3GnosisAssets.USDC_UNDERLYING, - 2_000_000, - 1_800_000 + 1_500_000, + 1_500_000 ); capUpdates[4] = IAaveV3ConfigEngine.CapsUpdate( AaveV3GnosisAssets.EURe_UNDERLYING, - 1_000_000, - 900_000 + 750_000, + 750_000 ); return capUpdates;