Skip to content

Commit 2c280ef

Browse files
authored
chore: syrupUSDC adapter (#122)
1 parent 542989c commit 2c280ef

File tree

5 files changed

+87
-1
lines changed

5 files changed

+87
-1
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ deploy-usde-mainnet :; forge script scripts/DeployEthereum.s.sol:DeployUSDeEther
2020
deploy-weeth-arbitrum :; forge script scripts/DeployArbitrumWeEth.s.sol:DeployWeEthArbitrum --rpc-url arbitrum $(common-flags)
2121
deploy-weeth-scroll :; forge script scripts/DeployScroll.s.sol:DeployWeEthScroll --rpc-url scroll $(common-flags)
2222
deploy-weeth-base :; forge script scripts/DeployBase.s.sol:DeployWeEthBase --rpc-url base $(deploy-pk)
23+
deploy-syrupusdc-base :; forge script scripts/DeployBase.s.sol:DeploySyrupUSDCBase --rpc-url base $(deploy-pk)
2324

2425
deploy-oseth-mainnet :; forge script scripts/DeployEthereum.s.sol:DeployOsEthEthereum --rpc-url mainnet $(common-flags)
2526

reports/syrupUSDC_CL_Base.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Capo Report
2+
3+
| Capped SyrupUSDC / USDC / USD | Capped USDC/USD | Diff | Date | 7-day growth in yearly % |
4+
| ----------------------------- | --------------- | ------ | ----------- | ------------------------ |
5+
| 1.13814412 | 0.99971613 | 12.95% | 26 Nov 2025 | 5.58% |
6+
| 1.13845266 | 0.99982897 | 12.97% | 27 Nov 2025 | 5.58% |
7+
| 1.13855137 | 0.99975706 | 12.98% | 28 Nov 2025 | 5.60% |
8+
| 1.13876616 | 0.99978669 | 13.00% | 29 Nov 2025 | 5.63% |
9+
| 1.13898191 | 0.99981784 | 13.01% | 30 Nov 2025 | 5.66% |
10+
| 1.1391911 | 0.99984334 | 13.03% | 01 Dec 2025 | 5.67% |
11+
| 1.13939047 | 0.99986 | 13.04% | 02 Dec 2025 | 5.69% |
12+
| 1.13956778 | 0.99986 | 13.06% | 03 Dec 2025 | 5.66% |
13+
| 1.13969557 | 0.99982 | 13.08% | 04 Dec 2025 | 5.63% |
14+
| 1.13974272 | 0.9997105 | 13.09% | 05 Dec 2025 | 5.59% |
15+
| 1.14001033 | 0.99979 | 13.11% | 06 Dec 2025 | 5.57% |
16+
| 1.14028305 | 0.99987591 | 13.12% | 07 Dec 2025 | 5.55% |
17+
| 1.14034027 | 0.99977289 | 13.14% | 08 Dec 2025 | 5.52% |
18+
| 1.14055521 | 0.9998081 | 13.15% | 09 Dec 2025 | 5.49% |
19+
| 1.1407377 | 0.99982 | 13.17% | 10 Dec 2025 | 5.46% |
20+
| 1.1408815 | 0.9998 | 13.18% | 11 Dec 2025 | 5.42% |
21+
| 1.14105463 | 0.99980608 | 13.20% | 12 Dec 2025 | 5.40% |
22+
| 1.14127314 | 0.99985669 | 13.21% | 13 Dec 2025 | 5.32% |
23+
| 1.14145457 | 0.9998704 | 13.22% | 14 Dec 2025 | 5.28% |
24+
| 1.1416336 | 0.99988225 | 13.24% | 15 Dec 2025 | 5.24% |
25+
| 1.14177367 | 0.99986 | 13.25% | 16 Dec 2025 | 5.20% |
26+
| 1.14201986 | 0.99993132 | 13.27% | 17 Dec 2025 | 5.18% |
27+
| 1.14212161 | 0.99988 | 13.28% | 18 Dec 2025 | 5.15% |
28+
| 1.14223673 | 0.99984054 | 13.30% | 19 Dec 2025 | 5.12% |
29+
30+
- 7-day growth is calculated as an annualized percentage relative to the value of the rate 7 days prior.
31+
32+
| Max Yearly % | Max Day-to-day yearly % | Max 7-day yearly % |
33+
| ------------ | ----------------------- | ------------------ |
34+
| 8.04% | 5.74% | 5.69% |
35+
36+
- Max day-to-day yearly % indicates the maximum growth between two emissions as an annualized percentage.

scripts/DeployBase.s.sol

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,27 @@ library CapAdaptersCodeBase {
119119
)
120120
);
121121
}
122+
123+
function syrupUSDCAdapterCode() internal pure returns (bytes memory) {
124+
return
125+
abi.encodePacked(
126+
type(CLRatePriceCapAdapter).creationCode,
127+
abi.encode(
128+
IPriceCapAdapter.CapAdapterParams({
129+
aclManager: AaveV3Base.ACL_MANAGER,
130+
baseAggregatorAddress: AaveV3BaseAssets.USDC_ORACLE,
131+
ratioProviderAddress: ChainlinkBase.syrupUSDC_USDC_Exchange_Rate,
132+
pairDescription: 'Capped SyrupUSDC / USDC / USD',
133+
minimumSnapshotDelay: 7 days,
134+
priceCapParams: IPriceCapAdapter.PriceCapUpdateParams({
135+
snapshotRatio: 1_141275955119667166,
136+
snapshotTimestamp: 1765541747, // Dec-12-2025
137+
maxYearlyRatioGrowthPercent: 8_04
138+
})
139+
})
140+
)
141+
);
142+
}
122143
}
123144

