Skip to content

Commit 7fbd3ca

Browse files
committed
Allow legacy pools to have routes after upgrade
1 parent 1f29e29 commit 7fbd3ca

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

@@ -333,6 +340,9 @@ export const networkConfig: NetworksConfig = {
333340
[Network.ARBITRUM_ONE]: [Provider.CCTP],
334341
[Network.OP_MAINNET]: [Provider.CCTP],
335342
},
343+
[LiquidityPoolUSDCV3]: {
344+
[Network.BASE]: [Provider.CCTP],
345+
},
336346
[LiquidityPoolUSDCV4]: {
337347
[Network.BASE]: [Provider.CCTP],
338348
[Network.ARBITRUM_ONE]: [Provider.CCTP],
@@ -359,6 +369,17 @@ export const networkConfig: NetworksConfig = {
359369
],
360370
},
361371
},
372+
[LiquidityPoolUSDCV3]: {
373+
SupportsAllTokens: false,
374+
Domains: {
375+
[Network.BASE]: [
376+
Provider.CCTP,
377+
Provider.ACROSS,
378+
Provider.EVERCLEAR,
379+
Provider.SUPERCHAIN_STANDARD_BRIDGE,
380+
],
381+
},
382+
},
362383
[LiquidityPoolUSDCV4]: {
363384
SupportsAllTokens: false,
364385
Domains: {
@@ -567,6 +588,9 @@ export const networkConfig: NetworksConfig = {
567588
[Network.BASE]: [Provider.CCTP],
568589
[Network.ARBITRUM_ONE]: [Provider.CCTP],
569590
},
591+
[LiquidityPoolUSDCV3]: {
592+
[Network.BASE]: [Provider.CCTP],
593+
},
570594
[LiquidityPoolUSDCV4]: {
571595
[Network.BASE]: [Provider.CCTP],
572596
[Network.ARBITRUM_ONE]: [Provider.CCTP],
@@ -587,6 +611,12 @@ export const networkConfig: NetworksConfig = {
587611
[Network.BASE]: [Provider.CCTP, Provider.ACROSS, Provider.EVERCLEAR],
588612
},
589613
},
614+
[LiquidityPoolUSDCV3]: {
615+
SupportsAllTokens: false,
616+
Domains: {
617+
[Network.BASE]: [Provider.CCTP, Provider.ACROSS, Provider.EVERCLEAR],
618+
},
619+
},
590620
[LiquidityPoolUSDCV4]: {
591621
SupportsAllTokens: false,
592622
Domains: {
@@ -751,6 +781,9 @@ export const networkConfig: NetworksConfig = {
751781
[Network.BASE]: [Provider.CCTP],
752782
[Network.OP_MAINNET]: [Provider.CCTP],
753783
},
784+
[LiquidityPoolUSDCV3]: {
785+
[Network.BASE]: [Provider.CCTP],
786+
},
754787
[LiquidityPoolUSDCV4]: {
755788
[Network.BASE]: [Provider.CCTP],
756789
[Network.OP_MAINNET]: [Provider.CCTP],
@@ -765,6 +798,12 @@ export const networkConfig: NetworksConfig = {
765798
[Network.BASE]: [Provider.CCTP, Provider.ACROSS, Provider.EVERCLEAR],
766799
},
767800
},
801+
[LiquidityPoolUSDCV3]: {
802+
SupportsAllTokens: false,
803+
Domains: {
804+
[Network.BASE]: [Provider.CCTP, Provider.ACROSS, Provider.EVERCLEAR],
805+
},
806+
},
768807
[LiquidityPoolUSDCV4]: {
769808
SupportsAllTokens: false,
770809
Domains: {
@@ -1007,6 +1046,9 @@ export const networkConfig: NetworksConfig = {
10071046
},
10081047
},
10091048
USDCPool: true,
1049+
ActiveLegacyPools: {
1050+
[LiquidityPoolUSDCV3]: SUPPORTS_ONLY_USDC,
1051+
},
10101052
},
10111053
},
10121054
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)