From 00f9976403bc979a03cd37ff573d6f352eec52a2 Mon Sep 17 00:00:00 2001 From: marczeller Date: Tue, 28 May 2024 11:00:19 +0000 Subject: [PATCH 1/3] onboard USDe --- ...ff7054b21a6d938826bbea32b5e589c6a0c8f7.svg | 1 + ...3865a243e2110291617da971e6614d404cd2c5.svg | 1 + ...nboardUSDeAaveV3Ethereum_20240528_after.md | 134 ++++++++++++++++++ ...eum_OnboardUSDeAaveV3Ethereum_20240528.sol | 64 +++++++++ ...m_OnboardUSDeAaveV3Ethereum_20240528.t.sol | 42 ++++++ .../OnboardUSDeAaveV3Ethereum.md | 57 ++++++++ .../OnboardUSDeAaveV3Ethereum_20240528.s.sol | 61 ++++++++ .../config.ts | 54 +++++++ 8 files changed, 414 insertions(+) create mode 100644 .assets/a2ff7054b21a6d938826bbea32b5e589c6a0c8f7.svg create mode 100644 .assets/c73865a243e2110291617da971e6614d404cd2c5.svg create mode 100644 diffs/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_before_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_after.md create mode 100644 src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.sol create mode 100644 src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.t.sol create mode 100644 src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/OnboardUSDeAaveV3Ethereum.md create mode 100644 src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/OnboardUSDeAaveV3Ethereum_20240528.s.sol create mode 100644 src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/config.ts diff --git a/.assets/a2ff7054b21a6d938826bbea32b5e589c6a0c8f7.svg b/.assets/a2ff7054b21a6d938826bbea32b5e589c6a0c8f7.svg new file mode 100644 index 000000000..514bc6bd2 --- /dev/null +++ b/.assets/a2ff7054b21a6d938826bbea32b5e589c6a0c8f7.svg @@ -0,0 +1 @@ + Borrow APR, variableBorrow APR, stable0%25%50%75%100%0%50%100%uOptimal 80%uOptimal 80% \ No newline at end of file diff --git a/.assets/c73865a243e2110291617da971e6614d404cd2c5.svg b/.assets/c73865a243e2110291617da971e6614d404cd2c5.svg new file mode 100644 index 000000000..be739493a --- /dev/null +++ b/.assets/c73865a243e2110291617da971e6614d404cd2c5.svg @@ -0,0 +1 @@ + Borrow APR, variableBorrow APR, stable0%25%50%75%100%0%5%10%uOptimal 0%uOptimal 0% \ No newline at end of file diff --git a/diffs/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_before_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_after.md b/diffs/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_before_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_after.md new file mode 100644 index 000000000..ab41c23c2 --- /dev/null +++ b/diffs/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_before_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_after.md @@ -0,0 +1,134 @@ +## Reserve changes + +### Reserves added + +#### USDe ([0x4c9EDD5852cd905f086C759E8383e09bff1E68B3](https://etherscan.io/address/0x4c9EDD5852cd905f086C759E8383e09bff1E68B3)) + +| description | value | +| --- | --- | +| decimals | 18 | +| isActive | true | +| isFrozen | false | +| supplyCap | 80,000,000 USDe | +| borrowCap | 72,000,000 USDe | +| debtCeiling | 0 $ | +| isSiloed | false | +| isFlashloanable | true | +| eModeCategory | 0 | +| oracle | [0x55B6C4D3E8A27b8A1F5a263321b602e0fdEEcC17](https://etherscan.io/address/0x55B6C4D3E8A27b8A1F5a263321b602e0fdEEcC17) | +| oracleDecimals | 8 | +| oracleDescription | Capped USDe / USD | +| oracleLatestAnswer | 1.00035492 | +| usageAsCollateralEnabled | true | +| ltv | 72 % | +| liquidationThreshold | 75 % | +| liquidationBonus | 8.5 % | +| liquidationProtocolFee | 10 % | +| reserveFactor | 25 % | +| aToken | [0x4F5923Fc5FD4a93352581b38B7cD26943012DECF](https://etherscan.io/address/0x4F5923Fc5FD4a93352581b38B7cD26943012DECF) | +| aTokenImpl | [0x7EfFD7b47Bfd17e52fB7559d3f924201b9DbfF3d](https://etherscan.io/address/0x7EfFD7b47Bfd17e52fB7559d3f924201b9DbfF3d) | +| variableDebtToken | [0x015396E1F286289aE23a762088E863b3ec465145](https://etherscan.io/address/0x015396E1F286289aE23a762088E863b3ec465145) | +| variableDebtTokenImpl | [0xaC725CB59D16C81061BDeA61041a8A5e73DA9EC6](https://etherscan.io/address/0xaC725CB59D16C81061BDeA61041a8A5e73DA9EC6) | +| stableDebtToken | [0x43Cc8AD0c223b38D9c04802bB184A2D97e497D38](https://etherscan.io/address/0x43Cc8AD0c223b38D9c04802bB184A2D97e497D38) | +| stableDebtTokenImpl | [0x15C5620dfFaC7c7366EED66C20Ad222DDbB1eD57](https://etherscan.io/address/0x15C5620dfFaC7c7366EED66C20Ad222DDbB1eD57) | +| borrowingEnabled | true | +| stableBorrowRateEnabled | false | +| isBorrowableInIsolation | false | +| interestRateStrategy | [0x4011fcd421b9E90f131B164EC1d162DBE269621C](https://etherscan.io/address/0x4011fcd421b9E90f131B164EC1d162DBE269621C) | +| liquidityIndex | 1 | +| variableBorrowIndex | 1 | +| aTokenName | Aave Ethereum USDe | +| aTokenSymbol | aEthUSDe | +| currentLiquidityRate | 0 % | +| currentVariableBorrowRate | 0 % | +| isPaused | false | +| stableDebtTokenName | Aave Ethereum Stable Debt USDe | +| stableDebtTokenSymbol | stableDebtEthUSDe | +| variableDebtTokenName | Aave Ethereum Variable Debt USDe | +| variableDebtTokenSymbol | variableDebtEthUSDe | +| optimalUsageRatio | 80 % | +| maxExcessStableToTotalDebtRatio | 100 % | +| maxExcessUsageRatio | 20 % | +| optimalStableToTotalDebtRatio | 0 % | +| baseVariableBorrowRate | 0 % | +| variableRateSlope1 | 9 % | +| variableRateSlope2 | 75 % | +| baseStableBorrowRate | 9 % | +| stableRateSlope1 | 9 % | +| stableRateSlope2 | 75 % | +| interestRate | ![ir](/.assets/a2ff7054b21a6d938826bbea32b5e589c6a0c8f7.svg) | + + +## Raw diff + +```json +{ + "reserves": { + "0x4c9EDD5852cd905f086C759E8383e09bff1E68B3": { + "from": null, + "to": { + "aToken": "0x4F5923Fc5FD4a93352581b38B7cD26943012DECF", + "aTokenImpl": "0x7EfFD7b47Bfd17e52fB7559d3f924201b9DbfF3d", + "aTokenName": "Aave Ethereum USDe", + "aTokenSymbol": "aEthUSDe", + "borrowCap": 72000000, + "borrowingEnabled": true, + "currentLiquidityRate": 0, + "currentVariableBorrowRate": 0, + "debtCeiling": 0, + "decimals": 18, + "eModeCategory": 0, + "interestRateStrategy": "0x4011fcd421b9E90f131B164EC1d162DBE269621C", + "isActive": true, + "isBorrowableInIsolation": false, + "isFlashloanable": true, + "isFrozen": false, + "isPaused": false, + "isSiloed": false, + "liquidationBonus": 10850, + "liquidationProtocolFee": 1000, + "liquidationThreshold": 7500, + "liquidityIndex": "1000000000000000000000000000", + "ltv": 7200, + "oracle": "0x55B6C4D3E8A27b8A1F5a263321b602e0fdEEcC17", + "oracleDecimals": 8, + "oracleDescription": "Capped USDe / USD", + "oracleLatestAnswer": 100035492, + "reserveFactor": 2500, + "stableBorrowRateEnabled": false, + "stableDebtToken": "0x43Cc8AD0c223b38D9c04802bB184A2D97e497D38", + "stableDebtTokenImpl": "0x15C5620dfFaC7c7366EED66C20Ad222DDbB1eD57", + "stableDebtTokenName": "Aave Ethereum Stable Debt USDe", + "stableDebtTokenSymbol": "stableDebtEthUSDe", + "supplyCap": 80000000, + "symbol": "USDe", + "underlying": "0x4c9EDD5852cd905f086C759E8383e09bff1E68B3", + "usageAsCollateralEnabled": true, + "variableBorrowIndex": "1000000000000000000000000000", + "variableDebtToken": "0x015396E1F286289aE23a762088E863b3ec465145", + "variableDebtTokenImpl": "0xaC725CB59D16C81061BDeA61041a8A5e73DA9EC6", + "variableDebtTokenName": "Aave Ethereum Variable Debt USDe", + "variableDebtTokenSymbol": "variableDebtEthUSDe" + } + } + }, + "strategies": { + "0x4c9EDD5852cd905f086C759E8383e09bff1E68B3": { + "from": null, + "to": { + "address": "0x4011fcd421b9E90f131B164EC1d162DBE269621C", + "baseStableBorrowRate": "90000000000000000000000000", + "baseVariableBorrowRate": 0, + "maxExcessStableToTotalDebtRatio": "1000000000000000000000000000", + "maxExcessUsageRatio": "200000000000000000000000000", + "optimalStableToTotalDebtRatio": 0, + "optimalUsageRatio": "800000000000000000000000000", + "stableRateSlope1": "90000000000000000000000000", + "stableRateSlope2": "750000000000000000000000000", + "variableRateSlope1": "90000000000000000000000000", + "variableRateSlope2": "750000000000000000000000000" + } + } + } +} +``` \ No newline at end of file diff --git a/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.sol b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.sol new file mode 100644 index 000000000..1fa4bbbf7 --- /dev/null +++ b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.sol @@ -0,0 +1,64 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Ethereum, AaveV3EthereumEModes} from 'aave-address-book/AaveV3Ethereum.sol'; +import {AaveV3PayloadEthereum} from 'aave-helpers/v3-config-engine/AaveV3PayloadEthereum.sol'; +import {EngineFlags} from 'aave-helpers/v3-config-engine/EngineFlags.sol'; +import {IAaveV3ConfigEngine} from 'aave-helpers/v3-config-engine/IAaveV3ConfigEngine.sol'; +import {IV3RateStrategyFactory} from 'aave-helpers/v3-config-engine/IV3RateStrategyFactory.sol'; +import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol'; +import {SafeERC20} from 'solidity-utils/contracts/oz-common/SafeERC20.sol'; +/** + * @title Onboard USDe Aave V3 Ethereum + * @author ACI + * - Snapshot: https://snapshot.org/#/aave.eth/proposal/0xc1b6d0d390a2dabf81206f592f740c69163dd028dcb0f50182d0ad3a50e744b0 + * - Discussion: https://governance.aave.com/t/arfc-onboard-usde-to-aave-v3-on-ethereum/17690 + */ +contract AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528 is AaveV3PayloadEthereum { + using SafeERC20 for IERC20; + + address public constant USDe = 0x4c9EDD5852cd905f086C759E8383e09bff1E68B3; + uint256 public constant USDe_SEED_AMOUNT = 1e18; + + function _postExecute() internal override { + IERC20(USDe).forceApprove(address(AaveV3Ethereum.POOL), USDe_SEED_AMOUNT); + AaveV3Ethereum.POOL.supply(USDe, USDe_SEED_AMOUNT, address(AaveV3Ethereum.COLLECTOR), 0); + } + + function newListings() public pure override returns (IAaveV3ConfigEngine.Listing[] memory) { + IAaveV3ConfigEngine.Listing[] memory listings = new IAaveV3ConfigEngine.Listing[](1); + + listings[0] = IAaveV3ConfigEngine.Listing({ + asset: USDe, + assetSymbol: 'USDe', + priceFeed: 0x55B6C4D3E8A27b8A1F5a263321b602e0fdEEcC17, + eModeCategory: AaveV3EthereumEModes.NONE, + enabledToBorrow: EngineFlags.ENABLED, + stableRateModeEnabled: EngineFlags.DISABLED, + borrowableInIsolation: EngineFlags.DISABLED, + withSiloedBorrowing: EngineFlags.DISABLED, + flashloanable: EngineFlags.ENABLED, + ltv: 72_00, + liqThreshold: 75_00, + liqBonus: 8_50, + reserveFactor: 25_00, + supplyCap: 80_000_000, + borrowCap: 72_000_000, + debtCeiling: 0, + liqProtocolFee: 10_00, + rateStrategyParams: IV3RateStrategyFactory.RateStrategyParams({ + optimalUsageRatio: _bpsToRay(80_00), + baseVariableBorrowRate: _bpsToRay(0), + variableRateSlope1: _bpsToRay(9_00), + variableRateSlope2: _bpsToRay(75_00), + stableRateSlope1: _bpsToRay(9_00), + stableRateSlope2: _bpsToRay(75_00), + baseStableRateOffset: _bpsToRay(0), + stableRateExcessOffset: _bpsToRay(0), + optimalStableToTotalDebtRatio: _bpsToRay(0) + }) + }); + + return listings; + } +} diff --git a/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.t.sol b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.t.sol new file mode 100644 index 000000000..c00839d96 --- /dev/null +++ b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.t.sol @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers} from 'aave-helpers/GovV3Helpers.sol'; +import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; +import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/ProtocolV3TestBase.sol'; +import {AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528} from './AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.sol'; + +/** + * @dev Test for AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528 + * command: FOUNDRY_PROFILE=mainnet forge test --match-path=src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.t.sol -vv + */ +contract AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_Test is ProtocolV3TestBase { + AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('mainnet'), 19967878); + proposal = new AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528', + AaveV3Ethereum.POOL, + address(proposal) + ); + } + + function test_collectorHasUSDeFunds() public { + GovV3Helpers.executePayload(vm, address(proposal)); + (address aTokenAddress, , ) = AaveV3Ethereum + .AAVE_PROTOCOL_DATA_PROVIDER + .getReserveTokensAddresses(proposal.USDe()); + assertGe(IERC20(aTokenAddress).balanceOf(address(AaveV3Ethereum.COLLECTOR)), 10 ** 18); + } +} diff --git a/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/OnboardUSDeAaveV3Ethereum.md b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/OnboardUSDeAaveV3Ethereum.md new file mode 100644 index 000000000..85312b0e9 --- /dev/null +++ b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/OnboardUSDeAaveV3Ethereum.md @@ -0,0 +1,57 @@ +--- +title: "Onboard USDe Aave V3 Ethereum" +author: "ACI" +discussions: "https://governance.aave.com/t/arfc-onboard-usde-to-aave-v3-on-ethereum/17690" +snapshot: "https://snapshot.org/#/aave.eth/proposal/0xc1b6d0d390a2dabf81206f592f740c69163dd028dcb0f50182d0ad3a50e744b0" +--- + +## Simple Summary + +This proposal seek approval for the addition of USDe to Aave V3 on Ethereum + +## Motivation + +Ethena’s synthetic dollar, USDe, provides a stable crypto-native solution for a cash and carry structured product. The staked version of USDe, sUSDe, earns yield from the protocol and has high potential for strong borrow demand. + +## Specification + +The table below illustrates the configured risk parameters for **USDe** + +| Parameter | Value | +| ---------------------------------- | -----------------------------------------: | +| Isolation Mode | true | +| Borrowable | ENABLED | +| Collateral Enabled | true | +| Supply Cap (USDe) | 80,000,000 | +| Borrow Cap (USDe) | 72,000,000 | +| Debt Ceiling | USD 0 | +| LTV | 72 % | +| LT | 75 % | +| Liquidation Bonus | 8.5 % | +| Liquidation Protocol Fee | 10 % | +| Reserve Factor | 25 % | +| Base Variable Borrow Rate | 0 % | +| Variable Slope 1 | 9 % | +| Variable Slope 2 | 75 % | +| Uoptimal | 80 % | +| Stable Borrowing | DISABLED | +| Stable Slope1 | 9 % | +| Stable Slope2 | 75 % | +| Base Stable Rate Offset | 0 % | +| Stable Rate Excess Offset | 0 % | +| Optimal Stable To Total Debt Ratio | 0 % | +| Flashloanable | ENABLED | +| Siloed Borrowing | DISABLED | +| Borrowable in Isolation | DISABLED | +| Oracle | 0x55B6C4D3E8A27b8A1F5a263321b602e0fdEEcC17 | + +## References + +- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.sol) +- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.t.sol) +- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0xc1b6d0d390a2dabf81206f592f740c69163dd028dcb0f50182d0ad3a50e744b0) +- [Discussion](https://governance.aave.com/t/arfc-onboard-usde-to-aave-v3-on-ethereum/17690) + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). diff --git a/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/OnboardUSDeAaveV3Ethereum_20240528.s.sol b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/OnboardUSDeAaveV3Ethereum_20240528.s.sol new file mode 100644 index 000000000..e8d117113 --- /dev/null +++ b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/OnboardUSDeAaveV3Ethereum_20240528.s.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/GovV3Helpers.sol'; +import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; +import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol'; +import {EthereumScript} from 'aave-helpers/ScriptUtils.sol'; +import {AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528} from './AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.sol'; + +/** + * @dev Deploy Ethereum + * deploy-command: make deploy-ledger contract=src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/OnboardUSDeAaveV3Ethereum_20240528.s.sol:DeployEthereum chain=mainnet + * verify-command: FOUNDRY_PROFILE=mainnet npx catapulta-verify -b broadcast/OnboardUSDeAaveV3Ethereum_20240528.s.sol/1/run-latest.json + */ +contract DeployEthereum is EthereumScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528).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/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/OnboardUSDeAaveV3Ethereum_20240528.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(AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528).creationCode + ); + payloads[0] = GovV3Helpers.buildMainnetPayload(vm, actionsEthereum); + + // create proposal + vm.startBroadcast(); + GovV3Helpers.createProposal( + vm, + payloads, + GovernanceV3Ethereum.VOTING_PORTAL_ETH_POL, + GovV3Helpers.ipfsHashFile( + vm, + 'src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/OnboardUSDeAaveV3Ethereum.md' + ) + ); + } +} diff --git a/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/config.ts b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/config.ts new file mode 100644 index 000000000..df6f8ee1b --- /dev/null +++ b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/config.ts @@ -0,0 +1,54 @@ +import {ConfigFile} from '../../generator/types'; +export const config: ConfigFile = { + rootOptions: { + pools: ['AaveV3Ethereum'], + title: 'Onboard USDe Aave V3 Ethereum', + shortName: 'OnboardUSDeAaveV3Ethereum', + date: '20240528', + author: 'ACI', + discussion: 'https://governance.aave.com/t/arfc-onboard-usde-to-aave-v3-on-ethereum/17690', + snapshot: + 'https://snapshot.org/#/aave.eth/proposal/0xc1b6d0d390a2dabf81206f592f740c69163dd028dcb0f50182d0ad3a50e744b0', + votingNetwork: 'POLYGON', + }, + poolOptions: { + AaveV3Ethereum: { + configs: { + ASSET_LISTING: [ + { + assetSymbol: 'USDe', + decimals: 18, + priceFeed: '0x55B6C4D3E8A27b8A1F5a263321b602e0fdEEcC17', + ltv: '72', + liqThreshold: '75', + liqBonus: '8.5', + debtCeiling: '0', + liqProtocolFee: '10', + enabledToBorrow: 'ENABLED', + flashloanable: 'ENABLED', + stableRateModeEnabled: 'DISABLED', + borrowableInIsolation: 'DISABLED', + withSiloedBorrowing: 'DISABLED', + reserveFactor: '25', + supplyCap: '80000000', + borrowCap: '72000000', + rateStrategyParams: { + optimalUtilizationRate: '80', + baseVariableBorrowRate: '0', + variableRateSlope1: '9', + variableRateSlope2: '75', + stableRateSlope1: '9', + stableRateSlope2: '75', + baseStableRateOffset: '0', + stableRateExcessOffset: '0', + optimalStableToTotalDebtRatio: '0', + }, + eModeCategory: 'AaveV3EthereumEModes.NONE', + asset: '0x4c9edd5852cd905f086c759e8383e09bff1e68b3', + }, + ], + }, + cache: {blockNumber: 19967375}, + }, + }, +}; From 5de8e3e96520b941d1cf137d0b7f617219532be2 Mon Sep 17 00:00:00 2001 From: marczeller Date: Thu, 30 May 2024 11:20:38 +0000 Subject: [PATCH 2/3] fixed debt ceiling, re-ran tests --- ...V3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_after.md | 8 ++++---- .../AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.sol | 2 +- ...aveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.t.sol | 2 +- .../OnboardUSDeAaveV3Ethereum.md | 2 +- .../config.ts | 3 ++- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/diffs/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_before_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_after.md b/diffs/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_before_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_after.md index ab41c23c2..42df271ef 100644 --- a/diffs/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_before_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_after.md +++ b/diffs/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_before_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_after.md @@ -11,14 +11,14 @@ | isFrozen | false | | supplyCap | 80,000,000 USDe | | borrowCap | 72,000,000 USDe | -| debtCeiling | 0 $ | +| debtCeiling | 40,000,000 $ | | isSiloed | false | | isFlashloanable | true | | eModeCategory | 0 | | oracle | [0x55B6C4D3E8A27b8A1F5a263321b602e0fdEEcC17](https://etherscan.io/address/0x55B6C4D3E8A27b8A1F5a263321b602e0fdEEcC17) | | oracleDecimals | 8 | | oracleDescription | Capped USDe / USD | -| oracleLatestAnswer | 1.00035492 | +| oracleLatestAnswer | 1.00079999 | | usageAsCollateralEnabled | true | | ltv | 72 % | | liquidationThreshold | 75 % | @@ -75,7 +75,7 @@ "borrowingEnabled": true, "currentLiquidityRate": 0, "currentVariableBorrowRate": 0, - "debtCeiling": 0, + "debtCeiling": 4000000000, "decimals": 18, "eModeCategory": 0, "interestRateStrategy": "0x4011fcd421b9E90f131B164EC1d162DBE269621C", @@ -93,7 +93,7 @@ "oracle": "0x55B6C4D3E8A27b8A1F5a263321b602e0fdEEcC17", "oracleDecimals": 8, "oracleDescription": "Capped USDe / USD", - "oracleLatestAnswer": 100035492, + "oracleLatestAnswer": 100079999, "reserveFactor": 2500, "stableBorrowRateEnabled": false, "stableDebtToken": "0x43Cc8AD0c223b38D9c04802bB184A2D97e497D38", diff --git a/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.sol b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.sol index 1fa4bbbf7..d20b9d0d2 100644 --- a/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.sol +++ b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.sol @@ -44,7 +44,7 @@ contract AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528 is AaveV3PayloadEther reserveFactor: 25_00, supplyCap: 80_000_000, borrowCap: 72_000_000, - debtCeiling: 0, + debtCeiling: 40_000_000, liqProtocolFee: 10_00, rateStrategyParams: IV3RateStrategyFactory.RateStrategyParams({ optimalUsageRatio: _bpsToRay(80_00), diff --git a/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.t.sol b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.t.sol index c00839d96..ef5e40169 100644 --- a/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.t.sol +++ b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.t.sol @@ -17,7 +17,7 @@ contract AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_Test is ProtocolV3Tes AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528 internal proposal; function setUp() public { - vm.createSelectFork(vm.rpcUrl('mainnet'), 19967878); + vm.createSelectFork(vm.rpcUrl('mainnet'), 19982323); proposal = new AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528(); } diff --git a/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/OnboardUSDeAaveV3Ethereum.md b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/OnboardUSDeAaveV3Ethereum.md index 85312b0e9..f44da41c4 100644 --- a/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/OnboardUSDeAaveV3Ethereum.md +++ b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/OnboardUSDeAaveV3Ethereum.md @@ -24,7 +24,7 @@ The table below illustrates the configured risk parameters for **USDe** | Collateral Enabled | true | | Supply Cap (USDe) | 80,000,000 | | Borrow Cap (USDe) | 72,000,000 | -| Debt Ceiling | USD 0 | +| Debt Ceiling | USD 40,000,000 | | LTV | 72 % | | LT | 75 % | | Liquidation Bonus | 8.5 % | diff --git a/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/config.ts b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/config.ts index df6f8ee1b..d10559ed4 100644 --- a/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/config.ts +++ b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/config.ts @@ -1,6 +1,7 @@ import {ConfigFile} from '../../generator/types'; export const config: ConfigFile = { rootOptions: { + configFile: 'src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/config.ts', pools: ['AaveV3Ethereum'], title: 'Onboard USDe Aave V3 Ethereum', shortName: 'OnboardUSDeAaveV3Ethereum', @@ -22,7 +23,7 @@ export const config: ConfigFile = { ltv: '72', liqThreshold: '75', liqBonus: '8.5', - debtCeiling: '0', + debtCeiling: '40000000', liqProtocolFee: '10', enabledToBorrow: 'ENABLED', flashloanable: 'ENABLED', From 6f0b4de9135c6f4bec98b65e7d331fab1866196e Mon Sep 17 00:00:00 2001 From: marczeller Date: Thu, 30 May 2024 11:27:33 +0000 Subject: [PATCH 3/3] fix borrow in iso --- ...AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_after.md | 4 ++-- .../AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.sol | 2 +- .../OnboardUSDeAaveV3Ethereum.md | 2 +- .../config.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/diffs/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_before_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_after.md b/diffs/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_before_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_after.md index 42df271ef..3e3bd04bc 100644 --- a/diffs/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_before_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_after.md +++ b/diffs/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_before_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528_after.md @@ -33,7 +33,7 @@ | stableDebtTokenImpl | [0x15C5620dfFaC7c7366EED66C20Ad222DDbB1eD57](https://etherscan.io/address/0x15C5620dfFaC7c7366EED66C20Ad222DDbB1eD57) | | borrowingEnabled | true | | stableBorrowRateEnabled | false | -| isBorrowableInIsolation | false | +| isBorrowableInIsolation | true | | interestRateStrategy | [0x4011fcd421b9E90f131B164EC1d162DBE269621C](https://etherscan.io/address/0x4011fcd421b9E90f131B164EC1d162DBE269621C) | | liquidityIndex | 1 | | variableBorrowIndex | 1 | @@ -80,7 +80,7 @@ "eModeCategory": 0, "interestRateStrategy": "0x4011fcd421b9E90f131B164EC1d162DBE269621C", "isActive": true, - "isBorrowableInIsolation": false, + "isBorrowableInIsolation": true, "isFlashloanable": true, "isFrozen": false, "isPaused": false, diff --git a/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.sol b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.sol index d20b9d0d2..a80bf1632 100644 --- a/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.sol +++ b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528.sol @@ -35,7 +35,7 @@ contract AaveV3Ethereum_OnboardUSDeAaveV3Ethereum_20240528 is AaveV3PayloadEther eModeCategory: AaveV3EthereumEModes.NONE, enabledToBorrow: EngineFlags.ENABLED, stableRateModeEnabled: EngineFlags.DISABLED, - borrowableInIsolation: EngineFlags.DISABLED, + borrowableInIsolation: EngineFlags.ENABLED, withSiloedBorrowing: EngineFlags.DISABLED, flashloanable: EngineFlags.ENABLED, ltv: 72_00, diff --git a/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/OnboardUSDeAaveV3Ethereum.md b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/OnboardUSDeAaveV3Ethereum.md index f44da41c4..eb27d486b 100644 --- a/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/OnboardUSDeAaveV3Ethereum.md +++ b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/OnboardUSDeAaveV3Ethereum.md @@ -42,7 +42,7 @@ The table below illustrates the configured risk parameters for **USDe** | Optimal Stable To Total Debt Ratio | 0 % | | Flashloanable | ENABLED | | Siloed Borrowing | DISABLED | -| Borrowable in Isolation | DISABLED | +| Borrowable in Isolation | ENABLED | | Oracle | 0x55B6C4D3E8A27b8A1F5a263321b602e0fdEEcC17 | ## References diff --git a/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/config.ts b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/config.ts index d10559ed4..34b29b0f6 100644 --- a/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/config.ts +++ b/src/20240528_AaveV3Ethereum_OnboardUSDeAaveV3Ethereum/config.ts @@ -28,7 +28,7 @@ export const config: ConfigFile = { enabledToBorrow: 'ENABLED', flashloanable: 'ENABLED', stableRateModeEnabled: 'DISABLED', - borrowableInIsolation: 'DISABLED', + borrowableInIsolation: 'ENABLED', withSiloedBorrowing: 'DISABLED', reserveFactor: '25', supplyCap: '80000000',