This repository has been archived by the owner on Nov 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Generator output * fill in markdown document * Payload code * payload test * properly capitalize STG token address * smoll fix & test result * init * fixed test * lint + simpler tests * deployed payload --------- Co-authored-by: Rozengarden <[email protected]>
- Loading branch information
1 parent
8a39d83
commit 140a375
Showing
5 changed files
with
303 additions
and
0 deletions.
There are no files selected for viewing
108 changes: 108 additions & 0 deletions
108
...et_20231008_postAaveV3_Ethereum_STGOnboardingOnAaveV3EthereumMarket_20231008.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,108 @@ | ||
## Reserve changes | ||
|
||
### Reserves added | ||
|
||
#### STG ([0xAf5191B0De278C7286d6C7CC6ab6BB8A73bA2Cd6](https://etherscan.io/address/0xAf5191B0De278C7286d6C7CC6ab6BB8A73bA2Cd6)) | ||
|
||
| description | value | | ||
| --- | --- | | ||
| decimals | 18 | | ||
| isActive | true | | ||
| isFrozen | false | | ||
| supplyCap | 10,000,000 STG | | ||
| borrowCap | 5,500,000 STG | | ||
| debtCeiling | 3,000,000 $ | | ||
| isSiloed | false | | ||
| isFlashloanable | true | | ||
| eModeCategory | 0 | | ||
| oracle | [0x7A9f34a0Aa917D438e9b6E630067062B7F8f6f3d](https://etherscan.io/address/0x7A9f34a0Aa917D438e9b6E630067062B7F8f6f3d) | | ||
| oracleDecimals | 8 | | ||
| oracleDescription | STG / USD | | ||
| oracleLatestAnswer | 0.42768706 | | ||
| usageAsCollateralEnabled | true | | ||
| ltv | 35 % | | ||
| liquidationThreshold | 40 % | | ||
| liquidationBonus | 10 % | | ||
| liquidationProtocolFee | 10 % | | ||
| reserveFactor | 20 % | | ||
| aToken | [0x1bA9843bD4327c6c77011406dE5fA8749F7E3479](https://etherscan.io/address/0x1bA9843bD4327c6c77011406dE5fA8749F7E3479) | | ||
| aTokenImpl | [0x7EfFD7b47Bfd17e52fB7559d3f924201b9DbfF3d](https://etherscan.io/address/0x7EfFD7b47Bfd17e52fB7559d3f924201b9DbfF3d) | | ||
| variableDebtToken | [0x655568bDd6168325EC7e58Bf39b21A856F906Dc2](https://etherscan.io/address/0x655568bDd6168325EC7e58Bf39b21A856F906Dc2) | | ||
| variableDebtTokenImpl | [0xaC725CB59D16C81061BDeA61041a8A5e73DA9EC6](https://etherscan.io/address/0xaC725CB59D16C81061BDeA61041a8A5e73DA9EC6) | | ||
| stableDebtToken | [0xc3115D0660b93AeF10F298886ae22E3Dd477E482](https://etherscan.io/address/0xc3115D0660b93AeF10F298886ae22E3Dd477E482) | | ||
| stableDebtTokenImpl | [0x15C5620dfFaC7c7366EED66C20Ad222DDbB1eD57](https://etherscan.io/address/0x15C5620dfFaC7c7366EED66C20Ad222DDbB1eD57) | | ||
| borrowingEnabled | true | | ||
| stableBorrowRateEnabled | false | | ||
| isBorrowableInIsolation | false | | ||
| interestRateStrategy | [0x27eFE5db315b71753b2a38ED3d5dd7E9362ba93F](https://etherscan.io/address/0x27eFE5db315b71753b2a38ED3d5dd7E9362ba93F) | | ||
| aTokenName | Aave Ethereum STG | | ||
| aTokenSymbol | aEthSTG | | ||
| isPaused | false | | ||
| stableDebtTokenName | Aave Ethereum Stable Debt STG | | ||
| stableDebtTokenSymbol | stableDebtEthSTG | | ||
| variableDebtTokenName | Aave Ethereum Variable Debt STG | | ||
| variableDebtTokenSymbol | variableDebtEthSTG | | ||
| optimalUsageRatio | 45 % | | ||
| maxExcessUsageRatio | 55 % | | ||
| baseVariableBorrowRate | 0 % | | ||
| variableRateSlope1 | 7 % | | ||
| variableRateSlope2 | 300 % | | ||
| baseStableBorrowRate | 10 % | | ||
| stableRateSlope1 | 13 % | | ||
| stableRateSlope2 | 300 % | | ||
| optimalStableToTotalDebtRatio | 20 % | | ||
| maxExcessStableToTotalDebtRatio | 80 % | | ||
| interestRate | ![ir](/.assets/eda3aded0333ece535adb2c0df7f1b16add284a2.svg) | | ||
|
||
|
||
## Raw diff | ||
|
||
```json | ||
{ | ||
"reserves": { | ||
"0xAf5191B0De278C7286d6C7CC6ab6BB8A73bA2Cd6": { | ||
"from": null, | ||
"to": { | ||
"aToken": "0x1bA9843bD4327c6c77011406dE5fA8749F7E3479", | ||
"aTokenImpl": "0x7EfFD7b47Bfd17e52fB7559d3f924201b9DbfF3d", | ||
"aTokenName": "Aave Ethereum STG", | ||
"aTokenSymbol": "aEthSTG", | ||
"borrowCap": 5500000, | ||
"borrowingEnabled": true, | ||
"debtCeiling": 300000000, | ||
"decimals": 18, | ||
"eModeCategory": 0, | ||
"interestRateStrategy": "0x27eFE5db315b71753b2a38ED3d5dd7E9362ba93F", | ||
"isActive": true, | ||
"isBorrowableInIsolation": false, | ||
"isFlashloanable": true, | ||
"isFrozen": false, | ||
"isPaused": false, | ||
"isSiloed": false, | ||
"liquidationBonus": 11000, | ||
"liquidationProtocolFee": 1000, | ||
"liquidationThreshold": 4000, | ||
"ltv": 3500, | ||
"oracle": "0x7A9f34a0Aa917D438e9b6E630067062B7F8f6f3d", | ||
"oracleDecimals": 8, | ||
"oracleDescription": "STG / USD", | ||
"oracleLatestAnswer": 42768706, | ||
"reserveFactor": 2000, | ||
"stableBorrowRateEnabled": false, | ||
"stableDebtToken": "0xc3115D0660b93AeF10F298886ae22E3Dd477E482", | ||
"stableDebtTokenImpl": "0x15C5620dfFaC7c7366EED66C20Ad222DDbB1eD57", | ||
"stableDebtTokenName": "Aave Ethereum Stable Debt STG", | ||
"stableDebtTokenSymbol": "stableDebtEthSTG", | ||
"supplyCap": 10000000, | ||
"symbol": "STG", | ||
"underlying": "0xAf5191B0De278C7286d6C7CC6ab6BB8A73bA2Cd6", | ||
"usageAsCollateralEnabled": true, | ||
"variableDebtToken": "0x655568bDd6168325EC7e58Bf39b21A856F906Dc2", | ||
"variableDebtTokenImpl": "0xaC725CB59D16C81061BDeA61041a8A5e73DA9EC6", | ||
"variableDebtTokenName": "Aave Ethereum Variable Debt STG", | ||
"variableDebtTokenSymbol": "variableDebtEthSTG" | ||
} | ||
} | ||
} | ||
} | ||
``` |
52 changes: 52 additions & 0 deletions
52
...ngOnAaveV3EthereumMarket/AaveV3_Ethereum_STGOnboardingOnAaveV3EthereumMarket_20231008.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,52 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {AaveV3PayloadEthereum, IEngine, Rates, EngineFlags} from 'lib/aave-helpers/src/v3-config-engine/AaveV3PayloadEthereum.sol'; | ||
|
||
/** | ||
* @title STG onboarding on AaveV3 Ethereum Market | ||
* @author Alice Rozengarden (@Rozengarden - Aave-chan initiative) | ||
* - Snapshot: https://signal.aave.com/#/proposal/0x917d0a2c0d9a107d5f8c83b76c291bb34a6a94b85b833b2add96bce7681522ef | ||
* - Discussion: https://governance.aave.com/t/arfc-stg-onboarding-on-aavev3-ethereum-market/14973 | ||
*/ | ||
contract AaveV3_Ethereum_STGOnboardingOnAaveV3EthereumMarket_20231008 is AaveV3PayloadEthereum { | ||
address public constant STG = 0xAf5191B0De278C7286d6C7CC6ab6BB8A73bA2Cd6; | ||
address public constant STG_PRICE_FEED = 0x7A9f34a0Aa917D438e9b6E630067062B7F8f6f3d; | ||
|
||
function newListings() public pure override returns (IEngine.Listing[] memory) { | ||
IEngine.Listing[] memory listings = new IEngine.Listing[](1); | ||
|
||
listings[0] = IEngine.Listing({ | ||
asset: STG, | ||
assetSymbol: 'STG', | ||
priceFeed: STG_PRICE_FEED, | ||
rateStrategyParams: Rates.RateStrategyParams({ | ||
optimalUsageRatio: _bpsToRay(45_00), | ||
baseVariableBorrowRate: 0, | ||
variableRateSlope1: _bpsToRay(7_00), | ||
variableRateSlope2: _bpsToRay(300_00), | ||
stableRateSlope1: _bpsToRay(13_00), | ||
stableRateSlope2: _bpsToRay(300_00), | ||
baseStableRateOffset: _bpsToRay(3_00), | ||
stableRateExcessOffset: _bpsToRay(5_00), | ||
optimalStableToTotalDebtRatio: _bpsToRay(20_00) | ||
}), | ||
enabledToBorrow: EngineFlags.ENABLED, | ||
stableRateModeEnabled: EngineFlags.DISABLED, | ||
borrowableInIsolation: EngineFlags.DISABLED, | ||
withSiloedBorrowing: EngineFlags.DISABLED, | ||
flashloanable: EngineFlags.ENABLED, | ||
ltv: 35_00, | ||
liqThreshold: 40_00, | ||
liqBonus: 10_00, | ||
reserveFactor: 20_00, | ||
supplyCap: 10_000_000, | ||
borrowCap: 5_500_000, | ||
debtCeiling: 3_000_000, | ||
liqProtocolFee: 10_00, | ||
eModeCategory: 0 | ||
}); | ||
|
||
return listings; | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
...OnAaveV3EthereumMarket/AaveV3_Ethereum_STGOnboardingOnAaveV3EthereumMarket_20231008.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,45 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import 'forge-std/Test.sol'; | ||
import {GovHelpers} from 'aave-helpers/GovHelpers.sol'; | ||
import {AaveGovernanceV2} from 'aave-address-book/AaveGovernanceV2.sol'; | ||
import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol'; | ||
import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/ProtocolV3TestBase.sol'; | ||
import {AaveV3_Ethereum_STGOnboardingOnAaveV3EthereumMarket_20231008} from './AaveV3_Ethereum_STGOnboardingOnAaveV3EthereumMarket_20231008.sol'; | ||
|
||
/** | ||
* @dev Test for AaveV3_Ethereum_STGOnboardingOnAaveV3EthereumMarket_20231008 | ||
* command: make test-contract filter=AaveV3_Ethereum_STGOnboardingOnAaveV3EthereumMarket_20231008 | ||
*/ | ||
contract AaveV3_Ethereum_STGOnboardingOnAaveV3EthereumMarket_20231008_Test is ProtocolV3TestBase { | ||
AaveV3_Ethereum_STGOnboardingOnAaveV3EthereumMarket_20231008 internal proposal; | ||
|
||
function setUp() public { | ||
vm.createSelectFork(vm.rpcUrl('mainnet'), 18313652); | ||
proposal = new AaveV3_Ethereum_STGOnboardingOnAaveV3EthereumMarket_20231008(); | ||
} | ||
|
||
function testProposalExecution() public { | ||
ReserveConfig[] memory allConfigsBefore = createConfigurationSnapshot( | ||
'preAaveV3_Ethereum_STGOnboardingOnAaveV3EthereumMarket_20231008', | ||
AaveV3Ethereum.POOL | ||
); | ||
|
||
GovHelpers.executePayload(vm, address(proposal), AaveGovernanceV2.SHORT_EXECUTOR); | ||
|
||
ReserveConfig[] memory allConfigsAfter = createConfigurationSnapshot( | ||
'postAaveV3_Ethereum_STGOnboardingOnAaveV3EthereumMarket_20231008', | ||
AaveV3Ethereum.POOL | ||
); | ||
|
||
_noReservesConfigsChangesApartNewListings(allConfigsBefore, allConfigsAfter); | ||
|
||
diffReports( | ||
'preAaveV3_Ethereum_STGOnboardingOnAaveV3EthereumMarket_20231008', | ||
'postAaveV3_Ethereum_STGOnboardingOnAaveV3EthereumMarket_20231008' | ||
); | ||
|
||
e2eTest(AaveV3Ethereum.POOL); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...nboardingOnAaveV3EthereumMarket/AaveV3_STGOnboardingOnAaveV3EthereumMarket_20231008.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,34 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {GovHelpers} from 'aave-helpers/GovHelpers.sol'; | ||
import {EthereumScript} from 'aave-helpers/ScriptUtils.sol'; | ||
import {AaveV3_Ethereum_STGOnboardingOnAaveV3EthereumMarket_20231008} from './AaveV3_Ethereum_STGOnboardingOnAaveV3EthereumMarket_20231008.sol'; | ||
|
||
/** | ||
* @dev Deploy AaveV3_Ethereum_STGOnboardingOnAaveV3EthereumMarket_20231008 | ||
* command: make deploy-ledger contract=src/20231008_AaveV3_Eth_STGOnboardingOnAaveV3EthereumMarket/AaveV3_STGOnboardingOnAaveV3EthereumMarket_20231008.s.sol:DeployEthereum chain=mainnet | ||
*/ | ||
contract DeployEthereum is EthereumScript { | ||
function run() external broadcast { | ||
new AaveV3_Ethereum_STGOnboardingOnAaveV3EthereumMarket_20231008(); | ||
} | ||
} | ||
|
||
/** | ||
* @dev Create Proposal | ||
* command: make deploy-ledger contract=src/20231008_AaveV3_Eth_STGOnboardingOnAaveV3EthereumMarket/AaveV3_STGOnboardingOnAaveV3EthereumMarket_20231008.s.sol:CreateProposal chain=mainnet | ||
*/ | ||
contract CreateProposal is EthereumScript { | ||
function run() external broadcast { | ||
GovHelpers.Payload[] memory payloads = new GovHelpers.Payload[](1); | ||
payloads[0] = GovHelpers.buildMainnet(0x4e7d1aFAc9AF73fc96aE4382DBfFc7dd358A6568); | ||
GovHelpers.createProposal( | ||
payloads, | ||
GovHelpers.ipfsHashFile( | ||
vm, | ||
'src/20231008_AaveV3_Eth_STGOnboardingOnAaveV3EthereumMarket/STGOnboardingOnAaveV3EthereumMarket.md' | ||
) | ||
); | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
..._Eth_STGOnboardingOnAaveV3EthereumMarket/STGOnboardingOnAaveV3EthereumMarket.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,64 @@ | ||
--- | ||
title: "STG onboarding on AaveV3 Ethereum Market" | ||
author: "Alice Rozengarden (@Rozengarden - Aave-chan initiative)" | ||
discussions: "https://governance.aave.com/t/arfc-stg-onboarding-on-aavev3-ethereum-market/14973" | ||
--- | ||
|
||
## Simple Summary | ||
|
||
This ARFC is proposing to add the STG token from Stargate to the AaveV3 Ethereum market in isolation mode. | ||
|
||
## Motivation | ||
|
||
Stargate is a composable, omnichain bridge built on top of the LayerZero protocol. Its goal is to bring enhanced utility to users and Dapps by allowing the transfer of assets across chains from unified liquidity with immediate and guaranteed finality. | ||
|
||
Having reached $15 Billion in cumulative volume and ranked first in bridged volume over the last month, Stargate is becoming the most used bridge. Its token, the STG is using a linear ve-locking to offer governance power and fee redistribution to it’s users. With a circulating supply of 200M over the 1000M expected it brings the capitalization to $90M. | ||
|
||
Integrating the STG token into the Ethereum Aave v3 will enhance asset diversification, offering borrowers and lenders expanded avenues to leverage the protocol. This integration will empower users to deposit STG as collateral and borrow STG, paving the way for new revenue streams for Aave. | ||
|
||
This onboarding is considered in isolation mode with conservative LTV and debt ceiling parameters to limit protocol exposure. | ||
|
||
## Specification | ||
|
||
We propose the followings parameters in accordfance with the risk providers | ||
| Parameter | Value | | ||
| --- | --- | | ||
| Isolation Mode | Yes | | ||
| Borrowable | Yes | | ||
| Collateral Enabled | Yes | | ||
| Supply Cap (STG) | 10,000,000 | | ||
| Borrow Cap (STG) | 5,500,000 | | ||
| Debt Ceiling | 3M$ | | ||
| LTV | 35.00% | | ||
| LT | 40.00% | | ||
| Liquidation Bonus | 10.00% | | ||
| Liquidation Protocol Fee | 10.00% | | ||
| Variable Base | 0.00% | | ||
| Variable Slope1 | 7.00% | | ||
| Variable Slope2 | 300.00% | | ||
| Uoptimal | 45.00% | | ||
| Reserve Factor | 20.00% | | ||
| Stable Borrowing | Disabled | | ||
| Stable Slope1 | 13.00% | | ||
| Stable Slope2 | 300.00% | | ||
| Base Stable Rate Offset | 3.00% | | ||
| Stable Rate Excess Offset | 5.00% | | ||
| Optimal Stable To Total Debt Ratio | 20.00% | | ||
| Flahloanable | Yes | | ||
| Siloed Borrowing | No | | ||
| Borrowed in Isolation | No | | ||
|
||
- **Ticker**: STG | ||
- **Contract Address**: [0xaf5191b0de278c7286d6c7cc6ab6bb8a73ba2cd6](https://etherscan.io/address/0xaf5191b0de278c7286d6c7cc6ab6bb8a73ba2cd6) | ||
- **Chainlink Oracle STG/USD**: [0x7A9f34a0Aa917D438e9b6E630067062B7F8f6f3d](https://etherscan.io/address/0x7A9f34a0Aa917D438e9b6E630067062B7F8f6f3d) | ||
|
||
## References | ||
|
||
- Implementation: [Ethereum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20231008_AaveV3_Eth_STGOnboardingOnAaveV3EthereumMarket/AaveV3_Ethereum_STGOnboardingOnAaveV3EthereumMarket_20231008.sol) | ||
- Tests: [Ethereum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20231008_AaveV3_Eth_STGOnboardingOnAaveV3EthereumMarket/AaveV3_Ethereum_STGOnboardingOnAaveV3EthereumMarket_20231008.t.sol) | ||
- [Snapshot](https://signal.aave.com/#/proposal/0x917d0a2c0d9a107d5f8c83b76c291bb34a6a94b85b833b2add96bce7681522ef) | ||
- [Discussion](https://governance.aave.com/t/arfc-stg-onboarding-on-aavev3-ethereum-market/14973) | ||
|
||
## Copyright | ||
|
||
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). |
140a375
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 🌈