Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Onboarding ETHx to Aave V3 Ethereum #342

Merged
merged 5 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .assets/c73865a243e2110291617da971e6614d404cd2c5.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
## Reserve changes

### Reserves added

#### ETHx ([0xA35b1B31Ce002FBF2058D22F30f95D405200A15b](https://etherscan.io/address/0xA35b1B31Ce002FBF2058D22F30f95D405200A15b))

| description | value |
| --- | --- |
| decimals | 18 |
| isActive | true |
| isFrozen | false |
| supplyCap | 3,200 ETHx |
| borrowCap | 320 ETHx |
| debtCeiling | 0 $ |
| isSiloed | false |
| isFlashloanable | true |
| eModeCategory | 1 |
| oracle | [0xD6270dAabFe4862306190298C2B48fed9e15C847](https://etherscan.io/address/0xD6270dAabFe4862306190298C2B48fed9e15C847) |
| oracleDecimals | 8 |
| oracleDescription | Capped ethX / ETH / USD |
| oracleLatestAnswer | 3913.42547237 |
| usageAsCollateralEnabled | true |
| ltv | 74.5 % |
| liquidationThreshold | 77 % |
| liquidationBonus | 7.5 % |
| liquidationProtocolFee | 10 % |
| reserveFactor | 15 % |
| 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 | [0x48AF11111764E710fcDcE2750db848C63edab57B](https://etherscan.io/address/0x48AF11111764E710fcDcE2750db848C63edab57B) |
| liquidityIndex | 1 |
| variableBorrowIndex | 1 |
| aTokenName | Aave Ethereum ETHx |
| aTokenSymbol | aEthETHx |
| currentLiquidityRate | 0 % |
| currentVariableBorrowRate | 0 % |
| isPaused | false |
| stableDebtTokenName | Aave Ethereum Stable Debt ETHx |
| stableDebtTokenSymbol | stableDebtEthETHx |
| variableDebtTokenName | Aave Ethereum Variable Debt ETHx |
| variableDebtTokenSymbol | variableDebtEthETHx |
| optimalUsageRatio | 45 % |
| maxExcessStableToTotalDebtRatio | 100 % |
| maxExcessUsageRatio | 55 % |
| optimalStableToTotalDebtRatio | 0 % |
| baseVariableBorrowRate | 0 % |
| variableRateSlope1 | 7 % |
| variableRateSlope2 | 300 % |
| baseStableBorrowRate | 7 % |
| stableRateSlope1 | 0 % |
| stableRateSlope2 | 0 % |
| interestRate | ![ir](/.assets/aa2e8a5322392ad3d4ae80453f4e281a8da627cc.svg) |
| eMode.label | ETH correlated |
| eMode.ltv | 93 % |
| eMode.liquidationThreshold | 95 % |
| eMode.liquidationBonus | 1 % |
| eMode.priceSource | 0x0000000000000000000000000000000000000000 |


## Raw diff

```json
{
"reserves": {
"0xA35b1B31Ce002FBF2058D22F30f95D405200A15b": {
"from": null,
"to": {
"aToken": "0x4F5923Fc5FD4a93352581b38B7cD26943012DECF",
"aTokenImpl": "0x7EfFD7b47Bfd17e52fB7559d3f924201b9DbfF3d",
"aTokenName": "Aave Ethereum ETHx",
"aTokenSymbol": "aEthETHx",
"borrowCap": 320,
"borrowingEnabled": true,
"currentLiquidityRate": 0,
"currentVariableBorrowRate": 0,
"debtCeiling": 0,
"decimals": 18,
"eModeCategory": 1,
"interestRateStrategy": "0x48AF11111764E710fcDcE2750db848C63edab57B",
"isActive": true,
"isBorrowableInIsolation": false,
"isFlashloanable": true,
"isFrozen": false,
"isPaused": false,
"isSiloed": false,
"liquidationBonus": 10750,
"liquidationProtocolFee": 1000,
"liquidationThreshold": 7700,
"liquidityIndex": "1000000000000000000000000000",
"ltv": 7450,
"oracle": "0xD6270dAabFe4862306190298C2B48fed9e15C847",
"oracleDecimals": 8,
"oracleDescription": "Capped ethX / ETH / USD",
"oracleLatestAnswer": 391342547237,
"reserveFactor": 1500,
"stableBorrowRateEnabled": false,
"stableDebtToken": "0x43Cc8AD0c223b38D9c04802bB184A2D97e497D38",
"stableDebtTokenImpl": "0x15C5620dfFaC7c7366EED66C20Ad222DDbB1eD57",
"stableDebtTokenName": "Aave Ethereum Stable Debt ETHx",
"stableDebtTokenSymbol": "stableDebtEthETHx",
"supplyCap": 3200,
"symbol": "ETHx",
"underlying": "0xA35b1B31Ce002FBF2058D22F30f95D405200A15b",
"usageAsCollateralEnabled": true,
"variableBorrowIndex": "1000000000000000000000000000",
"variableDebtToken": "0x015396E1F286289aE23a762088E863b3ec465145",
"variableDebtTokenImpl": "0xaC725CB59D16C81061BDeA61041a8A5e73DA9EC6",
"variableDebtTokenName": "Aave Ethereum Variable Debt ETHx",
"variableDebtTokenSymbol": "variableDebtEthETHx"
}
}
},
"strategies": {
"0xA35b1B31Ce002FBF2058D22F30f95D405200A15b": {
"from": null,
"to": {
"address": "0x48AF11111764E710fcDcE2750db848C63edab57B",
"baseStableBorrowRate": "70000000000000000000000000",
"baseVariableBorrowRate": 0,
"maxExcessStableToTotalDebtRatio": "1000000000000000000000000000",
"maxExcessUsageRatio": "550000000000000000000000000",
"optimalStableToTotalDebtRatio": 0,
"optimalUsageRatio": "450000000000000000000000000",
"stableRateSlope1": 0,
"stableRateSlope2": 0,
"variableRateSlope1": "70000000000000000000000000",
"variableRateSlope2": "3000000000000000000000000000"
}
}
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// 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 Onboarding ETHx to Aave V3
* @author karpatkey_TokenLogic
* - Snapshot: https://snapshot.org/#/aave.eth/proposal/0x9238b091250c739f5b5486ab8dbaa110b0b7ec0582698ea2c2d3721377e4b0bb
* - Discussion: https://governance.aave.com/t/arfc-onboarding-ethx-to-aave-v3-ethereum/15672
*/
contract AaveV3Ethereum_OnboardingETHxToAaveV3_20240521 is AaveV3PayloadEthereum {
using SafeERC20 for IERC20;

address public constant ETHx = 0xA35b1B31Ce002FBF2058D22F30f95D405200A15b;
uint256 public constant ETHx_SEED_AMOUNT = 0.01 ether;

function _postExecute() internal override {
IERC20(ETHx).forceApprove(address(AaveV3Ethereum.POOL), ETHx_SEED_AMOUNT);
AaveV3Ethereum.POOL.supply(ETHx, ETHx_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: ETHx,
assetSymbol: 'ETHx',
priceFeed: 0xD6270dAabFe4862306190298C2B48fed9e15C847,
eModeCategory: AaveV3EthereumEModes.ETH_CORRELATED,
enabledToBorrow: EngineFlags.ENABLED,
stableRateModeEnabled: EngineFlags.DISABLED,
borrowableInIsolation: EngineFlags.DISABLED,
withSiloedBorrowing: EngineFlags.DISABLED,
flashloanable: EngineFlags.ENABLED,
ltv: 74_50,
liqThreshold: 77_00,
liqBonus: 7_50,
reserveFactor: 15_00,
supplyCap: 3_200,
borrowCap: 320,
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(0),
stableRateSlope2: _bpsToRay(0),
baseStableRateOffset: _bpsToRay(0),
stableRateExcessOffset: _bpsToRay(0),
optimalStableToTotalDebtRatio: _bpsToRay(0)
})
});

return listings;
}
}
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 {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_OnboardingETHxToAaveV3_20240521} from './AaveV3Ethereum_OnboardingETHxToAaveV3_20240521.sol';

/**
* @dev Test for AaveV3Ethereum_OnboardingETHxToAaveV3_20240521
* command: FOUNDRY_PROFILE=mainnet forge test --match-path=src/20240521_AaveV3Ethereum_OnboardingETHxToAaveV3/AaveV3Ethereum_OnboardingETHxToAaveV3_20240521.t.sol -vv
*/
contract AaveV3Ethereum_OnboardingETHxToAaveV3_20240521_Test is ProtocolV3TestBase {
AaveV3Ethereum_OnboardingETHxToAaveV3_20240521 internal proposal;

function setUp() public {
vm.createSelectFork(vm.rpcUrl('mainnet'), 19937144);
proposal = new AaveV3Ethereum_OnboardingETHxToAaveV3_20240521();
}

/**
* @dev executes the generic test suite including e2e and config snapshots
*/
function test_defaultProposalExecution() public {
defaultTest(
'AaveV3Ethereum_OnboardingETHxToAaveV3_20240521',
AaveV3Ethereum.POOL,
address(proposal)
);
}

function test_collectorHasETHxFunds() public {
GovV3Helpers.executePayload(vm, address(proposal));
(address aTokenAddress, , ) = AaveV3Ethereum
.AAVE_PROTOCOL_DATA_PROVIDER
.getReserveTokensAddresses(proposal.ETHx());
assertGe(IERC20(aTokenAddress).balanceOf(address(AaveV3Ethereum.COLLECTOR)), 0.01 ether);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: "Onboarding ETHx to Aave V3 Ethereum"
author: "karpatkey_TokenLogic"
discussions: "https://governance.aave.com/t/arfc-onboarding-ethx-to-aave-v3-ethereum/15672"
snapshot: "https://snapshot.org/#/aave.eth/proposal/0x9238b091250c739f5b5486ab8dbaa110b0b7ec0582698ea2c2d3721377e4b0bb"
---

## Simple Summary

This publication onboards Stader Lab's ETHx onto the Ethereum Aave v3 deployment as collateral and includes it the ETH-correlated E-Mode category.

## Motivation

Liquid staking tokens (LSTs) have proven to be popular collateral assets on Aave. The ETHx represents Stader’s staked ETH and provides its users with liquid staking benefits. Supporting ETHx on Aave V3 promotes LST diversity and complements existing assets like stETH, cbETH and rETH.

Given their high correlation to ETH, LSTs are commonly used as collateral to borrow ETH and engage in yield leveraged staking. Several communities have built products that automate such strategies on top of Aave. The inclusion of ETHx in the ETH-category E-Mode enables these strategies to maximize the yield potential of the recursive strategy.

The risk parameters have been provided by Chaos Labs, and the smart contracts of ETHx reviewed by BGD Labs. Further details, including LlamaRisk's more qualitative assessment, can be found on the Aave governance forum.

## Specification

The table below illustrates the configured risk parameters for **ETHx**

| Parameter | Value |
| ---------------------------------- | -----------------------------------------: |
| Isolation Mode | false |
| Borrowable | ENABLED |
| Collateral Enabled | true |
| Supply Cap (ETHx) | 3,200 |
| Borrow Cap (ETHx) | 320 |
| Debt Ceiling | USD 0 |
| LTV | 74.5 % |
| LT | 77 % |
| 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 | 0 % |
| Stable Slope2 | 0 % |
| 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 | 0xD6270dAabFe4862306190298C2B48fed9e15C847 |

## References

- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240521_AaveV3Ethereum_OnboardingETHxToAaveV3/AaveV3Ethereum_OnboardingETHxToAaveV3_20240521.sol)
- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240521_AaveV3Ethereum_OnboardingETHxToAaveV3/AaveV3Ethereum_OnboardingETHxToAaveV3_20240521.t.sol)
- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0x9238b091250c739f5b5486ab8dbaa110b0b7ec0582698ea2c2d3721377e4b0bb)
- [Discussion](https://governance.aave.com/t/arfc-onboarding-ethx-to-aave-v3-ethereum/15672)

## Copyright

Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/GovV3Helpers.sol';
import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol';
import {EthereumScript} from 'aave-helpers/ScriptUtils.sol';
import {AaveV3Ethereum_OnboardingETHxToAaveV3_20240521} from './AaveV3Ethereum_OnboardingETHxToAaveV3_20240521.sol';

/**
* @dev Deploy Ethereum
* deploy-command: make deploy-ledger contract=src/20240521_AaveV3Ethereum_OnboardingETHxToAaveV3/OnboardingETHxToAaveV3_20240521.s.sol:DeployEthereum chain=mainnet
* verify-command: FOUNDRY_PROFILE=mainnet npx catapulta-verify -b broadcast/OnboardingETHxToAaveV3_20240521.s.sol/1/run-latest.json
*/
contract DeployEthereum is EthereumScript {
function run() external broadcast {
// deploy payloads
address payload0 = GovV3Helpers.deployDeterministic(
type(AaveV3Ethereum_OnboardingETHxToAaveV3_20240521).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/20240521_AaveV3Ethereum_OnboardingETHxToAaveV3/OnboardingETHxToAaveV3_20240521.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_OnboardingETHxToAaveV3_20240521).creationCode
);
payloads[0] = GovV3Helpers.buildMainnetPayload(vm, actionsEthereum);

// create proposal
vm.startBroadcast();
GovV3Helpers.createProposal(
vm,
payloads,
GovernanceV3Ethereum.VOTING_PORTAL_ETH_POL,
GovV3Helpers.ipfsHashFile(
vm,
'src/20240521_AaveV3Ethereum_OnboardingETHxToAaveV3/OnboardingETHxToAaveV3.md'
)
);
}
}
Loading
Loading