Skip to content

Commit bc95001

Browse files
authored
Merge pull request #169 from sprintertech/feat-legacy-pools
Allow legacy pools to have routes after upgrade
2 parents 0f3b1d1 + ae63629 commit bc95001

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

network.config.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ export const ERC4626AdapterUSDCVersions = [
5858
ERC4626AdapterUSDCV2,
5959
] as const;
6060

61+
const SUPPORTS_ONLY_USDC = false;
62+
6163
export enum Network {
6264
ETHEREUM = "ETHEREUM",
6365
AVALANCHE = "AVALANCHE",
@@ -134,6 +136,10 @@ interface AavePoolLongTermConfig extends AavePoolConfig {
134136
RepayCaller: string;
135137
}
136138

139+
interface ActiveLegacyPoolConfig {
140+
[Pool: string]: boolean; // SupportsAllTokens
141+
}
142+
137143
// Liquidity mining tiers.
138144
// period is in seconds.
139145
// multiplier will be divided by 1000,000,000. So 1750000000 will result in 1.75x.
@@ -190,6 +196,7 @@ export interface NetworkConfig {
190196
USDCStablecoinPool?: boolean;
191197
USDCPublicPool?: PublicPoolConfig;
192198
ERC4626AdapterUSDCTargetVault?: string;
199+
ActiveLegacyPools?: ActiveLegacyPoolConfig;
193200
Stage?: NetworkConfig;
194201
}
195202

@@ -334,6 +341,9 @@ export const networkConfig: NetworksConfig = {
334341
[Network.ARBITRUM_ONE]: [Provider.CCTP],
335342
[Network.OP_MAINNET]: [Provider.CCTP],
336343
},
344+
[LiquidityPoolUSDCV3]: {
345+
[Network.BASE]: [Provider.CCTP],
346+
},
337347
[LiquidityPoolUSDCV4]: {
338348
[Network.BASE]: [Provider.CCTP],
339349
[Network.ARBITRUM_ONE]: [Provider.CCTP],
@@ -360,6 +370,17 @@ export const networkConfig: NetworksConfig = {
360370
],
361371
},
362372
},
373+
[LiquidityPoolUSDCV3]: {
374+
SupportsAllTokens: false,
375+
Domains: {
376+
[Network.BASE]: [
377+
Provider.CCTP,
378+
Provider.ACROSS,
379+
Provider.EVERCLEAR,
380+
Provider.SUPERCHAIN_STANDARD_BRIDGE,
381+
],
382+
},
383+
},
363384
[LiquidityPoolUSDCV4]: {
364385
SupportsAllTokens: false,
365386
Domains: {
@@ -568,6 +589,9 @@ export const networkConfig: NetworksConfig = {
568589
[Network.BASE]: [Provider.CCTP],
569590
[Network.ARBITRUM_ONE]: [Provider.CCTP],
570591
},
592+
[LiquidityPoolUSDCV3]: {
593+
[Network.BASE]: [Provider.CCTP],
594+
},
571595
[LiquidityPoolUSDCV4]: {
572596
[Network.BASE]: [Provider.CCTP],
573597
[Network.ARBITRUM_ONE]: [Provider.CCTP],
@@ -588,6 +612,12 @@ export const networkConfig: NetworksConfig = {
588612
[Network.BASE]: [Provider.CCTP, Provider.ACROSS, Provider.EVERCLEAR],
589613
},
590614
},
615+
[LiquidityPoolUSDCV3]: {
616+
SupportsAllTokens: false,
617+
Domains: {
618+
[Network.BASE]: [Provider.CCTP, Provider.ACROSS, Provider.EVERCLEAR],
619+
},
620+
},
591621
[LiquidityPoolUSDCV4]: {
592622
SupportsAllTokens: false,
593623
Domains: {
@@ -752,6 +782,9 @@ export const networkConfig: NetworksConfig = {
752782
[Network.BASE]: [Provider.CCTP],
753783
[Network.OP_MAINNET]: [Provider.CCTP],
754784
},
785+
[LiquidityPoolUSDCV3]: {
786+
[Network.BASE]: [Provider.CCTP],
787+
},
755788
[LiquidityPoolUSDCV4]: {
756789
[Network.BASE]: [Provider.CCTP],
757790
[Network.OP_MAINNET]: [Provider.CCTP],
@@ -766,6 +799,12 @@ export const networkConfig: NetworksConfig = {
766799
[Network.BASE]: [Provider.CCTP, Provider.ACROSS, Provider.EVERCLEAR],
767800
},
768801
},
802+
[LiquidityPoolUSDCV3]: {
803+
SupportsAllTokens: false,
804+
Domains: {
805+
[Network.BASE]: [Provider.CCTP, Provider.ACROSS, Provider.EVERCLEAR],
806+
},
807+
},
769808
[LiquidityPoolUSDCV4]: {
770809
SupportsAllTokens: false,
771810
Domains: {
@@ -1010,6 +1049,9 @@ export const networkConfig: NetworksConfig = {
10101049
},
10111050
},
10121051
USDCPool: true,
1052+
ActiveLegacyPools: {
1053+
[LiquidityPoolUSDCV3]: SUPPORTS_ONLY_USDC,
1054+
},
10131055
},
10141056
},
10151057
POLYGON_MAINNET: {

scripts/helpers.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,16 @@ export async function addLocalPools(
294294
config.ERC4626AdapterUSDCTargetVault, network, routes, ERC4626AdapterUSDCVersions, false, "ERC4626 Adapter USDC"
295295
);
296296
}
297+
if (config.ActiveLegacyPools) {
298+
for (const [pool, supportsAllTokens] of Object.entries(config.ActiveLegacyPools) as [string, boolean][]) {
299+
routes.push({
300+
Pool: await resolveXAddress(pool),
301+
Domain: network,
302+
Provider: Provider.LOCAL,
303+
SupportsAllTokens: supportsAllTokens,
304+
});
305+
}
306+
}
297307
}
298308

299309
export function getNetworkConfigsForCurrentEnv(config: NetworkConfig): PartialNetworksConfig {

0 commit comments

Comments
 (0)