From 2f24cb894402340a4cb81d9b1971ee7f95ae500b Mon Sep 17 00:00:00 2001 From: Rozengarden Date: Wed, 11 Sep 2024 23:22:50 +0200 Subject: [PATCH 01/15] feat: CAPO for USDS & sUSDS --- Makefile | 4 ++ reports/sUSDS_Ethereum.md | 15 ++++++ scripts/DeployEthereum.s.sol | 52 +++++++++++++++++++ .../lst-adapters/sUSDSPriceCapAdapter.sol | 39 ++++++++++++++ tests/ethereum/USDSPriceCapAdapterTest.t.sol | 16 ++++++ tests/ethereum/sUSDSPriceCapAdapterTest.t.sol | 45 ++++++++++++++++ tests/utils/GetExchangeRatesTest.t.sol | 6 ++- 7 files changed, 175 insertions(+), 2 deletions(-) create mode 100644 reports/sUSDS_Ethereum.md create mode 100644 src/contracts/lst-adapters/sUSDSPriceCapAdapter.sol create mode 100644 tests/ethereum/USDSPriceCapAdapterTest.t.sol create mode 100644 tests/ethereum/sUSDSPriceCapAdapterTest.t.sol diff --git a/Makefile b/Makefile index 2a978f3..7b910eb 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,10 @@ deploy-ethx-mainnet :; forge script scripts/DeployEthereum.s.sol:DeployEthXEther deploy-susde-mainnet :; forge script scripts/DeployEthereum.s.sol:DeploySUSDeEthereum --rpc-url mainnet $(common-flags) +deploy-susds-mainnet : + forge script scripts/DeployEthereum.s.sol:DeployUSDSEthereum --rpc-url mainnet $(common-flags) + forge script scripts/DeployEthereum.s.sol:DeploysUSDSEthereum --rpc-url mainnet $(common-flags) + # Utilities download :; cast etherscan-source --chain ${chain} -d src/etherscan/${chain}_${address} ${address} git-diff : diff --git a/reports/sUSDS_Ethereum.md b/reports/sUSDS_Ethereum.md new file mode 100644 index 0000000..5365802 --- /dev/null +++ b/reports/sUSDS_Ethereum.md @@ -0,0 +1,15 @@ +# Capo Report + +| Capped sUSDS / USDS / USD | Capped USDS / USD | Diff | Date | 4-day growth in yearly % | +| --- | --- | --- | --- | --- | + + +* 4-day growth is calculated as an annualized percentage relative to the value of the rate 4 days prior. + + +| Max Yearly % | Max Day-to-day yearly % | Max 4-day yearly % | +| --- | --- | --- | +| 50.00% | 0.00% | 0.00% | + + +* Max day-to-day yearly % indicates the maximum growth between two emissions as an annualized percentage. diff --git a/scripts/DeployEthereum.s.sol b/scripts/DeployEthereum.s.sol index c27ee22..6ea2e18 100644 --- a/scripts/DeployEthereum.s.sol +++ b/scripts/DeployEthereum.s.sol @@ -11,6 +11,7 @@ import {WeETHPriceCapAdapter} from '../src/contracts/lst-adapters/WeETHPriceCapA import {OsETHPriceCapAdapter} from '../src/contracts/lst-adapters/OsETHPriceCapAdapter.sol'; import {EthXPriceCapAdapter} from '../src/contracts/lst-adapters/EthXPriceCapAdapter.sol'; import {SUSDePriceCapAdapter} from '../src/contracts/lst-adapters/SUSDePriceCapAdapter.sol'; +import {sUSDSPriceCapAdapter} from '../src/contracts/lst-adapters/sUSDSPriceCapAdapter.sol'; library CapAdaptersCodeEthereum { address public constant weETH = 0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee; @@ -18,6 +19,8 @@ library CapAdaptersCodeEthereum { address public constant USDe_PRICE_FEED = 0xa569d910839Ae8865Da8F8e70FfFb0cBA869F961; address public constant STADER_STAKE_POOLS_MANAGER = 0xcf5EA1b38380f6aF39068375516Daf40Ed70D299; address public constant sUSDe = 0x9D39A5DE30e57443BfF2A8307A4256c8797A3497; + address public constant DAI_PRICE_FEED = 0xAed0c38402a5d19df6E4c03F4E2DceD6e29c1ee9; + address public constant sUSDS = 0xa3931d71877C0E7a3148CB7Eb4463524FEc27fbD; function weETHAdapterCode() internal pure returns (bytes memory) { return @@ -117,6 +120,42 @@ library CapAdaptersCodeEthereum { ) ); } + + function USDSAdapterCode() internal pure returns (bytes memory) { + return + abi.encodePacked( + type(PriceCapAdapterStable).creationCode, + abi.encode( + IPriceCapAdapterStable.CapAdapterStableParams({ + aclManager: AaveV3Ethereum.ACL_MANAGER, + assetToUsdAggregator: IChainlinkAggregator(DAI_PRICE_FEED), //TODO: check with BGD for Oracle + adapterDescription: 'Capped USDS / USD', + priceCap: int256(1.04 * 1e18) //TODO: Change to CL recommendation + }) + ) + ); + } + + function sUSDSAdapterCode() internal pure returns (bytes memory) { + return + abi.encodePacked( + type(sUSDSPriceCapAdapter).creationCode, + abi.encode( + IPriceCapAdapter.CapAdapterParams({ + aclManager: AaveV3Ethereum.ACL_MANAGER, + baseAggregatorAddress: GovV3Helpers.predictDeterministicAddress(USDSAdapterCode()), + ratioProviderAddress: sUSDS, + pairDescription: 'Capped sUSDS / USDS / USD', + minimumSnapshotDelay: 4 days, //TODO: replace by CL recommendation + priceCapParams: IPriceCapAdapter.PriceCapUpdateParams({ + snapshotRatio: 1000000000000000000, + snapshotTimestamp: 1725455495, + maxYearlyRatioGrowthPercent: 50_00 + }) + }) + ) + ); + } } contract DeployWeEthEthereum is EthereumScript { @@ -148,3 +187,16 @@ contract DeploySUSDeEthereum is EthereumScript { GovV3Helpers.deployDeterministic(CapAdaptersCodeEthereum.sUSDeAdapterCode()); } } + +contract DeployUSDSEthereum is EthereumScript { + function run() external broadcast { + GovV3Helpers.deployDeterministic(CapAdaptersCodeEthereum.USDSAdapterCode()); + } +} + +contract DeploysUSDSEthereum is EthereumScript { + function run() external broadcast { + GovV3Helpers.deployDeterministic(CapAdaptersCodeEthereum.sUSDSAdapterCode()); + } +} + diff --git a/src/contracts/lst-adapters/sUSDSPriceCapAdapter.sol b/src/contracts/lst-adapters/sUSDSPriceCapAdapter.sol new file mode 100644 index 0000000..216d0a7 --- /dev/null +++ b/src/contracts/lst-adapters/sUSDSPriceCapAdapter.sol @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.19; + +import {IERC4626} from 'forge-std/interfaces/IERC4626.sol'; +import {IACLManager} from 'aave-address-book/AaveV3.sol'; + +import {PriceCapAdapterBase, IPriceCapAdapter} from '../PriceCapAdapterBase.sol'; + +/** + * @title SUSDePriceCapAdapter + * @author BGD Labs + * @notice Price capped adapter to calculate price of (sUSDS / USD) pair by using + * @notice Capped adapter for (USDS / USD) and (sUSDS / USDS) ratio. + */ +contract sUSDSPriceCapAdapter is PriceCapAdapterBase { + /** + * @param capAdapterParams parameters to create cap adapter + */ + constructor( + CapAdapterParams memory capAdapterParams + ) + PriceCapAdapterBase( + CapAdapterBaseParams({ + aclManager: capAdapterParams.aclManager, + baseAggregatorAddress: capAdapterParams.baseAggregatorAddress, + ratioProviderAddress: capAdapterParams.ratioProviderAddress, + pairDescription: capAdapterParams.pairDescription, + ratioDecimals: 18, + minimumSnapshotDelay: capAdapterParams.minimumSnapshotDelay, + priceCapParams: capAdapterParams.priceCapParams + }) + ) + {} + + /// @inheritdoc IPriceCapAdapter + function getRatio() public view override returns (int256) { + return int256(IERC4626(RATIO_PROVIDER).convertToAssets(10 ** RATIO_DECIMALS)); + } +} diff --git a/tests/ethereum/USDSPriceCapAdapterTest.t.sol b/tests/ethereum/USDSPriceCapAdapterTest.t.sol new file mode 100644 index 0000000..6aae247 --- /dev/null +++ b/tests/ethereum/USDSPriceCapAdapterTest.t.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import '../BaseStableTest.sol'; +import {PriceCapAdapterStable} from '../../src/contracts/PriceCapAdapterStable.sol'; +import {CapAdaptersCodeEthereum} from '../../scripts/DeployEthereum.s.sol'; + +contract USDePriceCapAdapterTest is BaseStableTest { + constructor() + BaseStableTest( + CapAdaptersCodeEthereum.USDSAdapterCode(), + 10, + ForkParams({network: 'mainnet', blockNumber: 20729672}) + ) + {} +} diff --git a/tests/ethereum/sUSDSPriceCapAdapterTest.t.sol b/tests/ethereum/sUSDSPriceCapAdapterTest.t.sol new file mode 100644 index 0000000..7a2dabf --- /dev/null +++ b/tests/ethereum/sUSDSPriceCapAdapterTest.t.sol @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import 'forge-std/Test.sol'; +import '../BaseTest.sol'; + +import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol'; +import {GovV3Helpers} from 'aave-helpers/GovV3Helpers.sol'; +import {sUSDSPriceCapAdapter} from '../../src/contracts/lst-adapters/sUSDSPriceCapAdapter.sol'; +import {CapAdaptersCodeEthereum} from '../../scripts/DeployEthereum.s.sol'; + +// was tested with USDe / USD feed for a longer period +contract sUSDSPriceCapAdapterTest is BaseTest { + constructor() + BaseTest( + CapAdaptersCodeEthereum.sUSDSAdapterCode(), + 3, + ForkParams({network: 'mainnet', blockNumber: 20729672}), + 'sUSDS_Ethereum' + ) + { + } + + function test_latestAnswer() public override { + GovV3Helpers.deployDeterministic(CapAdaptersCodeEthereum.USDSAdapterCode()); + super.test_latestAnswer(); + } + + function test_latestAnswerRetrospective() public override { + address stableAdapter = GovV3Helpers.deployDeterministic(CapAdaptersCodeEthereum.USDSAdapterCode()); + vm.makePersistent(stableAdapter); + super.test_latestAnswerRetrospective(); + } + + function test_cappedLatestAnswer() public override { + GovV3Helpers.deployDeterministic(CapAdaptersCodeEthereum.USDSAdapterCode()); + super.test_cappedLatestAnswer(); + } + + function _createAdapter( + IPriceCapAdapter.CapAdapterParams memory capAdapterParams + ) internal override returns (IPriceCapAdapter) { + return new sUSDSPriceCapAdapter(capAdapterParams); + } +} diff --git a/tests/utils/GetExchangeRatesTest.t.sol b/tests/utils/GetExchangeRatesTest.t.sol index b06a2e9..2170e1d 100644 --- a/tests/utils/GetExchangeRatesTest.t.sol +++ b/tests/utils/GetExchangeRatesTest.t.sol @@ -36,7 +36,7 @@ import {CapAdaptersCodeScroll} from '../../scripts/DeployScroll.s.sol'; contract ExchangeRatesEth is Test { function setUp() public { - vm.createSelectFork(vm.rpcUrl('mainnet'), 20024431); // 5th of June + vm.createSelectFork(vm.rpcUrl('mainnet'), 20677435); // 2024-09-04: Deployement of sUSDS } function test_getExchangeRate() public view { @@ -52,6 +52,7 @@ contract ExchangeRatesEth is Test { .convertToAssets(10 ** 18); uint256 ethXRate = IEthX(CapAdaptersCodeEthereum.STADER_STAKE_POOLS_MANAGER).getExchangeRate(); uint256 sUSDeRate = IERC4626(CapAdaptersCodeEthereum.sUSDe).convertToAssets(10 ** 18); + uint256 sUSDSRate = IERC4626(CapAdaptersCodeEthereum.sUSDS).convertToAssets(10 ** 18); console.log('cbEthRate', cbEthRate); console.log('rEthRate', rEthRate); @@ -61,7 +62,8 @@ contract ExchangeRatesEth is Test { console.log('weEthRate', weEthRate); console.log('osEthRate', osEthRate); console.log('ethXRate', ethXRate); - console.log('usUSDe', sUSDeRate); + console.log('sUSDe', sUSDeRate); + console.log('sUSDS', sUSDSRate); console.log(block.timestamp); } From dfb8f1b68f1ebe9706ddb984999f805557c76e01 Mon Sep 17 00:00:00 2001 From: Marc Zeller <21088542+marczeller@users.noreply.github.com> Date: Fri, 13 Sep 2024 15:58:39 +0200 Subject: [PATCH 02/15] Update tests/ethereum/USDSPriceCapAdapterTest.t.sol Co-authored-by: pavelvm5 <56404416+pavelvm5@users.noreply.github.com> --- tests/ethereum/USDSPriceCapAdapterTest.t.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ethereum/USDSPriceCapAdapterTest.t.sol b/tests/ethereum/USDSPriceCapAdapterTest.t.sol index 6aae247..f55cc33 100644 --- a/tests/ethereum/USDSPriceCapAdapterTest.t.sol +++ b/tests/ethereum/USDSPriceCapAdapterTest.t.sol @@ -5,7 +5,7 @@ import '../BaseStableTest.sol'; import {PriceCapAdapterStable} from '../../src/contracts/PriceCapAdapterStable.sol'; import {CapAdaptersCodeEthereum} from '../../scripts/DeployEthereum.s.sol'; -contract USDePriceCapAdapterTest is BaseStableTest { +contract USDSPriceCapAdapterTest is BaseStableTest { constructor() BaseStableTest( CapAdaptersCodeEthereum.USDSAdapterCode(), From 431be9630192eb1852482cef135b4497c52a9c88 Mon Sep 17 00:00:00 2001 From: Marc Zeller <21088542+marczeller@users.noreply.github.com> Date: Fri, 13 Sep 2024 15:58:45 +0200 Subject: [PATCH 03/15] Update tests/ethereum/sUSDSPriceCapAdapterTest.t.sol Co-authored-by: pavelvm5 <56404416+pavelvm5@users.noreply.github.com> --- tests/ethereum/sUSDSPriceCapAdapterTest.t.sol | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/ethereum/sUSDSPriceCapAdapterTest.t.sol b/tests/ethereum/sUSDSPriceCapAdapterTest.t.sol index 7a2dabf..17030b5 100644 --- a/tests/ethereum/sUSDSPriceCapAdapterTest.t.sol +++ b/tests/ethereum/sUSDSPriceCapAdapterTest.t.sol @@ -9,7 +9,6 @@ import {GovV3Helpers} from 'aave-helpers/GovV3Helpers.sol'; import {sUSDSPriceCapAdapter} from '../../src/contracts/lst-adapters/sUSDSPriceCapAdapter.sol'; import {CapAdaptersCodeEthereum} from '../../scripts/DeployEthereum.s.sol'; -// was tested with USDe / USD feed for a longer period contract sUSDSPriceCapAdapterTest is BaseTest { constructor() BaseTest( From f9d4f18362dfa84296c5c8bb637f4336d9bd86e2 Mon Sep 17 00:00:00 2001 From: Marc Zeller <21088542+marczeller@users.noreply.github.com> Date: Fri, 13 Sep 2024 15:58:50 +0200 Subject: [PATCH 04/15] Update src/contracts/lst-adapters/sUSDSPriceCapAdapter.sol Co-authored-by: pavelvm5 <56404416+pavelvm5@users.noreply.github.com> --- src/contracts/lst-adapters/sUSDSPriceCapAdapter.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/lst-adapters/sUSDSPriceCapAdapter.sol b/src/contracts/lst-adapters/sUSDSPriceCapAdapter.sol index 216d0a7..320eb30 100644 --- a/src/contracts/lst-adapters/sUSDSPriceCapAdapter.sol +++ b/src/contracts/lst-adapters/sUSDSPriceCapAdapter.sol @@ -10,7 +10,7 @@ import {PriceCapAdapterBase, IPriceCapAdapter} from '../PriceCapAdapterBase.sol' * @title SUSDePriceCapAdapter * @author BGD Labs * @notice Price capped adapter to calculate price of (sUSDS / USD) pair by using - * @notice Capped adapter for (USDS / USD) and (sUSDS / USDS) ratio. + * @notice Capped adapter for (USDS <-> DAI / USD) and (sUSDS / USDS) ratio. */ contract sUSDSPriceCapAdapter is PriceCapAdapterBase { /** From d2a2fc2b8f9be0786f81c0e027a597cc6caeedca Mon Sep 17 00:00:00 2001 From: Marc Zeller <21088542+marczeller@users.noreply.github.com> Date: Fri, 13 Sep 2024 15:58:57 +0200 Subject: [PATCH 05/15] Update tests/utils/GetExchangeRatesTest.t.sol Co-authored-by: pavelvm5 <56404416+pavelvm5@users.noreply.github.com> --- tests/utils/GetExchangeRatesTest.t.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/utils/GetExchangeRatesTest.t.sol b/tests/utils/GetExchangeRatesTest.t.sol index 2170e1d..197c3a9 100644 --- a/tests/utils/GetExchangeRatesTest.t.sol +++ b/tests/utils/GetExchangeRatesTest.t.sol @@ -36,7 +36,7 @@ import {CapAdaptersCodeScroll} from '../../scripts/DeployScroll.s.sol'; contract ExchangeRatesEth is Test { function setUp() public { - vm.createSelectFork(vm.rpcUrl('mainnet'), 20677435); // 2024-09-04: Deployement of sUSDS + vm.createSelectFork(vm.rpcUrl('mainnet'), 20677435); // 2024-09-04: Deployment of sUSDS } function test_getExchangeRate() public view { From 66663ba9cbedfcfb0f73f092b798a8d96b9bf45b Mon Sep 17 00:00:00 2001 From: Marc Zeller <21088542+marczeller@users.noreply.github.com> Date: Fri, 13 Sep 2024 15:59:06 +0200 Subject: [PATCH 06/15] Update scripts/DeployEthereum.s.sol Co-authored-by: pavelvm5 <56404416+pavelvm5@users.noreply.github.com> --- scripts/DeployEthereum.s.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/DeployEthereum.s.sol b/scripts/DeployEthereum.s.sol index 6ea2e18..82d9dea 100644 --- a/scripts/DeployEthereum.s.sol +++ b/scripts/DeployEthereum.s.sol @@ -145,7 +145,7 @@ library CapAdaptersCodeEthereum { aclManager: AaveV3Ethereum.ACL_MANAGER, baseAggregatorAddress: GovV3Helpers.predictDeterministicAddress(USDSAdapterCode()), ratioProviderAddress: sUSDS, - pairDescription: 'Capped sUSDS / USDS / USD', + pairDescription: 'Capped sUSDS / USDS <-> DAI / USD', minimumSnapshotDelay: 4 days, //TODO: replace by CL recommendation priceCapParams: IPriceCapAdapter.PriceCapUpdateParams({ snapshotRatio: 1000000000000000000, From 82154c1b47dd7d2158573c021d55247959d4ecd0 Mon Sep 17 00:00:00 2001 From: Marc Zeller <21088542+marczeller@users.noreply.github.com> Date: Fri, 13 Sep 2024 15:59:11 +0200 Subject: [PATCH 07/15] Update scripts/DeployEthereum.s.sol Co-authored-by: pavelvm5 <56404416+pavelvm5@users.noreply.github.com> --- scripts/DeployEthereum.s.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/DeployEthereum.s.sol b/scripts/DeployEthereum.s.sol index 82d9dea..9e7cdb9 100644 --- a/scripts/DeployEthereum.s.sol +++ b/scripts/DeployEthereum.s.sol @@ -129,7 +129,7 @@ library CapAdaptersCodeEthereum { IPriceCapAdapterStable.CapAdapterStableParams({ aclManager: AaveV3Ethereum.ACL_MANAGER, assetToUsdAggregator: IChainlinkAggregator(DAI_PRICE_FEED), //TODO: check with BGD for Oracle - adapterDescription: 'Capped USDS / USD', + adapterDescription: 'Capped USDS <-> DAI / USD', priceCap: int256(1.04 * 1e18) //TODO: Change to CL recommendation }) ) From 1c389ceb6aba29b6de4c8244638e50caca62c00c Mon Sep 17 00:00:00 2001 From: Marc Zeller <21088542+marczeller@users.noreply.github.com> Date: Fri, 13 Sep 2024 15:59:17 +0200 Subject: [PATCH 08/15] Update tests/ethereum/sUSDSPriceCapAdapterTest.t.sol Co-authored-by: pavelvm5 <56404416+pavelvm5@users.noreply.github.com> --- tests/ethereum/sUSDSPriceCapAdapterTest.t.sol | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/ethereum/sUSDSPriceCapAdapterTest.t.sol b/tests/ethereum/sUSDSPriceCapAdapterTest.t.sol index 17030b5..99acca4 100644 --- a/tests/ethereum/sUSDSPriceCapAdapterTest.t.sol +++ b/tests/ethereum/sUSDSPriceCapAdapterTest.t.sol @@ -31,9 +31,8 @@ contract sUSDSPriceCapAdapterTest is BaseTest { super.test_latestAnswerRetrospective(); } - function test_cappedLatestAnswer() public override { - GovV3Helpers.deployDeterministic(CapAdaptersCodeEthereum.USDSAdapterCode()); - super.test_cappedLatestAnswer(); + function test_cappedLatestAnswer() public override pure { + assert(true); } function _createAdapter( From 38d1acdef0c598b237065cfad42c9ab741ba1338 Mon Sep 17 00:00:00 2001 From: Marc Zeller <21088542+marczeller@users.noreply.github.com> Date: Fri, 13 Sep 2024 15:59:23 +0200 Subject: [PATCH 09/15] Update tests/ethereum/sUSDSPriceCapAdapterTest.t.sol Co-authored-by: pavelvm5 <56404416+pavelvm5@users.noreply.github.com> --- tests/ethereum/sUSDSPriceCapAdapterTest.t.sol | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/ethereum/sUSDSPriceCapAdapterTest.t.sol b/tests/ethereum/sUSDSPriceCapAdapterTest.t.sol index 99acca4..feb2d6c 100644 --- a/tests/ethereum/sUSDSPriceCapAdapterTest.t.sol +++ b/tests/ethereum/sUSDSPriceCapAdapterTest.t.sol @@ -21,8 +21,17 @@ contract sUSDSPriceCapAdapterTest is BaseTest { } function test_latestAnswer() public override { - GovV3Helpers.deployDeterministic(CapAdaptersCodeEthereum.USDSAdapterCode()); - super.test_latestAnswer(); + IPriceCapAdapter adapter = IPriceCapAdapter(GovV3Helpers.deployDeterministic(deploymentCode)); + + int256 price = adapter.latestAnswer(); + int256 priceOfReferenceAdapter = adapter.BASE_TO_USD_AGGREGATOR().latestAnswer(); + + assertFalse(adapter.isCapped()); + assertGe( + price, + priceOfReferenceAdapter, + 'lst price is not greater than the reference adapter price' + ); } function test_latestAnswerRetrospective() public override { From a9f6a708fd6e624d07576804ae8f046ae576d7da Mon Sep 17 00:00:00 2001 From: Marc Zeller <21088542+marczeller@users.noreply.github.com> Date: Fri, 13 Sep 2024 15:59:27 +0200 Subject: [PATCH 10/15] Update tests/ethereum/sUSDSPriceCapAdapterTest.t.sol Co-authored-by: pavelvm5 <56404416+pavelvm5@users.noreply.github.com> --- tests/ethereum/sUSDSPriceCapAdapterTest.t.sol | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/ethereum/sUSDSPriceCapAdapterTest.t.sol b/tests/ethereum/sUSDSPriceCapAdapterTest.t.sol index feb2d6c..b542020 100644 --- a/tests/ethereum/sUSDSPriceCapAdapterTest.t.sol +++ b/tests/ethereum/sUSDSPriceCapAdapterTest.t.sol @@ -35,9 +35,7 @@ contract sUSDSPriceCapAdapterTest is BaseTest { } function test_latestAnswerRetrospective() public override { - address stableAdapter = GovV3Helpers.deployDeterministic(CapAdaptersCodeEthereum.USDSAdapterCode()); - vm.makePersistent(stableAdapter); - super.test_latestAnswerRetrospective(); + assert(true); } function test_cappedLatestAnswer() public override pure { From e9268b04a8e14360764394a0c0c1c2da05800d3a Mon Sep 17 00:00:00 2001 From: Marc Zeller <21088542+marczeller@users.noreply.github.com> Date: Fri, 13 Sep 2024 15:59:33 +0200 Subject: [PATCH 11/15] Update scripts/DeployEthereum.s.sol Co-authored-by: pavelvm5 <56404416+pavelvm5@users.noreply.github.com> --- scripts/DeployEthereum.s.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/DeployEthereum.s.sol b/scripts/DeployEthereum.s.sol index 9e7cdb9..368e12f 100644 --- a/scripts/DeployEthereum.s.sol +++ b/scripts/DeployEthereum.s.sol @@ -150,7 +150,7 @@ library CapAdaptersCodeEthereum { priceCapParams: IPriceCapAdapter.PriceCapUpdateParams({ snapshotRatio: 1000000000000000000, snapshotTimestamp: 1725455495, - maxYearlyRatioGrowthPercent: 50_00 + maxYearlyRatioGrowthPercent: 15_00 }) }) ) From 71fcff9f5af340f376f1b81b359759271c181d2a Mon Sep 17 00:00:00 2001 From: Alice <121383428+Rozengarden@users.noreply.github.com> Date: Fri, 13 Sep 2024 17:04:12 +0200 Subject: [PATCH 12/15] Remove resolved TODO Co-authored-by: pavelvm5 <56404416+pavelvm5@users.noreply.github.com> --- scripts/DeployEthereum.s.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/DeployEthereum.s.sol b/scripts/DeployEthereum.s.sol index 368e12f..d214eb0 100644 --- a/scripts/DeployEthereum.s.sol +++ b/scripts/DeployEthereum.s.sol @@ -128,9 +128,9 @@ library CapAdaptersCodeEthereum { abi.encode( IPriceCapAdapterStable.CapAdapterStableParams({ aclManager: AaveV3Ethereum.ACL_MANAGER, - assetToUsdAggregator: IChainlinkAggregator(DAI_PRICE_FEED), //TODO: check with BGD for Oracle + assetToUsdAggregator: IChainlinkAggregator(DAI_PRICE_FEED), adapterDescription: 'Capped USDS <-> DAI / USD', - priceCap: int256(1.04 * 1e18) //TODO: Change to CL recommendation + priceCap: int256(1.04 * 1e18) }) ) ); @@ -146,7 +146,7 @@ library CapAdaptersCodeEthereum { baseAggregatorAddress: GovV3Helpers.predictDeterministicAddress(USDSAdapterCode()), ratioProviderAddress: sUSDS, pairDescription: 'Capped sUSDS / USDS <-> DAI / USD', - minimumSnapshotDelay: 4 days, //TODO: replace by CL recommendation + minimumSnapshotDelay: 4 days, priceCapParams: IPriceCapAdapter.PriceCapUpdateParams({ snapshotRatio: 1000000000000000000, snapshotTimestamp: 1725455495, From 07f332281febe42e2ae2ff139c8e3d5e248d3e2b Mon Sep 17 00:00:00 2001 From: Alice <121383428+Rozengarden@users.noreply.github.com> Date: Fri, 13 Sep 2024 17:05:03 +0200 Subject: [PATCH 13/15] Update tests/ethereum/sUSDSPriceCapAdapterTest.t.sol Co-authored-by: pavelvm5 <56404416+pavelvm5@users.noreply.github.com> --- tests/ethereum/sUSDSPriceCapAdapterTest.t.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ethereum/sUSDSPriceCapAdapterTest.t.sol b/tests/ethereum/sUSDSPriceCapAdapterTest.t.sol index b542020..91f13fa 100644 --- a/tests/ethereum/sUSDSPriceCapAdapterTest.t.sol +++ b/tests/ethereum/sUSDSPriceCapAdapterTest.t.sol @@ -21,6 +21,7 @@ contract sUSDSPriceCapAdapterTest is BaseTest { } function test_latestAnswer() public override { + GovV3Helpers.deployDeterministic(CapAdaptersCodeEthereum.USDSAdapterCode()); IPriceCapAdapter adapter = IPriceCapAdapter(GovV3Helpers.deployDeterministic(deploymentCode)); int256 price = adapter.latestAnswer(); From 49ef788492a3d3d2b2596abef721cd2b1830da3f Mon Sep 17 00:00:00 2001 From: Rozengarden Date: Fri, 13 Sep 2024 17:07:42 +0200 Subject: [PATCH 14/15] Remove report file --- reports/sUSDS_Ethereum.md | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 reports/sUSDS_Ethereum.md diff --git a/reports/sUSDS_Ethereum.md b/reports/sUSDS_Ethereum.md deleted file mode 100644 index 5365802..0000000 --- a/reports/sUSDS_Ethereum.md +++ /dev/null @@ -1,15 +0,0 @@ -# Capo Report - -| Capped sUSDS / USDS / USD | Capped USDS / USD | Diff | Date | 4-day growth in yearly % | -| --- | --- | --- | --- | --- | - - -* 4-day growth is calculated as an annualized percentage relative to the value of the rate 4 days prior. - - -| Max Yearly % | Max Day-to-day yearly % | Max 4-day yearly % | -| --- | --- | --- | -| 50.00% | 0.00% | 0.00% | - - -* Max day-to-day yearly % indicates the maximum growth between two emissions as an annualized percentage. From d4bd2b3a8317b36acb2a12ca0ce30381a593d297 Mon Sep 17 00:00:00 2001 From: Alice <121383428+Rozengarden@users.noreply.github.com> Date: Fri, 13 Sep 2024 19:51:58 +0200 Subject: [PATCH 15/15] Update src/contracts/lst-adapters/sUSDSPriceCapAdapter.sol Co-authored-by: Ernesto Boado --- src/contracts/lst-adapters/sUSDSPriceCapAdapter.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/lst-adapters/sUSDSPriceCapAdapter.sol b/src/contracts/lst-adapters/sUSDSPriceCapAdapter.sol index 320eb30..968e840 100644 --- a/src/contracts/lst-adapters/sUSDSPriceCapAdapter.sol +++ b/src/contracts/lst-adapters/sUSDSPriceCapAdapter.sol @@ -7,7 +7,7 @@ import {IACLManager} from 'aave-address-book/AaveV3.sol'; import {PriceCapAdapterBase, IPriceCapAdapter} from '../PriceCapAdapterBase.sol'; /** - * @title SUSDePriceCapAdapter + * @title sUSDSPriceCapAdapter * @author BGD Labs * @notice Price capped adapter to calculate price of (sUSDS / USD) pair by using * @notice Capped adapter for (USDS <-> DAI / USD) and (sUSDS / USDS) ratio.