Skip to content

Commit 5e1fb97

Browse files
marczellermarczellersakulstra
authored
Add USDC to Lido (#472)
Co-authored-by: marczeller <[email protected]> Co-authored-by: Lukas <[email protected]>
1 parent e190604 commit 5e1fb97

7 files changed

+394
-0
lines changed

.assets/964cf35b8d3a35020a80b38115449e51d8c0ae34.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
## Reserve changes
2+
3+
### Reserves added
4+
5+
#### USDC ([0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48](https://etherscan.io/address/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48))
6+
7+
| description | value |
8+
| --- | --- |
9+
| decimals | 6 |
10+
| isActive | true |
11+
| isFrozen | false |
12+
| supplyCap | 30,000,000 USDC |
13+
| borrowCap | 27,600,000 USDC |
14+
| debtCeiling | 0 $ [0] |
15+
| isSiloed | false |
16+
| isFlashloanable | true |
17+
| eModeCategory | 0 |
18+
| oracle | [0x736bF902680e68989886e9807CD7Db4B3E015d3C](https://etherscan.io/address/0x736bF902680e68989886e9807CD7Db4B3E015d3C) |
19+
| oracleDecimals | 8 |
20+
| oracleDescription | Capped USDC/USD |
21+
| oracleLatestAnswer | 0.99995995 |
22+
| usageAsCollateralEnabled | false |
23+
| ltv | 0 % [0] |
24+
| liquidationThreshold | 0 % [0] |
25+
| liquidationBonus | 0 % |
26+
| liquidationProtocolFee | 0 % [0] |
27+
| reserveFactor | 10 % [1000] |
28+
| aToken | [0x09AA30b182488f769a9824F15E6Ce58591Da4781](https://etherscan.io/address/0x09AA30b182488f769a9824F15E6Ce58591Da4781) |
29+
| aTokenImpl | [0x7F8Fc14D462bdF93c681c1f2Fd615389bF969Fb2](https://etherscan.io/address/0x7F8Fc14D462bdF93c681c1f2Fd615389bF969Fb2) |
30+
| variableDebtToken | [0x2D9fe18b6c35FE439cC15D932cc5C943bf2d901E](https://etherscan.io/address/0x2D9fe18b6c35FE439cC15D932cc5C943bf2d901E) |
31+
| variableDebtTokenImpl | [0x3E59212c34588a63350142EFad594a20C88C2CEd](https://etherscan.io/address/0x3E59212c34588a63350142EFad594a20C88C2CEd) |
32+
| stableDebtToken | [0x779dB175167C60c2B2193Be6B8d8B3602435e89E](https://etherscan.io/address/0x779dB175167C60c2B2193Be6B8d8B3602435e89E) |
33+
| stableDebtTokenImpl | [0x36284fED68f802c5733432c3306D8e92c504a243](https://etherscan.io/address/0x36284fED68f802c5733432c3306D8e92c504a243) |
34+
| borrowingEnabled | true |
35+
| stableBorrowRateEnabled | false |
36+
| isBorrowableInIsolation | true |
37+
| interestRateStrategy | [0x6642dcAaBc80807DD083c66a301d308568CBcA3D](https://etherscan.io/address/0x6642dcAaBc80807DD083c66a301d308568CBcA3D) |
38+
| aTokenName | Aave Ethereum Lido USDC |
39+
| aTokenSymbol | aEthLidoUSDC |
40+
| aTokenUnderlyingBalance | 100 USDC [100000000] |
41+
| isPaused | false |
42+
| stableDebtTokenName | Aave Ethereum Lido Stable Debt USDC |
43+
| stableDebtTokenSymbol | stableDebtEthLidoUSDC |
44+
| variableDebtTokenName | Aave Ethereum Lido Variable Debt USDC |
45+
| variableDebtTokenSymbol | variableDebtEthLidoUSDC |
46+
| virtualAccountingActive | true |
47+
| virtualBalance | 100 USDC [100000000] |
48+
| optimalUsageRatio | 92 % |
49+
| maxVariableBorrowRate | 65.5 % |
50+
| baseVariableBorrowRate | 0 % |
51+
| variableRateSlope1 | 5.5 % |
52+
| variableRateSlope2 | 60 % |
53+
| interestRate | ![ir](/.assets/964cf35b8d3a35020a80b38115449e51d8c0ae34.svg) |
54+
55+
56+
## Raw diff
57+
58+
```json
59+
{
60+
"reserves": {
61+
"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48": {
62+
"from": null,
63+
"to": {
64+
"aToken": "0x09AA30b182488f769a9824F15E6Ce58591Da4781",
65+
"aTokenImpl": "0x7F8Fc14D462bdF93c681c1f2Fd615389bF969Fb2",
66+
"aTokenName": "Aave Ethereum Lido USDC",
67+
"aTokenSymbol": "aEthLidoUSDC",
68+
"aTokenUnderlyingBalance": 100000000,
69+
"borrowCap": 27600000,
70+
"borrowingEnabled": true,
71+
"debtCeiling": 0,
72+
"decimals": 6,
73+
"eModeCategory": 0,
74+
"interestRateStrategy": "0x6642dcAaBc80807DD083c66a301d308568CBcA3D",
75+
"isActive": true,
76+
"isBorrowableInIsolation": true,
77+
"isFlashloanable": true,
78+
"isFrozen": false,
79+
"isPaused": false,
80+
"isSiloed": false,
81+
"liquidationBonus": 0,
82+
"liquidationProtocolFee": 0,
83+
"liquidationThreshold": 0,
84+
"ltv": 0,
85+
"oracle": "0x736bF902680e68989886e9807CD7Db4B3E015d3C",
86+
"oracleDecimals": 8,
87+
"oracleDescription": "Capped USDC/USD",
88+
"oracleLatestAnswer": 99995995,
89+
"reserveFactor": 1000,
90+
"stableBorrowRateEnabled": false,
91+
"stableDebtToken": "0x779dB175167C60c2B2193Be6B8d8B3602435e89E",
92+
"stableDebtTokenImpl": "0x36284fED68f802c5733432c3306D8e92c504a243",
93+
"stableDebtTokenName": "Aave Ethereum Lido Stable Debt USDC",
94+
"stableDebtTokenSymbol": "stableDebtEthLidoUSDC",
95+
"supplyCap": 30000000,
96+
"symbol": "USDC",
97+
"underlying": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
98+
"usageAsCollateralEnabled": false,
99+
"variableDebtToken": "0x2D9fe18b6c35FE439cC15D932cc5C943bf2d901E",
100+
"variableDebtTokenImpl": "0x3E59212c34588a63350142EFad594a20C88C2CEd",
101+
"variableDebtTokenName": "Aave Ethereum Lido Variable Debt USDC",
102+
"variableDebtTokenSymbol": "variableDebtEthLidoUSDC",
103+
"virtualAccountingActive": true,
104+
"virtualBalance": 100000000
105+
}
106+
}
107+
},
108+
"strategies": {
109+
"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48": {
110+
"from": null,
111+
"to": {
112+
"address": "0x6642dcAaBc80807DD083c66a301d308568CBcA3D",
113+
"baseVariableBorrowRate": "0",
114+
"maxVariableBorrowRate": "655000000000000000000000000",
115+
"optimalUsageRatio": "920000000000000000000000000",
116+
"variableRateSlope1": "55000000000000000000000000",
117+
"variableRateSlope2": "600000000000000000000000000"
118+
}
119+
}
120+
}
121+
}
122+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.0;
3+
4+
import {AaveV3EthereumLido, AaveV3EthereumLidoEModes} from 'aave-address-book/AaveV3EthereumLido.sol';
5+
import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol';
6+
import {AaveV3PayloadEthereumLido} from 'aave-helpers/src/v3-config-engine/AaveV3PayloadEthereumLido.sol';
7+
import {EngineFlags} from 'aave-v3-periphery/contracts/v3-config-engine/EngineFlags.sol';
8+
import {IAaveV3ConfigEngine} from 'aave-v3-periphery/contracts/v3-config-engine/IAaveV3ConfigEngine.sol';
9+
import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol';
10+
import {SafeERC20} from 'solidity-utils/contracts/oz-common/SafeERC20.sol';
11+
/**
12+
* @title Onboard USDC to Aave V3 Lido Instance
13+
* @author ACI
14+
* - Snapshot: https://snapshot.org/#/aave.eth/proposal/0x6146daa40066e4000333f628f94263101ae03731ccd9a64303013a26172c9eef
15+
* - Discussion: https://governance.aave.com/t/arfc-onboard-usdc-to-aave-v3-lido-instance/19201
16+
*/
17+
contract AaveV3EthereumLido_OnboardUSDCToAaveV3LidoInstance_20241002 is AaveV3PayloadEthereumLido {
18+
using SafeERC20 for IERC20;
19+
20+
address public constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
21+
uint256 public constant USDC_SEED_AMOUNT = 100e6;
22+
23+
function _postExecute() internal override {
24+
IERC20(USDC).forceApprove(address(AaveV3EthereumLido.POOL), USDC_SEED_AMOUNT);
25+
AaveV3EthereumLido.POOL.supply(
26+
USDC,
27+
USDC_SEED_AMOUNT,
28+
address(AaveV3EthereumLido.COLLECTOR),
29+
0
30+
);
31+
}
32+
33+
function newListings() public pure override returns (IAaveV3ConfigEngine.Listing[] memory) {
34+
IAaveV3ConfigEngine.Listing[] memory listings = new IAaveV3ConfigEngine.Listing[](1);
35+
36+
listings[0] = IAaveV3ConfigEngine.Listing({
37+
asset: USDC,
38+
assetSymbol: 'USDC',
39+
priceFeed: AaveV3EthereumAssets.USDC_ORACLE,
40+
eModeCategory: AaveV3EthereumLidoEModes.NONE,
41+
enabledToBorrow: EngineFlags.ENABLED,
42+
stableRateModeEnabled: EngineFlags.DISABLED,
43+
borrowableInIsolation: EngineFlags.ENABLED,
44+
withSiloedBorrowing: EngineFlags.DISABLED,
45+
flashloanable: EngineFlags.ENABLED,
46+
ltv: 0,
47+
liqThreshold: 0,
48+
liqBonus: 0,
49+
reserveFactor: 10_00,
50+
supplyCap: 30_000_000,
51+
borrowCap: 27_600_000,
52+
debtCeiling: 0,
53+
liqProtocolFee: 10_00,
54+
rateStrategyParams: IAaveV3ConfigEngine.InterestRateInputData({
55+
optimalUsageRatio: 92_00,
56+
baseVariableBorrowRate: 0,
57+
variableRateSlope1: 5_50,
58+
variableRateSlope2: 60_00
59+
})
60+
});
61+
62+
return listings;
63+
}
64+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.0;
3+
4+
import {GovV3Helpers} from 'aave-helpers/src/GovV3Helpers.sol';
5+
import {AaveV3EthereumLido} from 'aave-address-book/AaveV3EthereumLido.sol';
6+
import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol';
7+
8+
import 'forge-std/Test.sol';
9+
import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol';
10+
import {AaveV3EthereumLido_OnboardUSDCToAaveV3LidoInstance_20241002} from './AaveV3EthereumLido_OnboardUSDCToAaveV3LidoInstance_20241002.sol';
11+
12+
/**
13+
* @dev Test for AaveV3EthereumLido_OnboardUSDCToAaveV3LidoInstance_20241002
14+
* command: FOUNDRY_PROFILE=mainnet forge test --match-path=src/20241002_AaveV3EthereumLido_OnboardUSDCToAaveV3LidoInstance/AaveV3EthereumLido_OnboardUSDCToAaveV3LidoInstance_20241002.t.sol -vv
15+
*/
16+
contract AaveV3EthereumLido_OnboardUSDCToAaveV3LidoInstance_20241002_Test is ProtocolV3TestBase {
17+
AaveV3EthereumLido_OnboardUSDCToAaveV3LidoInstance_20241002 internal proposal;
18+
19+
function setUp() public {
20+
vm.createSelectFork(vm.rpcUrl('mainnet'), 20877507);
21+
proposal = new AaveV3EthereumLido_OnboardUSDCToAaveV3LidoInstance_20241002();
22+
}
23+
24+
/**
25+
* @dev executes the generic test suite including e2e and config snapshots
26+
*/
27+
function test_defaultProposalExecution() public {
28+
defaultTest(
29+
'AaveV3EthereumLido_OnboardUSDCToAaveV3LidoInstance_20241002',
30+
AaveV3EthereumLido.POOL,
31+
address(proposal)
32+
);
33+
}
34+
35+
function test_collectorHasUSDCFunds() public {
36+
GovV3Helpers.executePayload(vm, address(proposal));
37+
(address aTokenAddress, , ) = AaveV3EthereumLido
38+
.AAVE_PROTOCOL_DATA_PROVIDER
39+
.getReserveTokensAddresses(proposal.USDC());
40+
assertGe(IERC20(aTokenAddress).balanceOf(address(AaveV3EthereumLido.COLLECTOR)), 100e6);
41+
}
42+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: "Onboard USDC to Aave V3 Lido Instance"
3+
author: "ACI"
4+
discussions: "https://governance.aave.com/t/arfc-onboard-usdc-to-aave-v3-lido-instance/19201"
5+
snapshot: "https://snapshot.org/#/aave.eth/proposal/0x6146daa40066e4000333f628f94263101ae03731ccd9a64303013a26172c9eef"
6+
---
7+
8+
## Simple Summary
9+
10+
This proposal aims to onboard USDC to the Aave v3 Lido Instance.
11+
12+
## Motivation
13+
14+
The integration of USDC into the Aave v3 Lido Instance is driven by the following factors:
15+
16+
- Liquidity Enhancement: The inclusion of this widely-used stablecoin is expected to boost liquidity in the Lido Instance, potentially attracting more users and increasing overall platform activity.
17+
18+
- Strategic Alignment: This move aligns with Aave’s goal of offering a comprehensive suite of high-quality assets, keeping the protocol at the forefront of DeFi liquidity.
19+
20+
## Specification
21+
22+
The table below illustrates the configured risk parameters for **USDC**
23+
24+
| Parameter | Value |
25+
| ------------------------- | --------------------------------------------------------------------------------------------------------------------: |
26+
| Isolation Mode | false |
27+
| Borrowable | ENABLED |
28+
| Collateral Enabled | false |
29+
| Supply Cap (USDC) | 30,000,000 |
30+
| Borrow Cap (USDC) | 27,600,000 |
31+
| Debt Ceiling | USD 0 |
32+
| LTV | 0 % |
33+
| LT | 0 % |
34+
| Liquidation Bonus | 0 % |
35+
| Liquidation Protocol Fee | 10 % |
36+
| Reserve Factor | 10 % |
37+
| Base Variable Borrow Rate | 0 % |
38+
| Variable Slope 1 | 5.5 % |
39+
| Variable Slope 2 | 60 % |
40+
| Uoptimal | 92 % |
41+
| Stable Borrowing | DISABLED |
42+
| Flashloanable | ENABLED |
43+
| Siloed Borrowing | DISABLED |
44+
| Borrowable in Isolation | ENABLED |
45+
| Oracle | [0x736bF902680e68989886e9807CD7Db4B3E015d3C](https://etherscan.io/address/0x736bF902680e68989886e9807CD7Db4B3E015d3C) |
46+
47+
## References
48+
49+
- Implementation: [AaveV3EthereumLido](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241002_AaveV3EthereumLido_OnboardUSDCToAaveV3LidoInstance/AaveV3EthereumLido_OnboardUSDCToAaveV3LidoInstance_20241002.sol)
50+
- Tests: [AaveV3EthereumLido](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241002_AaveV3EthereumLido_OnboardUSDCToAaveV3LidoInstance/AaveV3EthereumLido_OnboardUSDCToAaveV3LidoInstance_20241002.t.sol)
51+
- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0x6146daa40066e4000333f628f94263101ae03731ccd9a64303013a26172c9eef)
52+
- [Discussion](https://governance.aave.com/t/arfc-onboard-usdc-to-aave-v3-lido-instance/19201)
53+
54+
## Copyright
55+
56+
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.0;
3+
4+
import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/src/GovV3Helpers.sol';
5+
import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol';
6+
import {EthereumScript} from 'solidity-utils/contracts/utils/ScriptUtils.sol';
7+
import {AaveV3EthereumLido_OnboardUSDCToAaveV3LidoInstance_20241002} from './AaveV3EthereumLido_OnboardUSDCToAaveV3LidoInstance_20241002.sol';
8+
9+
/**
10+
* @dev Deploy Ethereum
11+
* deploy-command: make deploy-ledger contract=src/20241002_AaveV3EthereumLido_OnboardUSDCToAaveV3LidoInstance/OnboardUSDCToAaveV3LidoInstance_20241002.s.sol:DeployEthereum chain=mainnet
12+
* verify-command: FOUNDRY_PROFILE=mainnet npx catapulta-verify -b broadcast/OnboardUSDCToAaveV3LidoInstance_20241002.s.sol/1/run-latest.json
13+
*/
14+
contract DeployEthereum is EthereumScript {
15+
function run() external broadcast {
16+
// deploy payloads
17+
address payload0 = GovV3Helpers.deployDeterministic(
18+
type(AaveV3EthereumLido_OnboardUSDCToAaveV3LidoInstance_20241002).creationCode
19+
);
20+
21+
// compose action
22+
IPayloadsControllerCore.ExecutionAction[]
23+
memory actions = new IPayloadsControllerCore.ExecutionAction[](1);
24+
actions[0] = GovV3Helpers.buildAction(payload0);
25+
26+
// register action at payloadsController
27+
GovV3Helpers.createPayload(actions);
28+
}
29+
}
30+
31+
/**
32+
* @dev Create Proposal
33+
* command: make deploy-ledger contract=src/20241002_AaveV3EthereumLido_OnboardUSDCToAaveV3LidoInstance/OnboardUSDCToAaveV3LidoInstance_20241002.s.sol:CreateProposal chain=mainnet
34+
*/
35+
contract CreateProposal is EthereumScript {
36+
function run() external {
37+
// create payloads
38+
PayloadsControllerUtils.Payload[] memory payloads = new PayloadsControllerUtils.Payload[](1);
39+
40+
// compose actions for validation
41+
IPayloadsControllerCore.ExecutionAction[]
42+
memory actionsEthereum = new IPayloadsControllerCore.ExecutionAction[](1);
43+
actionsEthereum[0] = GovV3Helpers.buildAction(
44+
type(AaveV3EthereumLido_OnboardUSDCToAaveV3LidoInstance_20241002).creationCode
45+
);
46+
payloads[0] = GovV3Helpers.buildMainnetPayload(vm, actionsEthereum);
47+
48+
// create proposal
49+
vm.startBroadcast();
50+
GovV3Helpers.createProposal(
51+
vm,
52+
payloads,
53+
GovernanceV3Ethereum.VOTING_PORTAL_ETH_POL,
54+
GovV3Helpers.ipfsHashFile(
55+
vm,
56+
'src/20241002_AaveV3EthereumLido_OnboardUSDCToAaveV3LidoInstance/OnboardUSDCToAaveV3LidoInstance.md'
57+
)
58+
);
59+
}
60+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import {ConfigFile} from '../../generator/types';
2+
export const config: ConfigFile = {
3+
rootOptions: {
4+
pools: ['AaveV3EthereumLido'],
5+
title: 'Onboard USDC to Aave V3 Lido Instance',
6+
shortName: 'OnboardUSDCToAaveV3LidoInstance',
7+
date: '20241002',
8+
author: 'ACI',
9+
discussion: 'https://governance.aave.com/t/arfc-onboard-usdc-to-aave-v3-lido-instance/19201',
10+
snapshot:
11+
'https://snapshot.org/#/aave.eth/proposal/0x6146daa40066e4000333f628f94263101ae03731ccd9a64303013a26172c9eef',
12+
votingNetwork: 'POLYGON',
13+
},
14+
poolOptions: {
15+
AaveV3EthereumLido: {
16+
configs: {
17+
ASSET_LISTING: [
18+
{
19+
assetSymbol: 'USDC',
20+
decimals: 6,
21+
priceFeed: '0x736bF902680e68989886e9807CD7Db4B3E015d3C',
22+
ltv: '0',
23+
liqThreshold: '0',
24+
liqBonus: '0',
25+
debtCeiling: '0',
26+
liqProtocolFee: '10',
27+
enabledToBorrow: 'ENABLED',
28+
flashloanable: 'ENABLED',
29+
stableRateModeEnabled: 'DISABLED',
30+
borrowableInIsolation: 'ENABLED',
31+
withSiloedBorrowing: 'DISABLED',
32+
reserveFactor: '10',
33+
supplyCap: '30000000',
34+
borrowCap: '27600000',
35+
rateStrategyParams: {
36+
optimalUtilizationRate: '92',
37+
baseVariableBorrowRate: '0',
38+
variableRateSlope1: '5.5',
39+
variableRateSlope2: '60',
40+
},
41+
eModeCategory: 'AaveV3EthereumLidoEModes.NONE',
42+
asset: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
43+
},
44+
],
45+
},
46+
cache: {blockNumber: 20877326},
47+
},
48+
},
49+
};

0 commit comments

Comments
 (0)