generated from bgd-labs/bgd-forge-template
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WeETH arbitrum onboarding - Needs Oracle (#289)
* init * add oracle * test result * update config with oracle address * Update src/20240409_AaveV3Arbitrum_WeETHArbitrumOnboarding/WeETHArbitrumOnboarding.md Co-authored-by: Lukas <[email protected]> * Update src/20240409_AaveV3Arbitrum_WeETHArbitrumOnboarding/WeETHArbitrumOnboarding.md Co-authored-by: Lukas <[email protected]> --------- Co-authored-by: marczeller <[email protected]> Co-authored-by: Rozengarden <[email protected]> Co-authored-by: Lukas <[email protected]>
- Loading branch information
1 parent
8ef6bad
commit cb2ebc8
Showing
7 changed files
with
414 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
139 changes: 139 additions & 0 deletions
139
...arding_20240409_before_AaveV3Arbitrum_WeETHArbitrumOnboarding_20240409_after.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
## Reserve changes | ||
|
||
### Reserves added | ||
|
||
#### weETH ([0x35751007a407ca6FEFfE80b3cB397736D2cf4dbe](https://arbiscan.io/address/0x35751007a407ca6FEFfE80b3cB397736D2cf4dbe)) | ||
|
||
| description | value | | ||
| --- | --- | | ||
| decimals | 18 | | ||
| isActive | true | | ||
| isFrozen | false | | ||
| supplyCap | 1,000 weETH | | ||
| borrowCap | 100 weETH | | ||
| debtCeiling | 0 $ | | ||
| isSiloed | false | | ||
| isFlashloanable | true | | ||
| eModeCategory | 2 | | ||
| oracle | [0x517276B5972C4Db7E88B9F76Ee500E888a2D73C3](https://arbiscan.io/address/0x517276B5972C4Db7E88B9F76Ee500E888a2D73C3) | | ||
| oracleDecimals | 8 | | ||
| oracleDescription | Capped weETH / eETH(ETH) / USD | | ||
| oracleLatestAnswer | 3342.70251943 | | ||
| usageAsCollateralEnabled | true | | ||
| ltv | 72.5 % | | ||
| liquidationThreshold | 75 % | | ||
| liquidationBonus | 7.5 % | | ||
| liquidationProtocolFee | 10 % | | ||
| reserveFactor | 15 % | | ||
| aToken | [0x8437d7C167dFB82ED4Cb79CD44B7a32A1dd95c77](https://arbiscan.io/address/0x8437d7C167dFB82ED4Cb79CD44B7a32A1dd95c77) | | ||
| aTokenImpl | [0x1Be1798b70aEe431c2986f7ff48d9D1fa350786a](https://arbiscan.io/address/0x1Be1798b70aEe431c2986f7ff48d9D1fa350786a) | | ||
| variableDebtToken | [0x3ca5FA07689F266e907439aFd1fBB59c44fe12f6](https://arbiscan.io/address/0x3ca5FA07689F266e907439aFd1fBB59c44fe12f6) | | ||
| variableDebtTokenImpl | [0x5E76E98E0963EcDC6A065d1435F84065b7523f39](https://arbiscan.io/address/0x5E76E98E0963EcDC6A065d1435F84065b7523f39) | | ||
| stableDebtToken | [0x40B4BAEcc69B882e8804f9286b12228C27F8c9BF](https://arbiscan.io/address/0x40B4BAEcc69B882e8804f9286b12228C27F8c9BF) | | ||
| stableDebtTokenImpl | [0x0c2C95b24529664fE55D4437D7A31175CFE6c4f7](https://arbiscan.io/address/0x0c2C95b24529664fE55D4437D7A31175CFE6c4f7) | | ||
| borrowingEnabled | true | | ||
| stableBorrowRateEnabled | false | | ||
| isBorrowableInIsolation | false | | ||
| interestRateStrategy | [0x0fc12Ad84210695dE8C0D5D8B6f720C37cEaB02f](https://arbiscan.io/address/0x0fc12Ad84210695dE8C0D5D8B6f720C37cEaB02f) | | ||
| liquidityIndex | 1 | | ||
| variableBorrowIndex | 1 | | ||
| aTokenName | Aave Arbitrum weETH | | ||
| aTokenSymbol | aArbweETH | | ||
| currentLiquidityRate | 0 % | | ||
| currentVariableBorrowRate | 0 % | | ||
| isPaused | false | | ||
| stableDebtTokenName | Aave Arbitrum Stable Debt weETH | | ||
| stableDebtTokenSymbol | stableDebtArbweETH | | ||
| variableDebtTokenName | Aave Arbitrum Variable Debt weETH | | ||
| variableDebtTokenSymbol | variableDebtArbweETH | | ||
| optimalUsageRatio | 45 % | | ||
| maxExcessStableToTotalDebtRatio | 80 % | | ||
| maxExcessUsageRatio | 55 % | | ||
| optimalStableToTotalDebtRatio | 20 % | | ||
| baseVariableBorrowRate | 0 % | | ||
| variableRateSlope1 | 7 % | | ||
| variableRateSlope2 | 300 % | | ||
| baseStableBorrowRate | 9 % | | ||
| stableRateSlope1 | 7 % | | ||
| stableRateSlope2 | 300 % | | ||
| interestRate | ![ir](/.assets/859e8f346e62fa5dc8eed4d223ca2a8d1c9fc80c.svg) | | ||
| eMode.label | ETH correlated | | ||
| eMode.ltv | 93 % | | ||
| eMode.liquidationThreshold | 95 % | | ||
| eMode.liquidationBonus | 1 % | | ||
| eMode.priceSource | 0x0000000000000000000000000000000000000000 | | ||
|
||
|
||
## Raw diff | ||
|
||
```json | ||
{ | ||
"reserves": { | ||
"0x35751007a407ca6FEFfE80b3cB397736D2cf4dbe": { | ||
"from": null, | ||
"to": { | ||
"aToken": "0x8437d7C167dFB82ED4Cb79CD44B7a32A1dd95c77", | ||
"aTokenImpl": "0x1Be1798b70aEe431c2986f7ff48d9D1fa350786a", | ||
"aTokenName": "Aave Arbitrum weETH", | ||
"aTokenSymbol": "aArbweETH", | ||
"borrowCap": 100, | ||
"borrowingEnabled": true, | ||
"currentLiquidityRate": 0, | ||
"currentVariableBorrowRate": 0, | ||
"debtCeiling": 0, | ||
"decimals": 18, | ||
"eModeCategory": 2, | ||
"interestRateStrategy": "0x0fc12Ad84210695dE8C0D5D8B6f720C37cEaB02f", | ||
"isActive": true, | ||
"isBorrowableInIsolation": false, | ||
"isFlashloanable": true, | ||
"isFrozen": false, | ||
"isPaused": false, | ||
"isSiloed": false, | ||
"liquidationBonus": 10750, | ||
"liquidationProtocolFee": 1000, | ||
"liquidationThreshold": 7500, | ||
"liquidityIndex": "1000000000000000000000000000", | ||
"ltv": 7250, | ||
"oracle": "0x517276B5972C4Db7E88B9F76Ee500E888a2D73C3", | ||
"oracleDecimals": 8, | ||
"oracleDescription": "Capped weETH / eETH(ETH) / USD", | ||
"oracleLatestAnswer": 334270251943, | ||
"reserveFactor": 1500, | ||
"stableBorrowRateEnabled": false, | ||
"stableDebtToken": "0x40B4BAEcc69B882e8804f9286b12228C27F8c9BF", | ||
"stableDebtTokenImpl": "0x0c2C95b24529664fE55D4437D7A31175CFE6c4f7", | ||
"stableDebtTokenName": "Aave Arbitrum Stable Debt weETH", | ||
"stableDebtTokenSymbol": "stableDebtArbweETH", | ||
"supplyCap": 1000, | ||
"symbol": "weETH", | ||
"underlying": "0x35751007a407ca6FEFfE80b3cB397736D2cf4dbe", | ||
"usageAsCollateralEnabled": true, | ||
"variableBorrowIndex": "1000000000000000000000000000", | ||
"variableDebtToken": "0x3ca5FA07689F266e907439aFd1fBB59c44fe12f6", | ||
"variableDebtTokenImpl": "0x5E76E98E0963EcDC6A065d1435F84065b7523f39", | ||
"variableDebtTokenName": "Aave Arbitrum Variable Debt weETH", | ||
"variableDebtTokenSymbol": "variableDebtArbweETH" | ||
} | ||
} | ||
}, | ||
"strategies": { | ||
"0x35751007a407ca6FEFfE80b3cB397736D2cf4dbe": { | ||
"from": null, | ||
"to": { | ||
"address": "0x0fc12Ad84210695dE8C0D5D8B6f720C37cEaB02f", | ||
"baseStableBorrowRate": "90000000000000000000000000", | ||
"baseVariableBorrowRate": 0, | ||
"maxExcessStableToTotalDebtRatio": "800000000000000000000000000", | ||
"maxExcessUsageRatio": "550000000000000000000000000", | ||
"optimalStableToTotalDebtRatio": "200000000000000000000000000", | ||
"optimalUsageRatio": "450000000000000000000000000", | ||
"stableRateSlope1": "70000000000000000000000000", | ||
"stableRateSlope2": "3000000000000000000000000000", | ||
"variableRateSlope1": "70000000000000000000000000", | ||
"variableRateSlope2": "3000000000000000000000000000" | ||
} | ||
} | ||
} | ||
} | ||
``` |
64 changes: 64 additions & 0 deletions
64
...aveV3Arbitrum_WeETHArbitrumOnboarding/AaveV3Arbitrum_WeETHArbitrumOnboarding_20240409.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {AaveV3Arbitrum, AaveV3ArbitrumEModes} from 'aave-address-book/AaveV3Arbitrum.sol'; | ||
import {AaveV3PayloadArbitrum} from 'aave-helpers/v3-config-engine/AaveV3PayloadArbitrum.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 weETH Arbitrum onboarding | ||
* @author @mzeller - ACI | ||
* - Snapshot: direct-to-aip | ||
* - Discussion: https://governance.aave.com/t/arfc-onboard-weeth-to-aave-v3-on-ethereum/16758/11 | ||
*/ | ||
contract AaveV3Arbitrum_WeETHArbitrumOnboarding_20240409 is AaveV3PayloadArbitrum { | ||
using SafeERC20 for IERC20; | ||
|
||
address public constant weETH = 0x35751007a407ca6FEFfE80b3cB397736D2cf4dbe; | ||
uint256 public constant weETH_SEED_AMOUNT = 0.01e18; | ||
|
||
function _postExecute() internal override { | ||
IERC20(weETH).forceApprove(address(AaveV3Arbitrum.POOL), weETH_SEED_AMOUNT); | ||
AaveV3Arbitrum.POOL.supply(weETH, weETH_SEED_AMOUNT, address(AaveV3Arbitrum.COLLECTOR), 0); | ||
} | ||
|
||
function newListings() public pure override returns (IAaveV3ConfigEngine.Listing[] memory) { | ||
IAaveV3ConfigEngine.Listing[] memory listings = new IAaveV3ConfigEngine.Listing[](1); | ||
|
||
listings[0] = IAaveV3ConfigEngine.Listing({ | ||
asset: weETH, | ||
assetSymbol: 'weETH', | ||
priceFeed: 0x517276B5972C4Db7E88B9F76Ee500E888a2D73C3, | ||
eModeCategory: AaveV3ArbitrumEModes.ETH_CORRELATED, | ||
enabledToBorrow: EngineFlags.ENABLED, | ||
stableRateModeEnabled: EngineFlags.DISABLED, | ||
borrowableInIsolation: EngineFlags.DISABLED, | ||
withSiloedBorrowing: EngineFlags.DISABLED, | ||
flashloanable: EngineFlags.ENABLED, | ||
ltv: 72_50, | ||
liqThreshold: 75_00, | ||
liqBonus: 7_50, | ||
reserveFactor: 15_00, | ||
supplyCap: 1_000, | ||
borrowCap: 100, | ||
debtCeiling: 0, | ||
liqProtocolFee: 10_00, | ||
rateStrategyParams: IV3RateStrategyFactory.RateStrategyParams({ | ||
optimalUsageRatio: _bpsToRay(45_00), | ||
baseVariableBorrowRate: _bpsToRay(0), | ||
variableRateSlope1: _bpsToRay(7_00), | ||
variableRateSlope2: _bpsToRay(300_00), | ||
stableRateSlope1: _bpsToRay(7_00), | ||
stableRateSlope2: _bpsToRay(300_00), | ||
baseStableRateOffset: _bpsToRay(2_00), | ||
stableRateExcessOffset: _bpsToRay(20_00), | ||
optimalStableToTotalDebtRatio: _bpsToRay(20_00) | ||
}) | ||
}); | ||
|
||
return listings; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...eV3Arbitrum_WeETHArbitrumOnboarding/AaveV3Arbitrum_WeETHArbitrumOnboarding_20240409.t.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {GovV3Helpers} from 'aave-helpers/GovV3Helpers.sol'; | ||
import {AaveV3Arbitrum} from 'aave-address-book/AaveV3Arbitrum.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 {AaveV3Arbitrum_WeETHArbitrumOnboarding_20240409} from './AaveV3Arbitrum_WeETHArbitrumOnboarding_20240409.sol'; | ||
|
||
/** | ||
* @dev Test for AaveV3Arbitrum_WeETHArbitrumOnboarding_20240409 | ||
* command: make test-contract filter=AaveV3Arbitrum_WeETHArbitrumOnboarding_20240409 | ||
*/ | ||
contract AaveV3Arbitrum_WeETHArbitrumOnboarding_20240409_Test is ProtocolV3TestBase { | ||
AaveV3Arbitrum_WeETHArbitrumOnboarding_20240409 internal proposal; | ||
|
||
function setUp() public { | ||
vm.createSelectFork(vm.rpcUrl('arbitrum'), 200346777); | ||
proposal = new AaveV3Arbitrum_WeETHArbitrumOnboarding_20240409(); | ||
} | ||
|
||
/** | ||
* @dev executes the generic test suite including e2e and config snapshots | ||
*/ | ||
function test_defaultProposalExecution() public { | ||
defaultTest( | ||
'AaveV3Arbitrum_WeETHArbitrumOnboarding_20240409', | ||
AaveV3Arbitrum.POOL, | ||
address(proposal) | ||
); | ||
} | ||
|
||
function test_collectorHasweETHFunds() public { | ||
GovV3Helpers.executePayload(vm, address(proposal)); | ||
(address aTokenAddress, , ) = AaveV3Arbitrum | ||
.AAVE_PROTOCOL_DATA_PROVIDER | ||
.getReserveTokensAddresses(proposal.weETH()); | ||
assertGe(IERC20(aTokenAddress).balanceOf(address(AaveV3Arbitrum.COLLECTOR)), 10 ** 16); | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
src/20240409_AaveV3Arbitrum_WeETHArbitrumOnboarding/WeETHArbitrumOnboarding.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
title: "weETH Arbitrum onboarding" | ||
author: "@mzeller - ACI" | ||
discussions: "https://governance.aave.com/t/arfc-onboard-weeth-to-aave-v3-on-ethereum/16758/11" | ||
--- | ||
|
||
## Simple Summary | ||
|
||
This AIP seeks to add Ether.fi Liquid Restaking Token weETH to Aave V3 Arbitrum. | ||
|
||
## Motivation | ||
|
||
eETH is an LRT that allows users to stake their ETH, accrue staking rewards, and receive additional rewards through native restaking on EigenLayer. | ||
|
||
Ether.fi has also launched eETH on Arbitrum, allowing users on the L2 to get exposure to the LRT yield and points. As weETH has already been approved for onboarding to Aave v3 Ethereum by the DAO, this proposal aims to extend the onboarding of weETH to Aave v3 Arbitrum. | ||
|
||
## Specification | ||
|
||
The table below illustrates the configured risk parameters for **weETH** | ||
|
||
| Parameter | Value | | ||
| ---------------------------------- | -----------------------------------------: | | ||
| Isolation Mode | true | | ||
| Borrowable | ENABLED | | ||
| Collateral Enabled | true | | ||
| Supply Cap (weETH) | 1,000 | | ||
| Borrow Cap (weETH) | 100 | | ||
| Debt Ceiling | USD 0 | | ||
| LTV | 72.5 % | | ||
| LT | 75 % | | ||
| Liquidation Bonus | 7.5 % | | ||
| Liquidation Protocol Fee | 10 % | | ||
| Reserve Factor | 15 % | | ||
| Base Variable Borrow Rate | 0 % | | ||
| Variable Slope 1 | 7 % | | ||
| Variable Slope 2 | 300 % | | ||
| Uoptimal | 45 % | | ||
| Stable Borrowing | DISABLED | | ||
| Stable Slope1 | 7 % | | ||
| Stable Slope2 | 300 % | | ||
| Base Stable Rate Offset | 2 % | | ||
| Stable Rate Excess Offset | 20 % | | ||
| Optimal Stable To Total Debt Ratio | 20 % | | ||
| Flashloanable | ENABLED | | ||
| Siloed Borrowing | DISABLED | | ||
| Borrowable in Isolation | DISABLED | | ||
| Oracle | [0x517276B5972C4Db7E88B9F76Ee500E888a2D73C3](https://arbiscan.io/address/0x517276B5972C4Db7E88B9F76Ee500E888a2D73C3) | | ||
|
||
## References | ||
|
||
- Implementation: [AaveV3Arbitrum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240409_AaveV3Arbitrum_WeETHArbitrumOnboarding/AaveV3Arbitrum_WeETHArbitrumOnboarding_20240409.sol) | ||
- Tests: [AaveV3Arbitrum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240409_AaveV3Arbitrum_WeETHArbitrumOnboarding/AaveV3Arbitrum_WeETHArbitrumOnboarding_20240409.t.sol) | ||
- [Snapshot](direct-to-aip) | ||
- [Discussion](https://governance.aave.com/t/arfc-onboard-weeth-to-aave-v3-on-ethereum/16758/11) | ||
|
||
## Copyright | ||
|
||
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). |
58 changes: 58 additions & 0 deletions
58
src/20240409_AaveV3Arbitrum_WeETHArbitrumOnboarding/WeETHArbitrumOnboarding_20240409.s.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/GovV3Helpers.sol'; | ||
import {EthereumScript, ArbitrumScript} from 'aave-helpers/ScriptUtils.sol'; | ||
import {AaveV3Arbitrum_WeETHArbitrumOnboarding_20240409} from './AaveV3Arbitrum_WeETHArbitrumOnboarding_20240409.sol'; | ||
|
||
/** | ||
* @dev Deploy Arbitrum | ||
* deploy-command: make deploy-ledger contract=src/20240409_AaveV3Arbitrum_WeETHArbitrumOnboarding/WeETHArbitrumOnboarding_20240409.s.sol:DeployArbitrum chain=arbitrum | ||
* verify-command: npx catapulta-verify -b broadcast/WeETHArbitrumOnboarding_20240409.s.sol/42161/run-latest.json | ||
*/ | ||
contract DeployArbitrum is ArbitrumScript { | ||
function run() external broadcast { | ||
// deploy payloads | ||
address payload0 = GovV3Helpers.deployDeterministic( | ||
type(AaveV3Arbitrum_WeETHArbitrumOnboarding_20240409).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/20240409_AaveV3Arbitrum_WeETHArbitrumOnboarding/WeETHArbitrumOnboarding_20240409.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 actionsArbitrum = new IPayloadsControllerCore.ExecutionAction[](1); | ||
actionsArbitrum[0] = GovV3Helpers.buildAction( | ||
type(AaveV3Arbitrum_WeETHArbitrumOnboarding_20240409).creationCode | ||
); | ||
payloads[0] = GovV3Helpers.buildArbitrumPayload(vm, actionsArbitrum); | ||
|
||
// create proposal | ||
vm.startBroadcast(); | ||
GovV3Helpers.createProposal( | ||
vm, | ||
payloads, | ||
GovV3Helpers.ipfsHashFile( | ||
vm, | ||
'src/20240409_AaveV3Arbitrum_WeETHArbitrumOnboarding/WeETHArbitrumOnboarding.md' | ||
) | ||
); | ||
} | ||
} |
Oops, something went wrong.
cb2ebc8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Foundry report
Build log
Test success 🌈