124145
contract DeployLBTCBase is BaseScript {
@@ -150,3 +171,9 @@ contract DeployEURCBase is BaseScript {
150171
GovV3Helpers.deployDeterministic(CapAdaptersCodeBase.EURCAdapterCode());
151172
}
152173
}
174+
175+
contract DeploySyrupUSDCBase is BaseScript {
176+
function run() external broadcast {
177+
GovV3Helpers.deployDeterministic(CapAdaptersCodeBase.syrupUSDCAdapterCode());
178+
}
179+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// SPDX-License-Identifier: BUSL-1.1
2+
pragma solidity ^0.8.0;
3+
4+
import {CLAdapterBaseTest} from '../CLAdapterBaseTest.sol';
5+
import {CapAdaptersCodeBase} from '../../scripts/DeployBase.s.sol';
6+
7+
contract syrupUSDCCLBasePriceCapAdapterTest is CLAdapterBaseTest {
8+
constructor()
9+
CLAdapterBaseTest(
10+
CapAdaptersCodeBase.syrupUSDCAdapterCode(),
11+
30,
12+
ForkParams({network: 'base', blockNumber: 39684200}),
13+
'syrupUSDC_CL_Base'
14+
)
15+
{}
16+
}

tests/utils/GetExchangeRatesTest.t.sol

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {MiscBase} from 'aave-address-book/MiscBase.sol';
1616
import {MiscGnosis} from 'aave-address-book/MiscGnosis.sol';
1717
import {MiscOptimism} from 'aave-address-book/MiscOptimism.sol';
1818
import {MiscPolygon} from 'aave-address-book/MiscPolygon.sol';
19+
import {ChainlinkBase} from 'aave-address-book/ChainlinkBase.sol';
1920

2021
import {ICbEthRateProvider} from 'cl-synchronicity-price-adapter/interfaces/ICbEthRateProvider.sol';
2122
import {IrETH} from 'cl-synchronicity-price-adapter/interfaces/IrETH.sol';
@@ -165,7 +166,7 @@ contract ExchangeRatesAvax is Test {
165166

166167
contract ExchangeRatesBase is Test {
167168
function setUp() public {
168-
vm.createSelectFork(vm.rpcUrl('base'), 31620903); // 2025-15-06
169+
vm.createSelectFork(vm.rpcUrl('base'), 39376200); // Dec-12-2025
169170
}
170171

171172
function test_getExchangeRate() public view {
@@ -186,13 +187,18 @@ contract ExchangeRatesBase is Test {
186187
IChainlinkAggregator(CapAdaptersCodeBase.rsETH_ETH_AGGREGATOR).latestAnswer()
187188
);
188189

190+
uint256 syrupUSDCCLRate = uint256(
191+
IChainlinkAggregator(ChainlinkBase.syrupUSDC_USDC_Exchange_Rate).latestAnswer()
192+
);
193+
189194
console.log('Base');
190195
console.log('cbEthRate', cbEthRate);
191196
console.log('wstEthRate', wstEthRate);
192197
console.log('weEthRate', weEthRate);
193198
console.log('ezEthRate', ezEthRate);
194199
console.log('rsETHRate', rsETHRate);
195200
console.log('rsETHCLRate', rsETHCLRate);
201+
console.log('syrupUSDCCLRate', syrupUSDCCLRate);
196202

197203
console.log(block.timestamp);
198204
}

0 commit comments

Comments
 (0)