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

SfrxETH onboarding - Needs CAPO feed #272

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
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 sfrxETH Onboarding
* @author Aave Chan Initiative
* - Snapshot: https://snapshot.org/#/aave.eth/proposal/0x7b5eb16470a0246d8515fc551962740735c7db93bf7c39810e7d3126c04e49c3
* - Discussion: https://governance.aave.com/t/arfc-onboarding-sfrxeth-to-aave-v3-ethereum/15673
*/
contract AaveV3Ethereum_SfrxETHListing_20240321 is AaveV3PayloadEthereum {
using SafeERC20 for IERC20;

address public constant sfrxETH = 0xac3E018457B222d93114458476f3E3416Abbe38F;
uint256 public constant sfrxETH_SEED_AMOUNT = 1e16;

function _postExecute() internal override {
IERC20(sfrxETH).forceApprove(address(AaveV3Ethereum.POOL), sfrxETH_SEED_AMOUNT);
AaveV3Ethereum.POOL.supply(sfrxETH, sfrxETH_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: sfrxETH,
assetSymbol: 'sfrxETH',
priceFeed: 0x0000000000000000000000000000000000000000,
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: 5_00,
reserveFactor: 15_00,
supplyCap: 55_000,
borrowCap: 5_500,
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,38 @@
// 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_SfrxETHListing_20240321} from './AaveV3Ethereum_SfrxETHListing_20240321.sol';

/**
* @dev Test for AaveV3Ethereum_SfrxETHListing_20240321
* command: make test-contract filter=AaveV3Ethereum_SfrxETHListing_20240321
*/
contract AaveV3Ethereum_SfrxETHListing_20240321_Test is ProtocolV3TestBase {
AaveV3Ethereum_SfrxETHListing_20240321 internal proposal;

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

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

function test_collectorHassfrxETHFunds() public {
GovV3Helpers.executePayload(vm, address(proposal));
(address aTokenAddress, , ) = AaveV3Ethereum
.AAVE_PROTOCOL_DATA_PROVIDER
.getReserveTokensAddresses(proposal.sfrxETH());
assertGe(IERC20(aTokenAddress).balanceOf(address(AaveV3Ethereum.COLLECTOR)), 10 ** 16);
}
}
61 changes: 61 additions & 0 deletions src/20240321_AaveV3Ethereum_SfrxETHListing/SfrxETHListing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: "sfrxETH Onboarding"
author: "Aave Chan Initiative"
discussions: "https://governance.aave.com/t/arfc-onboarding-sfrxeth-to-aave-v3-ethereum/15673"
snapshot: "https://snapshot.org/#/aave.eth/proposal/0x7b5eb16470a0246d8515fc551962740735c7db93bf7c39810e7d3126c04e49c3"
---

## Simple Summary

This ARFC proposes the addition of sfrxETH from Frax to Aave V3 Ethereum to enhance LST liquidity and asset diversity.

## Motivation

sFrxETH is the Staked version of FrxETH from the Frax Ecosystem. Users can freely mint frxETH in exchange for ETH deposits.

The Aave-Chan Initiative supports LST diversity in Aave V3 as shown with our historical support of cbETH, rETH, and, parallel to this proposal, our support for ETHx.

This proposal is a reboot of [ARC Proposal: Onboarding sfrxETH from Frax Protocol to Aave V3 Ethereum Market 10 ](https://governance.aave.com/t/arc-proposal-onboarding-sfrxeth-from-frax-protocol-to-aave-v3-ethereum-market/11510) from January. More details for sFrxETH can be found in the first proposal.

## Specification

The table below illustrates the configured risk parameters for [sfrxETH](https://etherscan.io/token/0xac3e018457b222d93114458476f3e3416abbe38f)

| Parameter | Value |
| ---------------------------------- | -----------------------------------------: |
| Isolation Mode | true |
| Borrowable | ENABLED |
| Collateral Enabled | true |
| Supply Cap (sfrxETH) | 55,000 |
| Borrow Cap (sfrxETH) | 5,500 |
| Debt Ceiling | USD 0 |
| LTV | 74.5 % |
| LT | 77 % |
| Liquidation Bonus | 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 | 0x0000000000000000000000000000000000000000 |

## References

- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240321_AaveV3Ethereum_SfrxETHListing/AaveV3Ethereum_SfrxETHListing_20240321.sol)
- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240321_AaveV3Ethereum_SfrxETHListing/AaveV3Ethereum_SfrxETHListing_20240321.t.sol)
- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0x7b5eb16470a0246d8515fc551962740735c7db93bf7c39810e7d3126c04e49c3)
- [Discussion](https://governance.aave.com/t/arfc-onboarding-sfrxeth-to-aave-v3-ethereum/15673)

## 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,55 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/GovV3Helpers.sol';
import {EthereumScript} from 'aave-helpers/ScriptUtils.sol';
import {AaveV3Ethereum_SfrxETHListing_20240321} from './AaveV3Ethereum_SfrxETHListing_20240321.sol';

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

// create proposal
vm.startBroadcast();
GovV3Helpers.createProposal(
vm,
payloads,
GovV3Helpers.ipfsHashFile(vm, 'src/20240321_AaveV3Ethereum_SfrxETHListing/SfrxETHListing.md')
);
}
}
55 changes: 55 additions & 0 deletions src/20240321_AaveV3Ethereum_SfrxETHListing/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import {ConfigFile} from '../../generator/types';
export const config: ConfigFile = {
rootOptions: {
configFile: 'src/20240321_AaveV3Ethereum_SfrxETHListing/config.ts',
force: true,
author: 'Aave Chan Initiative',
pools: ['AaveV3Ethereum'],
title: 'sfrxETH Listing',
shortName: 'SfrxETHListing',
date: '20240321',
discussion: 'https://governance.aave.com/t/arfc-onboarding-sfrxeth-to-aave-v3-ethereum/15673',
snapshot:
'https://snapshot.org/#/aave.eth/proposal/0x7b5eb16470a0246d8515fc551962740735c7db93bf7c39810e7d3126c04e49c3',
},
poolOptions: {
AaveV3Ethereum: {
configs: {
ASSET_LISTING: [
{
assetSymbol: 'sfrxETH',
decimals: 18,
priceFeed: '0x0000000000000000000000000000000000000000',
ltv: '74.5',
liqThreshold: '77',
liqBonus: '5',
debtCeiling: '0',
liqProtocolFee: '10',
enabledToBorrow: 'ENABLED',
flashloanable: 'ENABLED',
stableRateModeEnabled: 'DISABLED',
borrowableInIsolation: 'DISABLED',
withSiloedBorrowing: 'DISABLED',
reserveFactor: '15',
supplyCap: '55000',
borrowCap: '5500',
rateStrategyParams: {
optimalUtilizationRate: '45',
baseVariableBorrowRate: '0',
variableRateSlope1: '7',
variableRateSlope2: '300',
stableRateSlope1: '0',
stableRateSlope2: '0',
baseStableRateOffset: '0',
stableRateExcessOffset: '0',
optimalStableToTotalDebtRatio: '0',
},
eModeCategory: 'AaveV3EthereumEModes.ETH_CORRELATED',
asset: '0xac3E018457B222d93114458476f3E3416Abbe38F',
},
],
},
cache: {blockNumber: 19479117},
},
},
};