From 97f99f8f3e9a0f6b53881ab3dfd8026d55d4b120 Mon Sep 17 00:00:00 2001 From: Alice <121383428+Rozengarden@users.noreply.github.com> Date: Mon, 20 Jan 2025 12:55:55 +0100 Subject: [PATCH] [Aavechan] lbtc onboarding (#562) * feat: onboard LBTC * fix cap and bump block height * Update src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance.md Co-authored-by: Harsh Pandey * Update src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance.md Co-authored-by: Harsh Pandey * Update src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/config.ts Co-authored-by: Harsh Pandey * Update src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223.sol Co-authored-by: Ian Flexa <85500650+ianflexa@users.noreply.github.com> * Update src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance.md Co-authored-by: Ian Flexa <85500650+ianflexa@users.noreply.github.com> * typo in assetListing.ts --------- Co-authored-by: Harsh Pandey Co-authored-by: Ian Flexa <85500650+ianflexa@users.noreply.github.com> --- ...ModeOnAavev3CoreInstance_20241223_after.md | 152 ++++++++++++++++++ generator/features/assetListing.ts | 2 +- ...quidEModeOnAavev3CoreInstance_20241223.sol | 109 +++++++++++++ ...idEModeOnAavev3CoreInstance_20241223.t.sol | 60 +++++++ ...LBTCWBTCLiquidEModeOnAavev3CoreInstance.md | 74 +++++++++ ...idEModeOnAavev3CoreInstance_20241223.s.sol | 60 +++++++ .../config.ts | 57 +++++++ 7 files changed, 513 insertions(+), 1 deletion(-) create mode 100644 diffs/AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223_before_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223_after.md create mode 100644 src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223.sol create mode 100644 src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223.t.sol create mode 100644 src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance.md create mode 100644 src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223.s.sol create mode 100644 src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/config.ts diff --git a/diffs/AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223_before_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223_after.md b/diffs/AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223_before_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223_after.md new file mode 100644 index 000000000..9cc4cd6ef --- /dev/null +++ b/diffs/AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223_before_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223_after.md @@ -0,0 +1,152 @@ +## Reserve changes + +### Reserves added + +#### LBTC ([0x8236a87084f8B84306f72007F36F2618A5634494](https://etherscan.io/address/0x8236a87084f8B84306f72007F36F2618A5634494)) + +| description | value | +| --- | --- | +| decimals | 8 | +| isActive | true | +| isFrozen | false | +| supplyCap | 800 LBTC | +| borrowCap | 80 LBTC | +| debtCeiling | 0 $ [0] | +| isSiloed | false | +| isFlashloanable | true | +| oracle | [0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c](https://etherscan.io/address/0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c) | +| oracleDecimals | 8 | +| oracleDescription | BTC / USD | +| oracleLatestAnswer | 102127.88158314 | +| usageAsCollateralEnabled | true | +| ltv | 70 % [7000] | +| liquidationThreshold | 75 % [7500] | +| liquidationBonus | 8.5 % | +| liquidationProtocolFee | 10 % [1000] | +| reserveFactor | 50 % [5000] | +| aToken | [0x65906988ADEe75306021C417a1A3458040239602](https://etherscan.io/address/0x65906988ADEe75306021C417a1A3458040239602) | +| aTokenImpl | [0x7EfFD7b47Bfd17e52fB7559d3f924201b9DbfF3d](https://etherscan.io/address/0x7EfFD7b47Bfd17e52fB7559d3f924201b9DbfF3d) | +| variableDebtToken | [0x68aeB290C7727D899B47c56d1c96AEAC475cD0dD](https://etherscan.io/address/0x68aeB290C7727D899B47c56d1c96AEAC475cD0dD) | +| variableDebtTokenImpl | [0xaC725CB59D16C81061BDeA61041a8A5e73DA9EC6](https://etherscan.io/address/0xaC725CB59D16C81061BDeA61041a8A5e73DA9EC6) | +| borrowingEnabled | true | +| isBorrowableInIsolation | false | +| interestRateStrategy | [0x9ec6F08190DeA04A54f8Afc53Db96134e5E3FdFB](https://etherscan.io/address/0x9ec6F08190DeA04A54f8Afc53Db96134e5E3FdFB) | +| aTokenName | Aave Ethereum LBTC | +| aTokenSymbol | aEthLBTC | +| aTokenUnderlyingBalance | 0.001 LBTC [100000] | +| id | 37 | +| isPaused | false | +| variableDebtTokenName | Aave Ethereum Variable Debt LBTC | +| variableDebtTokenSymbol | variableDebtEthLBTC | +| virtualAccountingActive | true | +| virtualBalance | 0.001 LBTC [100000] | +| optimalUsageRatio | 45 % | +| maxVariableBorrowRate | 304 % | +| baseVariableBorrowRate | 0 % | +| variableRateSlope1 | 4 % | +| variableRateSlope2 | 300 % | +| interestRate | ![ir](https://dash.onaave.com/api/static?variableRateSlope1=40000000000000000000000000&variableRateSlope2=3000000000000000000000000000&optimalUsageRatio=450000000000000000000000000&baseVariableBorrowRate=0&maxVariableBorrowRate=3040000000000000000000000000) | + + +## Emodes changed + +### EMode: ETH correlated(id: 1) + + + +### EMode: sUSDe Stablecoins(id: 2) + + + +### EMode: rsETH LST main(id: 3) + + + +### EMode: LBTC / WBTC(id: 4) + +| description | value before | value after | +| --- | --- | --- | +| eMode.label | - | LBTC / WBTC | +| eMode.ltv | - | 84 % | +| eMode.liquidationThreshold | - | 86 % | +| eMode.liquidationBonus | - | 3 % | +| eMode.borrowableBitmap | - | WBTC | +| eMode.collateralBitmap | - | LBTC | + + +## Raw diff + +```json +{ + "eModes": { + "4": { + "from": null, + "to": { + "borrowableBitmap": "4", + "collateralBitmap": "137438953472", + "eModeCategory": 4, + "label": "LBTC / WBTC", + "liquidationBonus": 10300, + "liquidationThreshold": 8600, + "ltv": 8400 + } + } + }, + "reserves": { + "0x8236a87084f8B84306f72007F36F2618A5634494": { + "from": null, + "to": { + "aToken": "0x65906988ADEe75306021C417a1A3458040239602", + "aTokenImpl": "0x7EfFD7b47Bfd17e52fB7559d3f924201b9DbfF3d", + "aTokenName": "Aave Ethereum LBTC", + "aTokenSymbol": "aEthLBTC", + "aTokenUnderlyingBalance": "100000", + "borrowCap": 80, + "borrowingEnabled": true, + "debtCeiling": 0, + "decimals": 8, + "id": 37, + "interestRateStrategy": "0x9ec6F08190DeA04A54f8Afc53Db96134e5E3FdFB", + "isActive": true, + "isBorrowableInIsolation": false, + "isFlashloanable": true, + "isFrozen": false, + "isPaused": false, + "isSiloed": false, + "liquidationBonus": 10850, + "liquidationProtocolFee": 1000, + "liquidationThreshold": 7500, + "ltv": 7000, + "oracle": "0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c", + "oracleDecimals": 8, + "oracleDescription": "BTC / USD", + "oracleLatestAnswer": "10212788158314", + "reserveFactor": 5000, + "supplyCap": 800, + "symbol": "LBTC", + "underlying": "0x8236a87084f8B84306f72007F36F2618A5634494", + "usageAsCollateralEnabled": true, + "variableDebtToken": "0x68aeB290C7727D899B47c56d1c96AEAC475cD0dD", + "variableDebtTokenImpl": "0xaC725CB59D16C81061BDeA61041a8A5e73DA9EC6", + "variableDebtTokenName": "Aave Ethereum Variable Debt LBTC", + "variableDebtTokenSymbol": "variableDebtEthLBTC", + "virtualAccountingActive": true, + "virtualBalance": "100000" + } + } + }, + "strategies": { + "0x8236a87084f8B84306f72007F36F2618A5634494": { + "from": null, + "to": { + "address": "0x9ec6F08190DeA04A54f8Afc53Db96134e5E3FdFB", + "baseVariableBorrowRate": "0", + "maxVariableBorrowRate": "3040000000000000000000000000", + "optimalUsageRatio": "450000000000000000000000000", + "variableRateSlope1": "40000000000000000000000000", + "variableRateSlope2": "3000000000000000000000000000" + } + } + } +} +``` \ No newline at end of file diff --git a/generator/features/assetListing.ts b/generator/features/assetListing.ts index 48dafe6ae..1c139f072 100644 --- a/generator/features/assetListing.ts +++ b/generator/features/assetListing.ts @@ -201,7 +201,7 @@ export const assetListing: FeatureModule = { listingTemplate += `| Borrowable in Isolation | ${cfg.borrowableInIsolation} |\n`; listingTemplate += `| Oracle | ${cfg.priceFeed} |\n`; if (isAddress(cfg.admin)) { - listingTemplate += `\nAdditionaly [${cfg.admin}](${getExplorerLink(CHAIN_TO_CHAIN_ID[getPoolChain(pool)], cfg.admin)}) has been set as the emission admin for ${cfg.assetSymbol} and the corresponding aToken.\n`; + listingTemplate += `\nAdditionally [${cfg.admin}](${getExplorerLink(CHAIN_TO_CHAIN_ID[getPoolChain(pool)], cfg.admin)}) has been set as the emission admin for ${cfg.assetSymbol} and the corresponding aToken.\n`; } return listingTemplate; }), diff --git a/src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223.sol b/src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223.sol new file mode 100644 index 000000000..4377f42b3 --- /dev/null +++ b/src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223.sol @@ -0,0 +1,109 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol'; +import {AaveV3PayloadEthereum} from 'aave-helpers/src/v3-config-engine/AaveV3PayloadEthereum.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'; +import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol'; +import {SafeERC20} from 'solidity-utils/contracts/oz-common/SafeERC20.sol'; +import {IEmissionManager} from 'aave-v3-origin/contracts/rewards/interfaces/IEmissionManager.sol'; +/** + * @title Onboard LBTC & Enable LBTC/WBTC liquid E-Mode on Aave v3 Core Instance + * @author Aave Chan Initiative + * - Snapshot: https://snapshot.box/#/s:aave.eth/proposal/0x61f027ea797763c9e01736693570141a27a0a5d4517a6b63d0fd84474e8be995 + * - Discussion: https://governance.aave.com/t/arfc-enable-lbtc-wbtc-liquid-e-mode-on-aave-v3-core-instance/20142 + */ +contract AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223 is + AaveV3PayloadEthereum +{ + using SafeERC20 for IERC20; + + address public constant LBTC = 0x8236a87084f8B84306f72007F36F2618A5634494; + uint256 public constant LBTC_SEED_AMOUNT = 1e5; + address public constant LBTC_LM_ADMIN = 0xac140648435d03f784879cd789130F22Ef588Fcd; + + function _postExecute() internal override { + IERC20(LBTC).forceApprove(address(AaveV3Ethereum.POOL), LBTC_SEED_AMOUNT); + AaveV3Ethereum.POOL.supply(LBTC, LBTC_SEED_AMOUNT, address(AaveV3Ethereum.COLLECTOR), 0); + + (address aLBTC, , ) = AaveV3Ethereum.AAVE_PROTOCOL_DATA_PROVIDER.getReserveTokensAddresses( + LBTC + ); + IEmissionManager(AaveV3Ethereum.EMISSION_MANAGER).setEmissionAdmin(LBTC, LBTC_LM_ADMIN); + IEmissionManager(AaveV3Ethereum.EMISSION_MANAGER).setEmissionAdmin(aLBTC, LBTC_LM_ADMIN); + } + + function eModeCategoriesUpdates() + public + pure + override + returns (IAaveV3ConfigEngine.EModeCategoryUpdate[] memory) + { + IAaveV3ConfigEngine.EModeCategoryUpdate[] + memory eModeUpdates = new IAaveV3ConfigEngine.EModeCategoryUpdate[](1); + + eModeUpdates[0] = IAaveV3ConfigEngine.EModeCategoryUpdate({ + eModeCategory: 4, + ltv: 84_00, + liqThreshold: 86_00, + liqBonus: 3_00, + label: 'LBTC / WBTC' + }); + + return eModeUpdates; + } + function assetsEModeUpdates() + public + pure + override + returns (IAaveV3ConfigEngine.AssetEModeUpdate[] memory) + { + IAaveV3ConfigEngine.AssetEModeUpdate[] + memory assetEModeUpdates = new IAaveV3ConfigEngine.AssetEModeUpdate[](2); + + assetEModeUpdates[0] = IAaveV3ConfigEngine.AssetEModeUpdate({ + asset: LBTC, + eModeCategory: 4, + borrowable: EngineFlags.DISABLED, + collateral: EngineFlags.ENABLED + }); + assetEModeUpdates[1] = IAaveV3ConfigEngine.AssetEModeUpdate({ + asset: AaveV3EthereumAssets.WBTC_UNDERLYING, + eModeCategory: 4, + borrowable: EngineFlags.ENABLED, + collateral: EngineFlags.DISABLED + }); + + return assetEModeUpdates; + } + function newListings() public pure override returns (IAaveV3ConfigEngine.Listing[] memory) { + IAaveV3ConfigEngine.Listing[] memory listings = new IAaveV3ConfigEngine.Listing[](1); + + listings[0] = IAaveV3ConfigEngine.Listing({ + asset: LBTC, + assetSymbol: 'LBTC', + priceFeed: 0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c, + enabledToBorrow: EngineFlags.ENABLED, + borrowableInIsolation: EngineFlags.DISABLED, + withSiloedBorrowing: EngineFlags.DISABLED, + flashloanable: EngineFlags.ENABLED, + ltv: 70_00, + liqThreshold: 75_00, + liqBonus: 8_50, + reserveFactor: 50_00, + supplyCap: 800, + borrowCap: 80, + debtCeiling: 0, + liqProtocolFee: 10_00, + rateStrategyParams: IAaveV3ConfigEngine.InterestRateInputData({ + optimalUsageRatio: 45_00, + baseVariableBorrowRate: 0, + variableRateSlope1: 4_00, + variableRateSlope2: 300_00 + }) + }); + + return listings; + } +} diff --git a/src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223.t.sol b/src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223.t.sol new file mode 100644 index 000000000..ccff96bf7 --- /dev/null +++ b/src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223.t.sol @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers} from 'aave-helpers/src/GovV3Helpers.sol'; +import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; +import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol'; +import {IEmissionManager} from 'aave-v3-origin/contracts/rewards/interfaces/IEmissionManager.sol'; + +import 'forge-std/Test.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223} from './AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223.sol'; + +/** + * @dev Test for AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223 + * command: FOUNDRY_PROFILE=mainnet forge test --match-path=src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223.t.sol -vv + */ +contract AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223_Test is + ProtocolV3TestBase +{ + AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('mainnet'), 21567986); + proposal = new AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + defaultTest( + 'AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223', + AaveV3Ethereum.POOL, + address(proposal) + ); + } + + function test_collectorHasLBTCFunds() public { + GovV3Helpers.executePayload(vm, address(proposal)); + (address aTokenAddress, , ) = AaveV3Ethereum + .AAVE_PROTOCOL_DATA_PROVIDER + .getReserveTokensAddresses(proposal.LBTC()); + assertGe(IERC20(aTokenAddress).balanceOf(address(AaveV3Ethereum.COLLECTOR)), 10 ** 5); + } + + function test_LBTCAdmin() public { + GovV3Helpers.executePayload(vm, address(proposal)); + (address aLBTC, , ) = AaveV3Ethereum.AAVE_PROTOCOL_DATA_PROVIDER.getReserveTokensAddresses( + proposal.LBTC() + ); + assertEq( + IEmissionManager(AaveV3Ethereum.EMISSION_MANAGER).getEmissionAdmin(proposal.LBTC()), + proposal.LBTC_LM_ADMIN() + ); + assertEq( + IEmissionManager(AaveV3Ethereum.EMISSION_MANAGER).getEmissionAdmin(aLBTC), + proposal.LBTC_LM_ADMIN() + ); + } +} diff --git a/src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance.md b/src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance.md new file mode 100644 index 000000000..c8cacd83b --- /dev/null +++ b/src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance.md @@ -0,0 +1,74 @@ +--- +title: "Onboard LBTC & Enable LBTC/WBTC liquid E-Mode on Aave v3 Core Instance" +author: "Aave Chan Initiative" +discussions: "https://governance.aave.com/t/arfc-enable-lbtc-wbtc-liquid-e-mode-on-aave-v3-core-instance/20142" +snapshot: "https://snapshot.box/#/s:aave.eth/proposal/0x61f027ea797763c9e01736693570141a27a0a5d4517a6b63d0fd84474e8be995" +--- + +## Simple Summary + +This proposal aims to onboard LBTC and enable LBTC/WBTC liquid E-Mode for the Main Instance. By implementing this change, we seek to enhance capital efficiency for borrowers using LBTC/WBTC as collateral. + +[TEMP CHECK](https://governance.aave.com/t/temp-check-onboard-enable-lbtc-wbtc-liquid-e-mode-on-aave-v3-core-instance/19968/7) and [TEMP CHECK Snapshot](https://snapshot.box/#/s:aave.eth/proposal/0x8fdee3ec7a301f9fba2e4c048227257070645d636b09a7afb369ee9c002ad764) have passed recently. + +## Motivation + +The motivation behind this proposal stems from several key factors: + +- High Utilization: LBTC/WBTC has demonstrated significant usage as collateral for borrowing stablecoins on other platforms. +- Capital Efficiency: Enabling liquid E-Mode for LBTC/WBTC will allow borrowers to substantially improve their capital efficiency when using this asset as collateral. +- Controlled Growth: Liquid E-Mode provides a mechanism for more precise control over the growth and borrow demand in relation to the overall stablecoin liquidity within Aave v3 on Core Instance. + +By implementing this proposal, we aim to optimize the use of LBTC/WBTC within the Aave ecosystem, attracting more liquidity for the protocol and increasing revenues. + +## Specification + +The table below illustrates the configured risk parameters for **LBTC** + +| Parameter | Value | +| ------------------------- | -----------------------------------------: | +| Isolation Mode | false | +| Borrowable | ENABLED | +| Collateral Enabled | true | +| Supply Cap (LBTC) | 800 | +| Borrow Cap (LBTC) | 80 | +| Debt Ceiling | USD 0 | +| LTV | 70 % | +| LT | 75 % | +| Liquidation Bonus | 8.5 % | +| Liquidation Protocol Fee | 10 % | +| Reserve Factor | 50 % | +| Base Variable Borrow Rate | 0 % | +| Variable Slope 1 | 4 % | +| Variable Slope 2 | 300 % | +| Uoptimal | 45 % | +| Flashloanable | ENABLED | +| Siloed Borrowing | DISABLED | +| Borrowable in Isolation | DISABLED | +| Oracle | 0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c | + +Additionally [0xac140648435d03f784879cd789130F22Ef588Fcd](https://etherscan.io/address/0xac140648435d03f784879cd789130F22Ef588Fcd) has been set as the emission admin for LBTC and the corresponding aToken. + +**E-mode** + +the following E-mode will be created + +| Parameter | Value | Value | +| --------------------- | ----- | ----- | +| Asset | LBTC | WBTC | +| Collateral | Yes | No | +| Borrowable | No | Yes | +| Max LTV | 84% | - | +| Liquidation Threshold | 86% | - | +| Liquidation Bonus | 3.00% | - | + +## References + +- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223.sol) +- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223.t.sol) +- [Snapshot](https://snapshot.box/#/s:aave.eth/proposal/0x61f027ea797763c9e01736693570141a27a0a5d4517a6b63d0fd84474e8be995) +- [Discussion](https://governance.aave.com/t/arfc-enable-lbtc-wbtc-liquid-e-mode-on-aave-v3-core-instance/20142) + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). diff --git a/src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223.s.sol b/src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223.s.sol new file mode 100644 index 000000000..82a2eeadc --- /dev/null +++ b/src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223.s.sol @@ -0,0 +1,60 @@ +// 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} from 'solidity-utils/contracts/utils/ScriptUtils.sol'; +import {AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223} from './AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223.sol'; + +/** + * @dev Deploy Ethereum + * deploy-command: make deploy-ledger contract=src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223.s.sol:DeployEthereum chain=mainnet + * verify-command: FOUNDRY_PROFILE=mainnet npx catapulta-verify -b broadcast/EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223.s.sol/1/run-latest.json + */ +contract DeployEthereum is EthereumScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223).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/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223.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_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance_20241223).creationCode + ); + payloads[0] = GovV3Helpers.buildMainnetPayload(vm, actionsEthereum); + + // create proposal + vm.startBroadcast(); + GovV3Helpers.createProposal( + vm, + payloads, + GovernanceV3Ethereum.VOTING_PORTAL_ETH_POL, + GovV3Helpers.ipfsHashFile( + vm, + 'src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance.md' + ) + ); + } +} diff --git a/src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/config.ts b/src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/config.ts new file mode 100644 index 000000000..1a00500fa --- /dev/null +++ b/src/20241223_AaveV3Ethereum_EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance/config.ts @@ -0,0 +1,57 @@ +import {ConfigFile} from '../../generator/types'; +export const config: ConfigFile = { + rootOptions: { + configFile: 'tmp.ts', + author: 'Aave Chan Initiative', + pools: ['AaveV3Ethereum'], + title: 'Onboard LBTC & enable LBTC/WBTC liquid E-Mode on Aave v3 Core Instance', + shortName: 'EnableLBTCWBTCLiquidEModeOnAavev3CoreInstance', + date: '20241223', + discussion: + 'https://governance.aave.com/t/arfc-enable-lbtc-wbtc-liquid-e-mode-on-aave-v3-core-instance/20142', + snapshot: + 'https://snapshot.box/#/s:aave.eth/proposal/0x61f027ea797763c9e01736693570141a27a0a5d4517a6b63d0fd84474e8be995', + votingNetwork: 'POLYGON', + }, + poolOptions: { + AaveV3Ethereum: { + configs: { + EMODES_UPDATES: [ + {eModeCategory: 4, ltv: '84', liqThreshold: '86', liqBonus: '3', label: 'LBTC / WBTC'}, + ], + EMODES_ASSETS: [ + {asset: 'LBTC', eModeCategory: '4', collateral: 'ENABLED', borrowable: 'DISABLED'}, + {asset: 'WBTC', eModeCategory: '4', collateral: 'DISABLED', borrowable: 'ENABLED'}, + ], + ASSET_LISTING: [ + { + assetSymbol: 'LBTC', + decimals: 8, + priceFeed: '0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c', + ltv: '70', + liqThreshold: '75', + liqBonus: '8.5', + debtCeiling: '0', + liqProtocolFee: '10', + enabledToBorrow: 'ENABLED', + flashloanable: 'ENABLED', + borrowableInIsolation: 'DISABLED', + withSiloedBorrowing: 'DISABLED', + reserveFactor: '50', + supplyCap: '800', + borrowCap: '80', + rateStrategyParams: { + optimalUtilizationRate: '45', + baseVariableBorrowRate: '0', + variableRateSlope1: '4', + variableRateSlope2: '300', + }, + asset: '0x8236a87084f8B84306f72007F36F2618A5634494', + admin: '0xac140648435d03f784879cd789130F22Ef588Fcd', + }, + ], + }, + cache: {blockNumber: 21466630}, + }, + }, +};