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.
feat: add capo adapters for linea (#56)
* feat: add capo adapters for linea * fix: symbol * fix: symbol * chore: update address book * feat: add wstETH linea
- Loading branch information
1 parent
4f453e3
commit 9a01d9c
Showing
16 changed files
with
362 additions
and
8 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
Submodule aave-address-book
updated
262 files
Submodule aave-helpers
updated
81 files
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,32 @@ | ||
# Capo Report | ||
|
||
| Capped ezETH / ETH / USD | ETH / USD | Diff | Date | 14-day growth in yearly % | | ||
| --- | --- | --- | --- | --- | | ||
| 3770.00194197 | 3665.15 | 2.82% | 30 Nov 2024 | 3.84% | | ||
| 3830.48882182 | 3723.96 | 2.82% | 01 Dec 2024 | 3.78% | | ||
| 3691.41415862 | 3586.89 | 2.87% | 02 Dec 2024 | 4.64% | | ||
| 3675.49770077 | 3570.45 | 2.90% | 03 Dec 2024 | 5.20% | | ||
| 3995.78720977 | 3880.863962 | 2.92% | 04 Dec 2024 | 5.28% | | ||
| 3915.10724598 | 3802.457848 | 2.92% | 05 Dec 2024 | 4.93% | | ||
| 4134.6643822 | 4015.57 | 2.92% | 07 Dec 2024 | 4.98% | | ||
| 4114.15503156 | 3995.1925 | 2.93% | 08 Dec 2024 | 4.81% | | ||
| 4039.40938764 | 3923.11 | 2.92% | 09 Dec 2024 | 4.37% | | ||
| 3814.86076741 | 3704.76 | 2.93% | 10 Dec 2024 | 4.29% | | ||
| 3767.95106589 | 3661.364462 | 2.87% | 11 Dec 2024 | 2.63% | | ||
| 4042.97361668 | 3925.7999 | 2.94% | 12 Dec 2024 | 3.91% | | ||
| 4005.24119365 | 3889.3902 | 2.93% | 13 Dec 2024 | 3.09% | | ||
| 4039.57381507 | 3922.39255063 | 2.94% | 14 Dec 2024 | 3.16% | | ||
| 3971.70756371 | 3855.595517 | 2.97% | 15 Dec 2024 | 3.63% | | ||
| 4063.83857341 | 3944.28190958 | 2.99% | 16 Dec 2024 | 4.11% | | ||
| 4145.21152209 | 4023.19 | 2.99% | 17 Dec 2024 | 2.87% | | ||
|
||
|
||
* 14-day growth is calculated as an annualized percentage relative to the value of the rate 14 days prior. | ||
|
||
|
||
| Max Yearly % | Max Day-to-day yearly % | Max 14-day yearly % | | ||
| --- | --- | --- | | ||
| 10.89% | 25.28% | 5.28% | | ||
|
||
|
||
* 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 @@ | ||
# Capo Report | ||
|
||
| Capped weETH / ETH / USD | ETH / USD | Diff | Date | 7-day growth in yearly % | | ||
| --- | --- | --- | --- | --- | | ||
| 3542.34792694 | 3362.53 | 5.21% | 23 Nov 2024 | 3.00% | | ||
| 3557.09776461 | 3376.23 | 5.22% | 24 Nov 2024 | 3.04% | | ||
| 3689.00188804 | 3501.18 | 5.22% | 25 Nov 2024 | 3.11% | | ||
| 3490.27678812 | 3312.314206 | 5.23% | 26 Nov 2024 | 2.85% | | ||
| 3681.32213097 | 3493.3843 | 5.24% | 27 Nov 2024 | 2.73% | | ||
| 3785.35901733 | 3591.88 | 5.25% | 28 Nov 2024 | 2.79% | | ||
| 3806.40678324 | 3611.63 | 5.25% | 29 Nov 2024 | 2.66% | | ||
| 3863.16783347 | 3665.15 | 5.26% | 30 Nov 2024 | 2.63% | | ||
| 3925.42373546 | 3723.96 | 5.27% | 01 Dec 2024 | 2.51% | | ||
| 3781.19041512 | 3586.89 | 5.27% | 02 Dec 2024 | 2.49% | | ||
| 3764.15002086 | 3570.45 | 5.28% | 03 Dec 2024 | 2.49% | | ||
| 4092.06323209 | 3880.863962 | 5.30% | 04 Dec 2024 | 2.95% | | ||
| 4009.69891287 | 3802.457848 | 5.31% | 05 Dec 2024 | 2.99% | | ||
| 4234.64152435 | 4015.57 | 5.31% | 07 Dec 2024 | 2.93% | | ||
| 4213.57352699 | 3995.1925 | 5.32% | 08 Dec 2024 | 2.96% | | ||
| 4137.86255022 | 3923.11 | 5.33% | 09 Dec 2024 | 2.98% | | ||
| 3907.88047386 | 3704.76 | 5.34% | 10 Dec 2024 | 3.05% | | ||
| 3862.43345114 | 3661.364462 | 5.34% | 11 Dec 2024 | 3.10% | | ||
| 4141.70158988 | 3925.7999 | 5.35% | 12 Dec 2024 | 2.69% | | ||
| 4103.6040573 | 3889.3902 | 5.36% | 13 Dec 2024 | 2.70% | | ||
| 4138.73258428 | 3922.39255063 | 5.37% | 14 Dec 2024 | 2.83% | | ||
| 4068.53623873 | 3855.595517 | 5.37% | 15 Dec 2024 | 2.69% | | ||
| 4162.45361466 | 3944.28190958 | 5.38% | 16 Dec 2024 | 2.73% | | ||
| 4246.04269628 | 4023.19 | 5.39% | 17 Dec 2024 | 2.69% | | ||
|
||
|
||
* 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 % | | ||
| --- | --- | --- | | ||
| 8.75% | 5.53% | 3.11% | | ||
|
||
|
||
* 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,15 @@ | ||
# Capo Report | ||
|
||
| Capped wstETH / stETH(ETH) / USD | ETH / USD | Diff | Date | 7-day growth in yearly % | | ||
| --- | --- | --- | --- | --- | | ||
|
||
|
||
* 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% | 3.04% | 0.00% | | ||
|
||
|
||
* 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,141 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity ^0.8.0; | ||
|
||
import {GovV3Helpers} from 'aave-helpers/GovV3Helpers.sol'; | ||
import {LineaScript} from 'solidity-utils/contracts/utils/ScriptUtils.sol'; | ||
import {AaveV3Linea} from 'aave-address-book/AaveV3Linea.sol'; | ||
import {CLRatePriceCapAdapter} from '../src/contracts/CLRatePriceCapAdapter.sol'; | ||
import {PriceCapAdapterStable, IPriceCapAdapterStable} from '../src/contracts/PriceCapAdapterStable.sol'; | ||
import {IPriceCapAdapter, IChainlinkAggregator} from '../src/interfaces/IPriceCapAdapter.sol'; | ||
|
||
library CapAdaptersCodeLinea { | ||
address public constant ezETH_ETH_AGGREGATOR = 0xb71F79770BA599940F454c70e63d4DE0E8606731; | ||
address public constant weETH_eETH_AGGREGATOR = 0x1FBc7d24654b10c71fd74d3730d9Df17836181EF; | ||
address public constant wstETH_stETH_AGGREGATOR = 0x3C8A95F2264bB3b52156c766b738357008d87cB7; | ||
address public constant WETH_PRICE_FEED = 0x3c6Cd9Cc7c7a4c2Cf5a82734CD249D7D593354dA; | ||
address public constant USDC_PRICE_FEED = 0xAADAa473C1bDF7317ec07c915680Af29DeBfdCb5; | ||
address public constant USDT_PRICE_FEED = 0xefCA2bbe0EdD0E22b2e0d2F8248E99F4bEf4A7dB; | ||
|
||
function weETHAdapterCode() internal pure returns (bytes memory) { | ||
return | ||
abi.encodePacked( | ||
type(CLRatePriceCapAdapter).creationCode, | ||
abi.encode( | ||
IPriceCapAdapter.CapAdapterParams({ | ||
aclManager: AaveV3Linea.ACL_MANAGER, | ||
baseAggregatorAddress: WETH_PRICE_FEED, | ||
ratioProviderAddress: weETH_eETH_AGGREGATOR, | ||
pairDescription: 'Capped weETH / eETH(ETH) / USD', | ||
minimumSnapshotDelay: 7 days, | ||
priceCapParams: IPriceCapAdapter.PriceCapUpdateParams({ | ||
snapshotRatio: 1054169605180649721, | ||
snapshotTimestamp: 1733109809, | ||
maxYearlyRatioGrowthPercent: 8_75 | ||
}) | ||
}) | ||
) | ||
); | ||
} | ||
|
||
function ezETHAdapterCode() internal pure returns (bytes memory) { | ||
return | ||
abi.encodePacked( | ||
type(CLRatePriceCapAdapter).creationCode, | ||
abi.encode( | ||
IPriceCapAdapter.CapAdapterParams({ | ||
aclManager: AaveV3Linea.ACL_MANAGER, | ||
baseAggregatorAddress: WETH_PRICE_FEED, | ||
ratioProviderAddress: ezETH_ETH_AGGREGATOR, | ||
pairDescription: 'Capped ezETH / ETH / USD', | ||
minimumSnapshotDelay: 14 days, | ||
priceCapParams: IPriceCapAdapter.PriceCapUpdateParams({ | ||
snapshotRatio: 1029140608890425422, | ||
snapshotTimestamp: 1733109809, | ||
maxYearlyRatioGrowthPercent: 10_89 | ||
}) | ||
}) | ||
) | ||
); | ||
} | ||
|
||
function wstETHAdapterCode() internal pure returns (bytes memory) { | ||
return | ||
abi.encodePacked( | ||
type(CLRatePriceCapAdapter).creationCode, | ||
abi.encode( | ||
IPriceCapAdapter.CapAdapterParams({ | ||
aclManager: AaveV3Linea.ACL_MANAGER, | ||
baseAggregatorAddress: WETH_PRICE_FEED, | ||
ratioProviderAddress: wstETH_stETH_AGGREGATOR, | ||
pairDescription: 'Capped wstETH / stETH(ETH) / USD', | ||
minimumSnapshotDelay: 7 days, | ||
priceCapParams: IPriceCapAdapter.PriceCapUpdateParams({ | ||
snapshotRatio: 1190272828525538502, | ||
snapshotTimestamp: 1736592058, // Jan-11-2025 | ||
maxYearlyRatioGrowthPercent: 9_68 | ||
}) | ||
}) | ||
) | ||
); | ||
} | ||
|
||
function USDCAdapterCode() internal pure returns (bytes memory) { | ||
return | ||
abi.encodePacked( | ||
type(PriceCapAdapterStable).creationCode, | ||
abi.encode( | ||
IPriceCapAdapterStable.CapAdapterStableParams({ | ||
aclManager: AaveV3Linea.ACL_MANAGER, | ||
assetToUsdAggregator: IChainlinkAggregator(USDC_PRICE_FEED), | ||
adapterDescription: 'Capped USDC/USD', | ||
priceCap: int256(1.04 * 1e8) | ||
}) | ||
) | ||
); | ||
} | ||
|
||
function USDTAdapterCode() internal pure returns (bytes memory) { | ||
return | ||
abi.encodePacked( | ||
type(PriceCapAdapterStable).creationCode, | ||
abi.encode( | ||
IPriceCapAdapterStable.CapAdapterStableParams({ | ||
aclManager: AaveV3Linea.ACL_MANAGER, | ||
assetToUsdAggregator: IChainlinkAggregator(USDT_PRICE_FEED), | ||
adapterDescription: 'Capped USDT/USD', | ||
priceCap: int256(1.04 * 1e8) | ||
}) | ||
) | ||
); | ||
} | ||
} | ||
|
||
contract DeployWeEthLinea is LineaScript { | ||
function run() external broadcast { | ||
GovV3Helpers.deployDeterministic(CapAdaptersCodeLinea.weETHAdapterCode()); | ||
} | ||
} | ||
|
||
contract DeployEzEthLinea is LineaScript { | ||
function run() external broadcast { | ||
GovV3Helpers.deployDeterministic(CapAdaptersCodeLinea.ezETHAdapterCode()); | ||
} | ||
} | ||
|
||
contract DeployUSDCLinea is LineaScript { | ||
function run() external broadcast { | ||
GovV3Helpers.deployDeterministic(CapAdaptersCodeLinea.USDCAdapterCode()); | ||
} | ||
} | ||
|
||
contract DeployUSDTLinea is LineaScript { | ||
function run() external broadcast { | ||
GovV3Helpers.deployDeterministic(CapAdaptersCodeLinea.USDTAdapterCode()); | ||
} | ||
} | ||
|
||
contract DeployWstETHLinea is LineaScript { | ||
function run() external broadcast { | ||
GovV3Helpers.deployDeterministic(CapAdaptersCodeLinea.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,15 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity ^0.8.0; | ||
|
||
import '../BaseStableTest.sol'; | ||
import {CapAdaptersCodeLinea} from '../../scripts/DeployLinea.s.sol'; | ||
|
||
contract USDCLineaPriceCapAdapterTest is BaseStableTest { | ||
constructor() | ||
BaseStableTest( | ||
CapAdaptersCodeLinea.USDCAdapterCode(), | ||
10, | ||
ForkParams({network: 'linea', blockNumber: 13432357}) | ||
) | ||
{} | ||
} |
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,15 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity ^0.8.0; | ||
|
||
import '../BaseStableTest.sol'; | ||
import {CapAdaptersCodeLinea} from '../../scripts/DeployLinea.s.sol'; | ||
|
||
contract USDTLineaPriceCapAdapterTest is BaseStableTest { | ||
constructor() | ||
BaseStableTest( | ||
CapAdaptersCodeLinea.USDTAdapterCode(), | ||
10, | ||
ForkParams({network: 'linea', blockNumber: 13432357}) | ||
) | ||
{} | ||
} |
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,16 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity ^0.8.0; | ||
|
||
import {CLAdapterBaseTest} from '../CLAdapterBaseTest.sol'; | ||
import {CapAdaptersCodeLinea} from '../../scripts/DeployLinea.s.sol'; | ||
|
||
contract ezETHLineaPriceCapAdapterTest is CLAdapterBaseTest { | ||
constructor() | ||
CLAdapterBaseTest( | ||
CapAdaptersCodeLinea.ezETHAdapterCode(), | ||
30, | ||
ForkParams({network: 'linea', blockNumber: 13423434}), | ||
'ezETH_Linea' | ||
) | ||
{} | ||
} |
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,16 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity ^0.8.0; | ||
|
||
import {CLAdapterBaseTest} from '../CLAdapterBaseTest.sol'; | ||
import {CapAdaptersCodeLinea} from '../../scripts/DeployLinea.s.sol'; | ||
|
||
contract weETHLineaPriceCapAdapterTest is CLAdapterBaseTest { | ||
constructor() | ||
CLAdapterBaseTest( | ||
CapAdaptersCodeLinea.weETHAdapterCode(), | ||
30, | ||
ForkParams({network: 'linea', blockNumber: 13423434}), | ||
'weETH_Linea' | ||
) | ||
{} | ||
} |
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,23 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity ^0.8.0; | ||
|
||
import '../BaseTest.sol'; | ||
|
||
import {CapAdaptersCodeLinea, CLRatePriceCapAdapter} from '../../scripts/DeployLinea.s.sol'; | ||
|
||
contract wstETHPriceCapAdapterTestL is BaseTest { | ||
constructor() | ||
BaseTest( | ||
CapAdaptersCodeLinea.wstETHAdapterCode(), | ||
1, | ||
ForkParams({network: 'linea', blockNumber: 14810572}), | ||
'wstETH_Linea' | ||
) | ||
{} | ||
|
||
function _createAdapter( | ||
IPriceCapAdapter.CapAdapterParams memory capAdapterParams | ||
) internal override returns (IPriceCapAdapter) { | ||
return new CLRatePriceCapAdapter(capAdapterParams); | ||
} | ||
} |
Oops, something went wrong.