generated from bgd-labs/bgd-forge-template
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from bgd-labs/feat/wstETH-bnb
feat: add capo for wstETH on bnb
- Loading branch information
Showing
5 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
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
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,18 @@ | ||
# Capo Report | ||
|
||
| Capped wstETH / stETH(ETH) / USD | ETH / USD | Diff | Date | 7-day growth in yearly % | | ||
| --- | --- | --- | --- | --- | | ||
| 3133.78741239 | 2655.02535327 | 16.54% | 29 Sept 2024 | 3.41% | | ||
| 3081.12278712 | 2610.195 | 16.55% | 30 Sept 2024 | 3.38% | | ||
| 2965.32175918 | 2511.8853 | 16.56% | 01 Oct 2024 | 3.36% | | ||
|
||
|
||
* 7-day growth is calculated as an annualized percentage relative to the value of the rate 7 days prior. | ||
|
||
|
||
| Max Yearly % | Max Day-to-day yearly % | Max 7-day yearly % | | ||
| --- | --- | --- | | ||
| 9.68% | 5.60% | 3.41% | | ||
|
||
|
||
* Max day-to-day yearly % indicates the maximum growth between two emissions as an annualized percentage. |
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,39 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity ^0.8.0; | ||
|
||
import {GovV3Helpers} from 'aave-helpers/GovV3Helpers.sol'; | ||
import {BNBScript} from 'aave-helpers/ScriptUtils.sol'; | ||
import {AaveV3BNB, AaveV3BNBAssets} from 'aave-address-book/AaveV3BNB.sol'; | ||
|
||
import {CLRatePriceCapAdapter, IPriceCapAdapter, IACLManager} from '../src/contracts/CLRatePriceCapAdapter.sol'; | ||
|
||
library CapAdaptersCodeBNB { | ||
address public constant wstETH_stETH_AGGREGATOR = 0x4c75d01cfa4D998770b399246400a6dc40FB9645; | ||
|
||
function wstETHAdapterCode() internal pure returns (bytes memory) { | ||
return | ||
abi.encodePacked( | ||
type(CLRatePriceCapAdapter).creationCode, | ||
abi.encode( | ||
IPriceCapAdapter.CapAdapterParams({ | ||
aclManager: AaveV3BNB.ACL_MANAGER, | ||
baseAggregatorAddress: AaveV3BNBAssets.ETH_ORACLE, | ||
ratioProviderAddress: wstETH_stETH_AGGREGATOR, | ||
pairDescription: 'Capped wstETH / stETH(ETH) / USD', | ||
minimumSnapshotDelay: 7 days, | ||
priceCapParams: IPriceCapAdapter.PriceCapUpdateParams({ | ||
snapshotRatio: 1179619475032439052, | ||
snapshotTimestamp: 1727049059, // Sep-22-2024 | ||
maxYearlyRatioGrowthPercent: 9_68 | ||
}) | ||
}) | ||
) | ||
); | ||
} | ||
} | ||
|
||
contract DeployWstEthBnb is BNBScript { | ||
function run() external broadcast { | ||
GovV3Helpers.deployDeterministic(CapAdaptersCodeBNB.wstETHAdapterCode()); | ||
} | ||
} |
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,22 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity ^0.8.0; | ||
|
||
import '../BaseTest.sol'; | ||
import {CapAdaptersCodeBNB, CLRatePriceCapAdapter} from '../../scripts/DeployBnb.s.sol'; | ||
|
||
contract wstETHPriceCapAdapterTest is BaseTest { | ||
constructor() | ||
BaseTest( | ||
CapAdaptersCodeBNB.wstETHAdapterCode(), | ||
9, | ||
ForkParams({network: 'bnb', blockNumber: 42738754}), | ||
'wstETH_BNB' | ||
) | ||
{} | ||
|
||
function _createAdapter( | ||
IPriceCapAdapter.CapAdapterParams memory capAdapterParams | ||
) internal override returns (IPriceCapAdapter) { | ||
return new CLRatePriceCapAdapter(capAdapterParams); | ||
} | ||
} |
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