From 67ed641e8df0a518c15435004f5b9e2da00a3cd0 Mon Sep 17 00:00:00 2001 From: Vasilis Xouris Date: Thu, 21 Nov 2024 13:15:32 -0800 Subject: [PATCH 1/2] feat(routing-api): support routing on unichain mainnet --- bin/app.ts | 10 +- bin/stacks/routing-lambda-stack.ts | 4 +- lib/config/rpcProviderProdConfig.json | 15 +- lib/cron/cache-config.ts | 8 +- .../rpc-providers-widgets-factory.ts | 3 +- lib/graphql/graphql-provider.ts | 6 +- lib/handlers/injector-sor.ts | 7 +- ...e-provider-traffic-switch-configuration.ts | 5 +- lib/handlers/shared.ts | 3 +- lib/rpc/utils.ts | 9 +- lib/util/defaultBlocksToLiveRoutesDB.ts | 3 +- ...xtraV4FeeTiersTickSpacingsHookAddresses.ts | 3 +- lib/util/gasLimit.ts | 4 +- lib/util/hooksAddressesAllowlist.ts | 3 +- lib/util/newCachedRoutesRolloutPercent.ts | 3 +- lib/util/onChainQuoteProviderConfigs.ts | 115 ++++++-- lib/util/tenderlyNewEndpointRolloutPercent.ts | 3 +- lib/util/testNets.ts | 2 +- package-lock.json | 252 +++++++----------- package.json | 14 +- test/mocha/e2e/quote.test.ts | 14 +- test/utils/tokens.ts | 9 +- 22 files changed, 280 insertions(+), 215 deletions(-) diff --git a/bin/app.ts b/bin/app.ts index 863d304d86..c15a0c0cce 100644 --- a/bin/app.ts +++ b/bin/app.ts @@ -181,7 +181,7 @@ export class RoutingAPIPipeline extends Stack { // Load RPC provider URLs from AWS secret let jsonRpcProviders = {} as { [chainId: string]: string } SUPPORTED_CHAINS.forEach((chainId: ChainId) => { - if (chainId !== ChainId.WORLDCHAIN && chainId !== ChainId.ASTROCHAIN_SEPOLIA) { + if (chainId !== ChainId.WORLDCHAIN && chainId !== ChainId.UNICHAIN_SEPOLIA) { const key = `WEB3_RPC_${chainId}` jsonRpcProviders[key] = jsonRpcProvidersSecret.secretValueFromJson(key).toString() new CfnOutput(this, key, { @@ -234,7 +234,9 @@ export class RoutingAPIPipeline extends Stack { 'ALCHEMY_324', // WorldChain, 'QUICKNODE_480', - // AstroChain Sepolia, + // Unichain + 'QUICKNODE_130', + // Unichain Sepolia, 'QUICKNODE_1301', // unirpc - serves all chains 'UNIRPC_0', @@ -410,7 +412,9 @@ const jsonRpcProviders = { ALCHEMY_324: process.env.ALCHEMY_324!, // WorldChain, QUICKNODE_480: process.env.QUICKNODE_480!, - // AstroChain Sepolia, + // Unichain + QUICKNODE_130: process.env.QUICKNODE_130!, + // Unichain Sepolia, QUICKNODE_1301: process.env.QUICKNODE_1301!, // unirpc - serves all chains UNIRPC_0: process.env.UNIRPC_0!, diff --git a/bin/stacks/routing-lambda-stack.ts b/bin/stacks/routing-lambda-stack.ts index 2213898e93..7463ead9b4 100644 --- a/bin/stacks/routing-lambda-stack.ts +++ b/bin/stacks/routing-lambda-stack.ts @@ -122,7 +122,7 @@ export class RoutingLambdaStack extends cdk.NestedStack { description: 'Caching Routing Lambda', environment: { - VERSION: '1', + VERSION: '2', NODE_OPTIONS: '--enable-source-maps', POOL_CACHE_BUCKET: poolCacheBucket.bucketName, POOL_CACHE_BUCKET_3: poolCacheBucket3.bucketName, @@ -186,7 +186,7 @@ export class RoutingLambdaStack extends cdk.NestedStack { description: 'Routing Lambda', environment: { - VERSION: '28', + VERSION: '29', NODE_OPTIONS: '--enable-source-maps', POOL_CACHE_BUCKET: poolCacheBucket.bucketName, POOL_CACHE_BUCKET_3: poolCacheBucket3.bucketName, diff --git a/lib/config/rpcProviderProdConfig.json b/lib/config/rpcProviderProdConfig.json index c56557af86..f90901c92d 100644 --- a/lib/config/rpcProviderProdConfig.json +++ b/lib/config/rpcProviderProdConfig.json @@ -122,8 +122,17 @@ "useMultiProviderProb": 1, "latencyEvaluationSampleProb": 0, "healthCheckSampleProb": 0, - "providerInitialWeights": [1], - "providerUrls": ["QUICKNODE_1301"], - "providerNames": ["QUICKNODE"] + "providerInitialWeights": [0, 1], + "providerUrls": ["QUICKNODE_1301", "UNIRPC_0"], + "providerNames": ["QUICKNODE", "UNIRPC"] + }, + { + "chainId": 130, + "useMultiProviderProb": 1, + "latencyEvaluationSampleProb": 0, + "healthCheckSampleProb": 0, + "providerInitialWeights": [0, 1], + "providerUrls": ["QUICKNODE_130", "UNIRPC_0"], + "providerNames": ["QUICKNODE", "UNIRPC"] } ] diff --git a/lib/cron/cache-config.ts b/lib/cron/cache-config.ts index 98e026e993..9087baaf08 100644 --- a/lib/cron/cache-config.ts +++ b/lib/cron/cache-config.ts @@ -37,8 +37,10 @@ export const v3SubgraphUrlOverride = (chainId: ChainId) => { return `https://subgraph.satsuma-prod.com/${process.env.ALCHEMY_QUERY_KEY}/uniswap/uniswap-v3-celo/api` case ChainId.WORLDCHAIN: return `https://subgraph.satsuma-prod.com/${process.env.ALCHEMY_QUERY_KEY}/uniswap/uniswap-v3-worldchain/api` - case ChainId.ASTROCHAIN_SEPOLIA: + case ChainId.UNICHAIN_SEPOLIA: return `https://subgraph.satsuma-prod.com/${process.env.ALCHEMY_QUERY_KEY}/uniswap/uniswap-v3-astrochain-sepolia/api` + case ChainId.UNICHAIN: + return `https://subgraph.satsuma-prod.com/${process.env.ALCHEMY_QUERY_KEY}/uniswap/uniswap-v3-unichain/api` default: return undefined } @@ -64,8 +66,10 @@ export const v2SubgraphUrlOverride = (chainId: ChainId) => { return `https://subgraph.satsuma-prod.com/${process.env.ALCHEMY_QUERY_KEY}/uniswap/uniswap-v2-base/api` case ChainId.WORLDCHAIN: return `https://subgraph.satsuma-prod.com/${process.env.ALCHEMY_QUERY_KEY}/uniswap/uniswap-v2-worldchain/api` - case ChainId.ASTROCHAIN_SEPOLIA: + case ChainId.UNICHAIN_SEPOLIA: return `https://subgraph.satsuma-prod.com/${process.env.ALCHEMY_QUERY_KEY}/uniswap/uniswap-v2-astrochain-sepolia/api` + case ChainId.UNICHAIN: + return `https://subgraph.satsuma-prod.com/${process.env.ALCHEMY_QUERY_KEY}/uniswap/uniswap-v2-unichain/api` default: return undefined } diff --git a/lib/dashboards/rpc-providers-widgets-factory.ts b/lib/dashboards/rpc-providers-widgets-factory.ts index 08e0a4b614..ee3d232e5d 100644 --- a/lib/dashboards/rpc-providers-widgets-factory.ts +++ b/lib/dashboards/rpc-providers-widgets-factory.ts @@ -20,7 +20,8 @@ const ID_TO_PROVIDER = (id: ChainId): string => { case ChainId.CELO: case ChainId.BNB: case ChainId.BASE: - case ChainId.ASTROCHAIN_SEPOLIA: + case ChainId.UNICHAIN_SEPOLIA: + case ChainId.UNICHAIN: return ProviderName.QUIKNODE case ChainId.CELO_ALFAJORES: return ProviderName.FORNO diff --git a/lib/graphql/graphql-provider.ts b/lib/graphql/graphql-provider.ts index 491da7a8d0..a59fb55192 100644 --- a/lib/graphql/graphql-provider.ts +++ b/lib/graphql/graphql-provider.ts @@ -59,8 +59,10 @@ export class UniGraphQLProvider implements IUniGraphQLProvider { return 'ZKSYNC' case ChainId.WORLDCHAIN: return 'WORLDCHAIN' - case ChainId.ASTROCHAIN_SEPOLIA: - return 'ASTROCHAIN' + case ChainId.UNICHAIN_SEPOLIA: + return 'UNICHAIN_SEPOLIA' + case ChainId.UNICHAIN: + return 'UNICHAIN' default: throw new Error(`UniGraphQLProvider._chainIdToGraphQLChainName unsupported ChainId: ${chainId}`) } diff --git a/lib/handlers/injector-sor.ts b/lib/handlers/injector-sor.ts index 1bd408600f..fd0e9d7505 100644 --- a/lib/handlers/injector-sor.ts +++ b/lib/handlers/injector-sor.ts @@ -108,7 +108,8 @@ export const SUPPORTED_CHAINS: ChainId[] = [ ChainId.ZORA, ChainId.ZKSYNC, ChainId.WORLDCHAIN, - ChainId.ASTROCHAIN_SEPOLIA, + ChainId.UNICHAIN_SEPOLIA, + ChainId.UNICHAIN, ] const DEFAULT_TOKEN_LIST = 'https://gateway.ipfs.io/ipns/tokens.uniswap.org' @@ -366,7 +367,8 @@ export abstract class InjectorSOR extends Injector< case ChainId.ZORA: case ChainId.ZKSYNC: case ChainId.WORLDCHAIN: - case ChainId.ASTROCHAIN_SEPOLIA: + case ChainId.UNICHAIN_SEPOLIA: + case ChainId.UNICHAIN: const currentQuoteProvider = new OnChainQuoteProvider( chainId, provider, @@ -498,6 +500,7 @@ export abstract class InjectorSOR extends Injector< ChainId.AVALANCHE, ChainId.BLAST, ChainId.WORLDCHAIN, + //ChainId.UNICHAIN, // Supported? ] const v4Supported = [ChainId.SEPOLIA] diff --git a/lib/handlers/quote/util/quote-provider-traffic-switch-configuration.ts b/lib/handlers/quote/util/quote-provider-traffic-switch-configuration.ts index ae600ead27..48393c2a5f 100644 --- a/lib/handlers/quote/util/quote-provider-traffic-switch-configuration.ts +++ b/lib/handlers/quote/util/quote-provider-traffic-switch-configuration.ts @@ -227,9 +227,10 @@ export const QUOTE_PROVIDER_TRAFFIC_SWITCH_CONFIGURATION = ( samplingExactOutPercentage: 0, } as QuoteProviderTrafficSwitchConfiguration } - // worldchain and astrochain sepolia don't have the view-only quoter yet, so we can shadow sample 0.1% of traffic + // worldchain and unichain sepolia don't have the view-only quoter yet, so we can shadow sample 0.1% of traffic case ChainId.WORLDCHAIN: - case ChainId.ASTROCHAIN_SEPOLIA: + case ChainId.UNICHAIN_SEPOLIA: + case ChainId.UNICHAIN: switch (protocol) { case Protocol.MIXED: case Protocol.V4: diff --git a/lib/handlers/shared.ts b/lib/handlers/shared.ts index 68f99243b4..d33c6d4659 100644 --- a/lib/handlers/shared.ts +++ b/lib/handlers/shared.ts @@ -51,7 +51,8 @@ export const DEFAULT_ROUTING_CONFIG_BY_CHAIN = (chainId: ChainId): AlphaRouterCo case ChainId.BASE: case ChainId.OPTIMISM: case ChainId.WORLDCHAIN: - case ChainId.ASTROCHAIN_SEPOLIA: + case ChainId.UNICHAIN_SEPOLIA: + case ChainId.UNICHAIN: return { v2PoolSelection: { topN: 3, diff --git a/lib/rpc/utils.ts b/lib/rpc/utils.ts index b01a25fb3b..a99d566fc3 100644 --- a/lib/rpc/utils.ts +++ b/lib/rpc/utils.ts @@ -20,8 +20,10 @@ export function chainIdToNetworkName(networkId: ChainId): string { return 'base' case ChainId.WORLDCHAIN: return 'worldchain' - case ChainId.ASTROCHAIN_SEPOLIA: - return 'astrochain-sepolia' + case ChainId.UNICHAIN_SEPOLIA: + return 'unichain-sepolia' + case ChainId.UNICHAIN: + return 'unichain' default: return 'ethereum' } @@ -102,6 +104,9 @@ export function generateProviderUrl(key: string, value: string, chainId: number) // URL contains unichain-sepolia.quiknode.pro, we had to not disclose prior to the unichain annouce return `${tokens[0]}` } + case 'QUICKNODE_130': { + return `https://${tokens[0]}.unichain-mainnet.quiknode.pro/${tokens[1]}` + } case 'QUICKNODE_480': { return `https://${tokens[0]}.worldchain-mainnet.quiknode.pro/${tokens[1]}` } diff --git a/lib/util/defaultBlocksToLiveRoutesDB.ts b/lib/util/defaultBlocksToLiveRoutesDB.ts index 56f811fea9..d5ce520df7 100644 --- a/lib/util/defaultBlocksToLiveRoutesDB.ts +++ b/lib/util/defaultBlocksToLiveRoutesDB.ts @@ -22,7 +22,8 @@ export const DEFAULT_BLOCKS_TO_LIVE_ROUTES_DB: { [chain in ChainId]: number } = [ChainId.BLAST]: 1800, [ChainId.WORLDCHAIN]: 1800, // (60 minutes) / (1 seconds) = 3600 - [ChainId.ASTROCHAIN_SEPOLIA]: 3600, + [ChainId.UNICHAIN_SEPOLIA]: 3600, + [ChainId.UNICHAIN]: 3600, // (60 minutes) / (250 milliseconds) = 14400 [ChainId.ARBITRUM_ONE]: 14400, [ChainId.ARBITRUM_GOERLI]: 14400, diff --git a/lib/util/extraV4FeeTiersTickSpacingsHookAddresses.ts b/lib/util/extraV4FeeTiersTickSpacingsHookAddresses.ts index 389a7f7e2a..2e867744f5 100644 --- a/lib/util/extraV4FeeTiersTickSpacingsHookAddresses.ts +++ b/lib/util/extraV4FeeTiersTickSpacingsHookAddresses.ts @@ -45,5 +45,6 @@ export const EXTRA_V4_FEE_TICK_SPACINGS_HOOK_ADDRESSES: { [chain in ChainId]: Ar [ChainId.BLAST]: emptyV4FeeTickSpacingsHookAddresses, [ChainId.ZKSYNC]: emptyV4FeeTickSpacingsHookAddresses, [ChainId.WORLDCHAIN]: emptyV4FeeTickSpacingsHookAddresses, - [ChainId.ASTROCHAIN_SEPOLIA]: emptyV4FeeTickSpacingsHookAddresses, + [ChainId.UNICHAIN]: emptyV4FeeTickSpacingsHookAddresses, + [ChainId.UNICHAIN_SEPOLIA]: emptyV4FeeTickSpacingsHookAddresses, } diff --git a/lib/util/gasLimit.ts b/lib/util/gasLimit.ts index ce15cc967c..5420ea8936 100644 --- a/lib/util/gasLimit.ts +++ b/lib/util/gasLimit.ts @@ -7,11 +7,11 @@ export const CELO_UPPER_SWAP_GAS_LIMIT = BigNumber.from(5000000) // https://github.com/Uniswap/routing-api/blob/fe410751985995cb2904837e24f22da7dca1f518/lib/util/onChainQuoteProviderConfigs.ts#L340 divivde by 10 export const WORLDCHAIN_UPPER_SWAP_GAS_LIMIT = BigNumber.from(300000) // https://github.com/Uniswap/routing-api/blob/fe410751985995cb2904837e24f22da7dca1f518/lib/util/onChainQuoteProviderConfigs.ts#L344 divivde by 10 -export const ASTROCHAIN_SEPOLIA_UPPER_SWAP_GAS_LIMIT = BigNumber.from(300000) +export const UNICHAIN_SEPOLIA_UPPER_SWAP_GAS_LIMIT = BigNumber.from(300000) export const CHAIN_TO_GAS_LIMIT_MAP: { [chainId: number]: BigNumber } = { [ChainId.ZKSYNC]: ZKSYNC_UPPER_SWAP_GAS_LIMIT, [ChainId.CELO]: CELO_UPPER_SWAP_GAS_LIMIT, [ChainId.CELO_ALFAJORES]: CELO_UPPER_SWAP_GAS_LIMIT, - [ChainId.ASTROCHAIN_SEPOLIA]: ASTROCHAIN_SEPOLIA_UPPER_SWAP_GAS_LIMIT, + [ChainId.UNICHAIN_SEPOLIA]: UNICHAIN_SEPOLIA_UPPER_SWAP_GAS_LIMIT, } diff --git a/lib/util/hooksAddressesAllowlist.ts b/lib/util/hooksAddressesAllowlist.ts index f339efb190..acf46eae69 100644 --- a/lib/util/hooksAddressesAllowlist.ts +++ b/lib/util/hooksAddressesAllowlist.ts @@ -31,5 +31,6 @@ export const HOOKS_ADDRESSES_ALLOWLIST: { [chain in ChainId]: Array } = [ChainId.BLAST]: [ADDRESS_ZERO], [ChainId.ZKSYNC]: [ADDRESS_ZERO], [ChainId.WORLDCHAIN]: [ADDRESS_ZERO], - [ChainId.ASTROCHAIN_SEPOLIA]: [ADDRESS_ZERO], + [ChainId.UNICHAIN]: [ADDRESS_ZERO], + [ChainId.UNICHAIN_SEPOLIA]: [ADDRESS_ZERO], } diff --git a/lib/util/newCachedRoutesRolloutPercent.ts b/lib/util/newCachedRoutesRolloutPercent.ts index 9e1260ab1a..fcadc04caf 100644 --- a/lib/util/newCachedRoutesRolloutPercent.ts +++ b/lib/util/newCachedRoutesRolloutPercent.ts @@ -30,5 +30,6 @@ export const NEW_CACHED_ROUTES_ROLLOUT_PERCENT: { [chain in ChainId]: number } = [ChainId.BLAST]: 100, [ChainId.ZKSYNC]: 100, [ChainId.WORLDCHAIN]: 100, - [ChainId.ASTROCHAIN_SEPOLIA]: 100, + [ChainId.UNICHAIN]: 100, + [ChainId.UNICHAIN_SEPOLIA]: 100, } diff --git a/lib/util/onChainQuoteProviderConfigs.ts b/lib/util/onChainQuoteProviderConfigs.ts index 160bfa6c18..3c5f5f3475 100644 --- a/lib/util/onChainQuoteProviderConfigs.ts +++ b/lib/util/onChainQuoteProviderConfigs.ts @@ -47,7 +47,12 @@ export const RETRY_OPTIONS: { [chainId: number]: AsyncRetry.Options | undefined minTimeout: 100, maxTimeout: 1000, }, - [ChainId.ASTROCHAIN_SEPOLIA]: { + [ChainId.UNICHAIN_SEPOLIA]: { + retries: 2, + minTimeout: 100, + maxTimeout: 1000, + }, + [ChainId.UNICHAIN]: { retries: 2, minTimeout: 100, maxTimeout: 1000, @@ -115,8 +120,14 @@ export const OPTIMISTIC_CACHED_ROUTES_BATCH_PARAMS: { [protocol in Protocol]: { gasLimitPerCall: 1_200_000, quoteMinSuccessRate: 0.1, }, - // TODO: once astrochain-sepolia has view-quoter, optimize muilcallChunk and gasLimitPerCall - [ChainId.ASTROCHAIN_SEPOLIA]: { + // TODO: once unichain-sepolia has view-quoter, optimize muilcallChunk and gasLimitPerCall + [ChainId.UNICHAIN_SEPOLIA]: { + multicallChunk: 80, + gasLimitPerCall: 1_200_000, + quoteMinSuccessRate: 0.1, + }, + // TODO: once unichain has view-quoter, optimize muilcallChunk and gasLimitPerCall + [ChainId.UNICHAIN]: { multicallChunk: 80, gasLimitPerCall: 1_200_000, quoteMinSuccessRate: 0.1, @@ -180,8 +191,14 @@ export const OPTIMISTIC_CACHED_ROUTES_BATCH_PARAMS: { [protocol in Protocol]: { gasLimitPerCall: 1_200_000, quoteMinSuccessRate: 0.1, }, - // TODO: once astrochain-sepolia has view-quoter, optimize muilcallChunk and gasLimitPerCall - [ChainId.ASTROCHAIN_SEPOLIA]: { + // TODO: once unichain-sepolia has view-quoter, optimize muilcallChunk and gasLimitPerCall + [ChainId.UNICHAIN_SEPOLIA]: { + multicallChunk: 80, + gasLimitPerCall: 1_200_000, + quoteMinSuccessRate: 0.1, + }, + // TODO: once unichain has view-quoter, optimize muilcallChunk and gasLimitPerCall + [ChainId.UNICHAIN]: { multicallChunk: 80, gasLimitPerCall: 1_200_000, quoteMinSuccessRate: 0.1, @@ -246,8 +263,14 @@ export const OPTIMISTIC_CACHED_ROUTES_BATCH_PARAMS: { [protocol in Protocol]: { gasLimitPerCall: 1_200_000, quoteMinSuccessRate: 0.1, }, - // TODO: once astrochain-sepolia has view-quoter, optimize muilcallChunk and gasLimitPerCall - [ChainId.ASTROCHAIN_SEPOLIA]: { + // TODO: once unichain-sepolia has view-quoter, optimize muilcallChunk and gasLimitPerCall + [ChainId.UNICHAIN_SEPOLIA]: { + multicallChunk: 80, + gasLimitPerCall: 1_200_000, + quoteMinSuccessRate: 0.1, + }, + // TODO: once unichain has view-quoter, optimize muilcallChunk and gasLimitPerCall + [ChainId.UNICHAIN]: { multicallChunk: 80, gasLimitPerCall: 1_200_000, quoteMinSuccessRate: 0.1, @@ -306,8 +329,14 @@ export const OPTIMISTIC_CACHED_ROUTES_BATCH_PARAMS: { [protocol in Protocol]: { gasLimitPerCall: 1_200_000, quoteMinSuccessRate: 0.1, }, - // TODO: once astrochain-sepolia has view-quoter, optimize muilcallChunk and gasLimitPerCall - [ChainId.ASTROCHAIN_SEPOLIA]: { + // TODO: once unichain-sepolia has view-quoter, optimize muilcallChunk and gasLimitPerCall + [ChainId.UNICHAIN_SEPOLIA]: { + multicallChunk: 80, + gasLimitPerCall: 1_200_000, + quoteMinSuccessRate: 0.1, + }, + // TODO: once unichain has view-quoter, optimize muilcallChunk and gasLimitPerCall + [ChainId.UNICHAIN]: { multicallChunk: 80, gasLimitPerCall: 1_200_000, quoteMinSuccessRate: 0.1, @@ -377,8 +406,14 @@ export const NON_OPTIMISTIC_CACHED_ROUTES_BATCH_PARAMS: { [protocol in Protocol] gasLimitPerCall: 1_200_000, quoteMinSuccessRate: 0.1, }, - // TODO: once astrochain-sepolia has view-quoter, optimize muilcallChunk and gasLimitPerCall - [ChainId.ASTROCHAIN_SEPOLIA]: { + // TODO: once unichain-sepolia has view-quoter, optimize muilcallChunk and gasLimitPerCall + [ChainId.UNICHAIN_SEPOLIA]: { + multicallChunk: 80, + gasLimitPerCall: 1_200_000, + quoteMinSuccessRate: 0.1, + }, + // TODO: once unichain has view-quoter, optimize muilcallChunk and gasLimitPerCall + [ChainId.UNICHAIN]: { multicallChunk: 80, gasLimitPerCall: 1_200_000, quoteMinSuccessRate: 0.1, @@ -442,8 +477,14 @@ export const NON_OPTIMISTIC_CACHED_ROUTES_BATCH_PARAMS: { [protocol in Protocol] gasLimitPerCall: 1_200_000, quoteMinSuccessRate: 0.1, }, - // TODO: once astrochain-sepolia has view-quoter, optimize muilcallChunk and gasLimitPerCall - [ChainId.ASTROCHAIN_SEPOLIA]: { + // TODO: once unichain-sepolia has view-quoter, optimize muilcallChunk and gasLimitPerCall + [ChainId.UNICHAIN_SEPOLIA]: { + multicallChunk: 80, + gasLimitPerCall: 1_200_000, + quoteMinSuccessRate: 0.1, + }, + // TODO: once unichain has view-quoter, optimize muilcallChunk and gasLimitPerCall + [ChainId.UNICHAIN]: { multicallChunk: 80, gasLimitPerCall: 1_200_000, quoteMinSuccessRate: 0.1, @@ -508,8 +549,14 @@ export const NON_OPTIMISTIC_CACHED_ROUTES_BATCH_PARAMS: { [protocol in Protocol] gasLimitPerCall: 1_200_000, quoteMinSuccessRate: 0.1, }, - // TODO: once astrochain-sepolia has view-quoter, optimize muilcallChunk and gasLimitPerCall - [ChainId.ASTROCHAIN_SEPOLIA]: { + // TODO: once unichain-sepolia has view-quoter, optimize muilcallChunk and gasLimitPerCall + [ChainId.UNICHAIN_SEPOLIA]: { + multicallChunk: 80, + gasLimitPerCall: 1_200_000, + quoteMinSuccessRate: 0.1, + }, + // TODO: once unichain has view-quoter, optimize muilcallChunk and gasLimitPerCall + [ChainId.UNICHAIN]: { multicallChunk: 80, gasLimitPerCall: 1_200_000, quoteMinSuccessRate: 0.1, @@ -568,8 +615,14 @@ export const NON_OPTIMISTIC_CACHED_ROUTES_BATCH_PARAMS: { [protocol in Protocol] gasLimitPerCall: 1_200_000, quoteMinSuccessRate: 0.1, }, - // TODO: once astrochain-sepolia has view-quoter, optimize muilcallChunk and gasLimitPerCall - [ChainId.ASTROCHAIN_SEPOLIA]: { + // TODO: once unichain-sepolia has view-quoter, optimize muilcallChunk and gasLimitPerCall + [ChainId.UNICHAIN_SEPOLIA]: { + multicallChunk: 80, + gasLimitPerCall: 1_200_000, + quoteMinSuccessRate: 0.1, + }, + // TODO: once unichain has view-quoter, optimize muilcallChunk and gasLimitPerCall + [ChainId.UNICHAIN]: { multicallChunk: 80, gasLimitPerCall: 1_200_000, quoteMinSuccessRate: 0.1, @@ -607,7 +660,11 @@ export const GAS_ERROR_FAILURE_OVERRIDES: { [chainId: number]: FailureOverrides gasLimitOverride: 3_000_000, multicallChunk: 45, }, - [ChainId.ASTROCHAIN_SEPOLIA]: { + [ChainId.UNICHAIN_SEPOLIA]: { + gasLimitOverride: 3_000_000, + multicallChunk: 45, + }, + [ChainId.UNICHAIN]: { gasLimitOverride: 3_000_000, multicallChunk: 45, }, @@ -643,7 +700,11 @@ export const SUCCESS_RATE_FAILURE_OVERRIDES: { [chainId: number]: FailureOverrid gasLimitOverride: 3_000_000, multicallChunk: 45, }, - [ChainId.ASTROCHAIN_SEPOLIA]: { + [ChainId.UNICHAIN_SEPOLIA]: { + gasLimitOverride: 3_000_000, + multicallChunk: 45, + }, + [ChainId.UNICHAIN]: { gasLimitOverride: 3_000_000, multicallChunk: 45, }, @@ -691,7 +752,15 @@ export const BLOCK_NUMBER_CONFIGS: { [chainId: number]: BlockNumberConfig } = { rollbackBlockOffset: -20, }, }, - [ChainId.ASTROCHAIN_SEPOLIA]: { + [ChainId.UNICHAIN_SEPOLIA]: { + baseBlockOffset: -25, + rollback: { + enabled: true, + attemptsBeforeRollback: 1, + rollbackBlockOffset: -20, + }, + }, + [ChainId.UNICHAIN]: { baseBlockOffset: -25, rollback: { enabled: true, @@ -729,7 +798,8 @@ export const NEW_QUOTER_DEPLOY_BLOCK: { [chainId in ChainId]: number } = { [ChainId.BLAST]: 2370179, [ChainId.ZKSYNC]: 35982078, [ChainId.WORLDCHAIN]: -1, - [ChainId.ASTROCHAIN_SEPOLIA]: -1, + [ChainId.UNICHAIN_SEPOLIA]: -1, + [ChainId.UNICHAIN]: -1, } // 0 threshold means it's not deployed yet @@ -759,7 +829,8 @@ export const LIKELY_OUT_OF_GAS_THRESHOLD: { [chainId in ChainId]: number } = { [ChainId.BLAST]: 17540 * 2, // 17540 is the single tick.cross cost on blast. We multiply by 2 to be safe, [ChainId.ZKSYNC]: 17540 * 2, // 17540 is the single tick.cross cost on zkSync. We multiply by 2 to be safe [ChainId.WORLDCHAIN]: 0, - [ChainId.ASTROCHAIN_SEPOLIA]: 0, + [ChainId.UNICHAIN_SEPOLIA]: 0, + [ChainId.UNICHAIN]: 0, } // TODO: Move this new addresses to SOR diff --git a/lib/util/tenderlyNewEndpointRolloutPercent.ts b/lib/util/tenderlyNewEndpointRolloutPercent.ts index fbf8bddd0f..705794a643 100644 --- a/lib/util/tenderlyNewEndpointRolloutPercent.ts +++ b/lib/util/tenderlyNewEndpointRolloutPercent.ts @@ -26,5 +26,6 @@ export const TENDERLY_NEW_ENDPOINT_ROLLOUT_PERCENT: { [chain in ChainId]: number [ChainId.BLAST]: 0, [ChainId.ZKSYNC]: 0, [ChainId.WORLDCHAIN]: 0, - [ChainId.ASTROCHAIN_SEPOLIA]: 0, + [ChainId.UNICHAIN]: 0, + [ChainId.UNICHAIN_SEPOLIA]: 0, } diff --git a/lib/util/testNets.ts b/lib/util/testNets.ts index e7df5148a3..21348aa869 100644 --- a/lib/util/testNets.ts +++ b/lib/util/testNets.ts @@ -11,5 +11,5 @@ export const TESTNETS = [ ChainId.OPTIMISM_GOERLI, ChainId.ARBITRUM_SEPOLIA, ChainId.ARBITRUM_GOERLI, - ChainId.ASTROCHAIN_SEPOLIA, + ChainId.UNICHAIN_SEPOLIA, ] diff --git a/package-lock.json b/package-lock.json index 9585cbad3c..5d1823d5cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,15 +27,15 @@ "@types/stats-lite": "^2.2.0", "@uniswap/default-token-list": "^11.13.0", "@uniswap/permit2-sdk": "^1.3.0", - "@uniswap/router-sdk": "^1.14.0", - "@uniswap/sdk-core": "^5.9.0", - "@uniswap/smart-order-router": "4.8.1", + "@uniswap/router-sdk": "^1.15.0", + "@uniswap/sdk-core": "^6.0.0", + "@uniswap/smart-order-router": "file:/tmp/uniswap-smart-order-router-4.8.2.tgz", "@uniswap/token-lists": "^1.0.0-beta.33", - "@uniswap/universal-router-sdk": "^4.6.1", - "@uniswap/v2-sdk": "^4.6.1", + "@uniswap/universal-router-sdk": "file:/tmp/ur-sdk-001.tgz", + "@uniswap/v2-sdk": "^4.7.0", "@uniswap/v3-periphery": "^1.4.4", - "@uniswap/v3-sdk": "^3.17.1", - "@uniswap/v4-sdk": "^1.11.2", + "@uniswap/v3-sdk": "^3.19.0", + "@uniswap/v4-sdk": "^1.12.0", "async-retry": "^1.3.1", "aws-cdk-lib": "^2.137.0", "aws-embedded-metrics": "^2.0.6", @@ -3230,9 +3230,9 @@ } }, "node_modules/@openzeppelin/contracts": { - "version": "3.4.1-solc-0.7-2", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-3.4.1-solc-0.7-2.tgz", - "integrity": "sha512-tAG9LWg8+M2CMu7hIsqHPaTyG4uDzjr6mhvH96LvOpLZZj6tgzTluBt+LsCf1/QaYrlis6pITvpIaIhE+iZB+Q==" + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.7.0.tgz", + "integrity": "sha512-52Qb+A1DdOss8QvJrijYYPSf32GUg2pGaG/yCxtaA3cu4jduouTdg4XZSMLW9op54m1jH7J8hoajhHKOPsoJFw==" }, "node_modules/@pinata/sdk": { "version": "1.1.26", @@ -4476,22 +4476,22 @@ } }, "node_modules/@uniswap/router-sdk": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/@uniswap/router-sdk/-/router-sdk-1.14.2.tgz", - "integrity": "sha512-RvTAsKANG5iLDMk9O/F05wZOMTg8qPw5BBCTkpQYM4o6Mz92wziaD5r52O6KzzOXvZizC/7YJ5BAAcr25slSQw==", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@uniswap/router-sdk/-/router-sdk-1.15.0.tgz", + "integrity": "sha512-KYzpxHX07O2hon9qMudzmtu/+epmnTzva1ZngdJ29CmRXT7C56yz8vSeLXWVvVEp5/m7TcDxbBS5wkY+WHuLDA==", "dependencies": { "@ethersproject/abi": "^5.5.0", - "@uniswap/sdk-core": "^5.8.0", + "@uniswap/sdk-core": "^6.0.0", "@uniswap/swap-router-contracts": "^1.3.0", - "@uniswap/v2-sdk": "^4.6.0", - "@uniswap/v3-sdk": "^3.17.0", - "@uniswap/v4-sdk": "^1.9.0" + "@uniswap/v2-sdk": "^4.7.0", + "@uniswap/v3-sdk": "^3.19.0", + "@uniswap/v4-sdk": "^1.12.0" } }, "node_modules/@uniswap/sdk-core": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/@uniswap/sdk-core/-/sdk-core-5.9.0.tgz", - "integrity": "sha512-OME7WR6+5QwQs45A2079r+/FS0zU944+JCQwUX9GyIriCxqw2pGu4F9IEqmlwD+zSIMml0+MJnJJ47pFgSyWDw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@uniswap/sdk-core/-/sdk-core-6.0.0.tgz", + "integrity": "sha512-6rwBG/Ut7rL2Dw4xtTF1dHSmtctT3h57q4vXIneLYjlePa1PT0mgp5D7cu/6xKEvO1MFtnMchImpWsclfafdUg==", "dependencies": { "@ethersproject/address": "^5.0.2", "@ethersproject/bytes": "^5.7.0", @@ -4509,22 +4509,23 @@ }, "node_modules/@uniswap/smart-order-router": { "version": "4.8.1", - "resolved": "https://registry.npmjs.org/@uniswap/smart-order-router/-/smart-order-router-4.8.1.tgz", - "integrity": "sha512-AeKoX3iAG7oSkXKiyaODwMw6lpEUNncY+TJJJaJwaw+8K6VTVNQ4dIfK8Bzlm5VzMwSRag8jXkIaKSUlhSGKog==", + "resolved": "file:../../../../../tmp/uniswap-smart-order-router-4.8.2.tgz", + "integrity": "sha512-1fXFU0MS8/NYVEYMV8NdKyLw58wT68VhJLvizz9/RNb9gu0jzfpJuTvR3LQcFs0MpcfAoCWwHg9bzZF37ioDUQ==", + "license": "GPL", "dependencies": { "@eth-optimism/sdk": "^3.2.2", "@types/brotli": "^1.3.4", "@uniswap/default-token-list": "^11.13.0", "@uniswap/permit2-sdk": "^1.3.0", - "@uniswap/router-sdk": "^1.14.0", - "@uniswap/sdk-core": "^5.9.0", + "@uniswap/router-sdk": "^1.15.0", + "@uniswap/sdk-core": "^6.0.0", "@uniswap/swap-router-contracts": "^1.3.1", "@uniswap/token-lists": "^1.0.0-beta.31", "@uniswap/universal-router": "^1.6.0", - "@uniswap/universal-router-sdk": "^4.6.1", - "@uniswap/v2-sdk": "^4.6.1", - "@uniswap/v3-sdk": "^3.17.1", - "@uniswap/v4-sdk": "^1.10.0", + "@uniswap/universal-router-sdk": "file:/tmp/ur-sdk-001.tgz", + "@uniswap/v2-sdk": "^4.7.0", + "@uniswap/v3-sdk": "^3.19.0", + "@uniswap/v4-sdk": "^1.12.0", "async-retry": "^1.3.1", "await-timeout": "^1.1.1", "axios": "^0.21.1", @@ -4605,20 +4606,20 @@ } }, "node_modules/@uniswap/universal-router-sdk": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@uniswap/universal-router-sdk/-/universal-router-sdk-4.6.1.tgz", - "integrity": "sha512-HfPYd8xz3/Sjb8if/wAPFOzj0+m7173PVLy+VzF4HrbBwDreU0amYHwf4zQBjffXmys2QtOdwfu7BfZrUwx0kQ==", + "resolved": "file:../../../../../tmp/ur-sdk-001.tgz", + "integrity": "sha512-YOljjERNiTE3HkK2wSPtm2rO23KXOhbWDs5aqI/LK1wgzSI0yD7cpH8kIgl1ObaNIyQS+HHKvBspH4LxzSME1g==", + "license": "MIT", "dependencies": { "@openzeppelin/contracts": "4.7.0", "@uniswap/permit2-sdk": "^1.3.0", - "@uniswap/router-sdk": "^1.14.2", - "@uniswap/sdk-core": "^5.8.2", + "@uniswap/router-sdk": "^1.15.0", + "@uniswap/sdk-core": "^6.0.0", "@uniswap/universal-router": "2.0.0-beta.2", "@uniswap/v2-core": "^1.0.1", - "@uniswap/v2-sdk": "^4.6.0", + "@uniswap/v2-sdk": "^4.7.0", "@uniswap/v3-core": "1.0.0", - "@uniswap/v3-sdk": "^3.18.1", - "@uniswap/v4-sdk": "^1.10.0", + "@uniswap/v3-sdk": "^3.19.0", + "@uniswap/v4-sdk": "^1.12.0", "bignumber.js": "^9.0.2", "ethers": "^5.7.0" }, @@ -4626,11 +4627,6 @@ "node": ">=14" } }, - "node_modules/@uniswap/universal-router-sdk/node_modules/@openzeppelin/contracts": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.7.0.tgz", - "integrity": "sha512-52Qb+A1DdOss8QvJrijYYPSf32GUg2pGaG/yCxtaA3cu4jduouTdg4XZSMLW9op54m1jH7J8hoajhHKOPsoJFw==" - }, "node_modules/@uniswap/universal-router-sdk/node_modules/@uniswap/universal-router": { "version": "2.0.0-beta.2", "resolved": "https://registry.npmjs.org/@uniswap/universal-router/-/universal-router-2.0.0-beta.2.tgz", @@ -4649,11 +4645,6 @@ "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-5.0.2.tgz", "integrity": "sha512-ytPc6eLGcHHnapAZ9S+5qsdomhjo6QBHTDRRBFfTxXIpsicMhVPouPgmUPebZZZGX7vt9USA+Z+0M0dSVtSUEA==" }, - "node_modules/@uniswap/universal-router/node_modules/@openzeppelin/contracts": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.7.0.tgz", - "integrity": "sha512-52Qb+A1DdOss8QvJrijYYPSf32GUg2pGaG/yCxtaA3cu4jduouTdg4XZSMLW9op54m1jH7J8hoajhHKOPsoJFw==" - }, "node_modules/@uniswap/v2-core": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@uniswap/v2-core/-/v2-core-1.0.1.tgz", @@ -4663,13 +4654,13 @@ } }, "node_modules/@uniswap/v2-sdk": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@uniswap/v2-sdk/-/v2-sdk-4.6.1.tgz", - "integrity": "sha512-oTJGBPecrNSPMEp4ujDYzyWPNgZ/kS1VR6MGotnjjGsvQ1btm55AO1OR2KoX85bEs7uUSDyQ/r/0p22+g2fgJA==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@uniswap/v2-sdk/-/v2-sdk-4.7.0.tgz", + "integrity": "sha512-CShitWRbydaigNF5GfNNCgGH9GXKMI/HD6ThI4T7FoSZkf2pgTXlX1fQ829xbl1ohKO61n4NjZs/HzGKIV5yjQ==", "dependencies": { "@ethersproject/address": "^5.0.2", "@ethersproject/solidity": "^5.0.9", - "@uniswap/sdk-core": "^5.8.1", + "@uniswap/sdk-core": "^6.0.0", "tiny-invariant": "^1.1.0", "tiny-warning": "^1.0.3" }, @@ -4706,13 +4697,13 @@ "integrity": "sha512-W6QmqgkADuFcTLzHL8vVoNBtkwjvQRpYIAom7KiUNoLKghyx3FgH0GBjt8NRvigV1ZmMOBllvE1By1C+bi8WpA==" }, "node_modules/@uniswap/v3-sdk": { - "version": "3.18.1", - "resolved": "https://registry.npmjs.org/@uniswap/v3-sdk/-/v3-sdk-3.18.1.tgz", - "integrity": "sha512-TGrKLToSWwfx6VV2d7fh4kwQMlgspXTLE49ep5zfYODVVqV6WhrRdbteHb3e0bjdjxGSj0gzoLmhsjmoJTE1/g==", + "version": "3.19.0", + "resolved": "https://registry.npmjs.org/@uniswap/v3-sdk/-/v3-sdk-3.19.0.tgz", + "integrity": "sha512-HbX3YjHJRXI2LFCxLUWgPfRZX6N9a+cELJ3Dus5vYDPYYjFOwJr16c2esDsdHUe3TG2oOeA/u2wv9TDT2GSBIw==", "dependencies": { "@ethersproject/abi": "^5.5.0", "@ethersproject/solidity": "^5.0.9", - "@uniswap/sdk-core": "^5.8.1", + "@uniswap/sdk-core": "^6.0.0", "@uniswap/swap-router-contracts": "^1.3.0", "@uniswap/v3-periphery": "^1.1.1", "@uniswap/v3-staker": "1.0.0", @@ -4737,14 +4728,19 @@ "node": ">=10" } }, + "node_modules/@uniswap/v3-staker/node_modules/@openzeppelin/contracts": { + "version": "3.4.1-solc-0.7-2", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-3.4.1-solc-0.7-2.tgz", + "integrity": "sha512-tAG9LWg8+M2CMu7hIsqHPaTyG4uDzjr6mhvH96LvOpLZZj6tgzTluBt+LsCf1/QaYrlis6pITvpIaIhE+iZB+Q==" + }, "node_modules/@uniswap/v4-sdk": { - "version": "1.11.2", - "resolved": "https://registry.npmjs.org/@uniswap/v4-sdk/-/v4-sdk-1.11.2.tgz", - "integrity": "sha512-vrAHv13J7LdAsqBkYEkaChc9D3tY9vsEd0YbUwLraC6AUCYGxb2sCEyg+tse5RDicDd0aqiEwyq8OHnCI1R3aQ==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@uniswap/v4-sdk/-/v4-sdk-1.12.0.tgz", + "integrity": "sha512-a1SpbjEYf55alEpmbM2G3frKEDkVBhz5arifxjGQS0FXr4sOC+baZuSYqu0JA5FTGjGV7V5MVQdivwX0+KyQnA==", "dependencies": { "@ethersproject/solidity": "^5.0.9", - "@uniswap/sdk-core": "^5.3.1", - "@uniswap/v3-sdk": "3.12.0", + "@uniswap/sdk-core": "^6.0.0", + "@uniswap/v3-sdk": "3.19.0", "tiny-invariant": "^1.1.0", "tiny-warning": "^1.0.3" }, @@ -4752,24 +4748,6 @@ "node": ">=14" } }, - "node_modules/@uniswap/v4-sdk/node_modules/@uniswap/v3-sdk": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/@uniswap/v3-sdk/-/v3-sdk-3.12.0.tgz", - "integrity": "sha512-mUCg9HLKl20h6W8+QtELqN/uaO47/KDSf+EOht+W3C6jt2eGuzSANqS2CY7i8MsAsnZ+MjPhmN+JTOIvf7azfA==", - "dependencies": { - "@ethersproject/abi": "^5.5.0", - "@ethersproject/solidity": "^5.0.9", - "@uniswap/sdk-core": "^5.0.0", - "@uniswap/swap-router-contracts": "^1.3.0", - "@uniswap/v3-periphery": "^1.1.1", - "@uniswap/v3-staker": "1.0.0", - "tiny-invariant": "^1.1.0", - "tiny-warning": "^1.0.3" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@yarnpkg/lockfile": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", @@ -26932,9 +26910,9 @@ } }, "@openzeppelin/contracts": { - "version": "3.4.1-solc-0.7-2", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-3.4.1-solc-0.7-2.tgz", - "integrity": "sha512-tAG9LWg8+M2CMu7hIsqHPaTyG4uDzjr6mhvH96LvOpLZZj6tgzTluBt+LsCf1/QaYrlis6pITvpIaIhE+iZB+Q==" + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.7.0.tgz", + "integrity": "sha512-52Qb+A1DdOss8QvJrijYYPSf32GUg2pGaG/yCxtaA3cu4jduouTdg4XZSMLW9op54m1jH7J8hoajhHKOPsoJFw==" }, "@pinata/sdk": { "version": "1.1.26", @@ -27930,22 +27908,22 @@ } }, "@uniswap/router-sdk": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/@uniswap/router-sdk/-/router-sdk-1.14.2.tgz", - "integrity": "sha512-RvTAsKANG5iLDMk9O/F05wZOMTg8qPw5BBCTkpQYM4o6Mz92wziaD5r52O6KzzOXvZizC/7YJ5BAAcr25slSQw==", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@uniswap/router-sdk/-/router-sdk-1.15.0.tgz", + "integrity": "sha512-KYzpxHX07O2hon9qMudzmtu/+epmnTzva1ZngdJ29CmRXT7C56yz8vSeLXWVvVEp5/m7TcDxbBS5wkY+WHuLDA==", "requires": { "@ethersproject/abi": "^5.5.0", - "@uniswap/sdk-core": "^5.8.0", + "@uniswap/sdk-core": "^6.0.0", "@uniswap/swap-router-contracts": "^1.3.0", - "@uniswap/v2-sdk": "^4.6.0", - "@uniswap/v3-sdk": "^3.17.0", - "@uniswap/v4-sdk": "^1.9.0" + "@uniswap/v2-sdk": "^4.7.0", + "@uniswap/v3-sdk": "^3.19.0", + "@uniswap/v4-sdk": "^1.12.0" } }, "@uniswap/sdk-core": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/@uniswap/sdk-core/-/sdk-core-5.9.0.tgz", - "integrity": "sha512-OME7WR6+5QwQs45A2079r+/FS0zU944+JCQwUX9GyIriCxqw2pGu4F9IEqmlwD+zSIMml0+MJnJJ47pFgSyWDw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@uniswap/sdk-core/-/sdk-core-6.0.0.tgz", + "integrity": "sha512-6rwBG/Ut7rL2Dw4xtTF1dHSmtctT3h57q4vXIneLYjlePa1PT0mgp5D7cu/6xKEvO1MFtnMchImpWsclfafdUg==", "requires": { "@ethersproject/address": "^5.0.2", "@ethersproject/bytes": "^5.7.0", @@ -27959,23 +27937,22 @@ } }, "@uniswap/smart-order-router": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/@uniswap/smart-order-router/-/smart-order-router-4.8.1.tgz", - "integrity": "sha512-AeKoX3iAG7oSkXKiyaODwMw6lpEUNncY+TJJJaJwaw+8K6VTVNQ4dIfK8Bzlm5VzMwSRag8jXkIaKSUlhSGKog==", + "version": "file:/tmp/uniswap-smart-order-router-4.8.2.tgz", + "integrity": "sha512-1fXFU0MS8/NYVEYMV8NdKyLw58wT68VhJLvizz9/RNb9gu0jzfpJuTvR3LQcFs0MpcfAoCWwHg9bzZF37ioDUQ==", "requires": { "@eth-optimism/sdk": "^3.2.2", "@types/brotli": "^1.3.4", "@uniswap/default-token-list": "^11.13.0", "@uniswap/permit2-sdk": "^1.3.0", - "@uniswap/router-sdk": "^1.14.0", - "@uniswap/sdk-core": "^5.9.0", + "@uniswap/router-sdk": "^1.15.0", + "@uniswap/sdk-core": "^6.0.0", "@uniswap/swap-router-contracts": "^1.3.1", "@uniswap/token-lists": "^1.0.0-beta.31", "@uniswap/universal-router": "^1.6.0", - "@uniswap/universal-router-sdk": "^4.6.1", - "@uniswap/v2-sdk": "^4.6.1", - "@uniswap/v3-sdk": "^3.17.1", - "@uniswap/v4-sdk": "^1.10.0", + "@uniswap/universal-router-sdk": "file:../../../../../../../../tmp/ur-sdk-001.tgz", + "@uniswap/v2-sdk": "^4.7.0", + "@uniswap/v3-sdk": "^3.19.0", + "@uniswap/v4-sdk": "^1.12.0", "async-retry": "^1.3.1", "await-timeout": "^1.1.1", "axios": "^0.21.1", @@ -28036,39 +28013,26 @@ "@openzeppelin/contracts": "4.7.0", "@uniswap/v2-core": "1.0.1", "@uniswap/v3-core": "1.0.0" - }, - "dependencies": { - "@openzeppelin/contracts": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.7.0.tgz", - "integrity": "sha512-52Qb+A1DdOss8QvJrijYYPSf32GUg2pGaG/yCxtaA3cu4jduouTdg4XZSMLW9op54m1jH7J8hoajhHKOPsoJFw==" - } } }, "@uniswap/universal-router-sdk": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@uniswap/universal-router-sdk/-/universal-router-sdk-4.6.1.tgz", - "integrity": "sha512-HfPYd8xz3/Sjb8if/wAPFOzj0+m7173PVLy+VzF4HrbBwDreU0amYHwf4zQBjffXmys2QtOdwfu7BfZrUwx0kQ==", + "version": "file:/tmp/ur-sdk-001.tgz", + "integrity": "sha512-YOljjERNiTE3HkK2wSPtm2rO23KXOhbWDs5aqI/LK1wgzSI0yD7cpH8kIgl1ObaNIyQS+HHKvBspH4LxzSME1g==", "requires": { "@openzeppelin/contracts": "4.7.0", "@uniswap/permit2-sdk": "^1.3.0", - "@uniswap/router-sdk": "^1.14.2", - "@uniswap/sdk-core": "^5.8.2", + "@uniswap/router-sdk": "^1.15.0", + "@uniswap/sdk-core": "^6.0.0", "@uniswap/universal-router": "2.0.0-beta.2", "@uniswap/v2-core": "^1.0.1", - "@uniswap/v2-sdk": "^4.6.0", + "@uniswap/v2-sdk": "^4.7.0", "@uniswap/v3-core": "1.0.0", - "@uniswap/v3-sdk": "^3.18.1", - "@uniswap/v4-sdk": "^1.10.0", + "@uniswap/v3-sdk": "^3.19.0", + "@uniswap/v4-sdk": "^1.12.0", "bignumber.js": "^9.0.2", "ethers": "^5.7.0" }, "dependencies": { - "@openzeppelin/contracts": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.7.0.tgz", - "integrity": "sha512-52Qb+A1DdOss8QvJrijYYPSf32GUg2pGaG/yCxtaA3cu4jduouTdg4XZSMLW9op54m1jH7J8hoajhHKOPsoJFw==" - }, "@uniswap/universal-router": { "version": "2.0.0-beta.2", "resolved": "https://registry.npmjs.org/@uniswap/universal-router/-/universal-router-2.0.0-beta.2.tgz", @@ -28094,13 +28058,13 @@ "integrity": "sha512-MtybtkUPSyysqLY2U210NBDeCHX+ltHt3oADGdjqoThZaFRDKwM6k1Nb3F0A3hk5hwuQvytFWhrWHOEq6nVJ8Q==" }, "@uniswap/v2-sdk": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@uniswap/v2-sdk/-/v2-sdk-4.6.1.tgz", - "integrity": "sha512-oTJGBPecrNSPMEp4ujDYzyWPNgZ/kS1VR6MGotnjjGsvQ1btm55AO1OR2KoX85bEs7uUSDyQ/r/0p22+g2fgJA==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@uniswap/v2-sdk/-/v2-sdk-4.7.0.tgz", + "integrity": "sha512-CShitWRbydaigNF5GfNNCgGH9GXKMI/HD6ThI4T7FoSZkf2pgTXlX1fQ829xbl1ohKO61n4NjZs/HzGKIV5yjQ==", "requires": { "@ethersproject/address": "^5.0.2", "@ethersproject/solidity": "^5.0.9", - "@uniswap/sdk-core": "^5.8.1", + "@uniswap/sdk-core": "^6.0.0", "tiny-invariant": "^1.1.0", "tiny-warning": "^1.0.3" } @@ -28130,13 +28094,13 @@ } }, "@uniswap/v3-sdk": { - "version": "3.18.1", - "resolved": "https://registry.npmjs.org/@uniswap/v3-sdk/-/v3-sdk-3.18.1.tgz", - "integrity": "sha512-TGrKLToSWwfx6VV2d7fh4kwQMlgspXTLE49ep5zfYODVVqV6WhrRdbteHb3e0bjdjxGSj0gzoLmhsjmoJTE1/g==", + "version": "3.19.0", + "resolved": "https://registry.npmjs.org/@uniswap/v3-sdk/-/v3-sdk-3.19.0.tgz", + "integrity": "sha512-HbX3YjHJRXI2LFCxLUWgPfRZX6N9a+cELJ3Dus5vYDPYYjFOwJr16c2esDsdHUe3TG2oOeA/u2wv9TDT2GSBIw==", "requires": { "@ethersproject/abi": "^5.5.0", "@ethersproject/solidity": "^5.0.9", - "@uniswap/sdk-core": "^5.8.1", + "@uniswap/sdk-core": "^6.0.0", "@uniswap/swap-router-contracts": "^1.3.0", "@uniswap/v3-periphery": "^1.1.1", "@uniswap/v3-staker": "1.0.0", @@ -28152,35 +28116,25 @@ "@openzeppelin/contracts": "3.4.1-solc-0.7-2", "@uniswap/v3-core": "1.0.0", "@uniswap/v3-periphery": "^1.0.1" + }, + "dependencies": { + "@openzeppelin/contracts": { + "version": "3.4.1-solc-0.7-2", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-3.4.1-solc-0.7-2.tgz", + "integrity": "sha512-tAG9LWg8+M2CMu7hIsqHPaTyG4uDzjr6mhvH96LvOpLZZj6tgzTluBt+LsCf1/QaYrlis6pITvpIaIhE+iZB+Q==" + } } }, "@uniswap/v4-sdk": { - "version": "1.11.2", - "resolved": "https://registry.npmjs.org/@uniswap/v4-sdk/-/v4-sdk-1.11.2.tgz", - "integrity": "sha512-vrAHv13J7LdAsqBkYEkaChc9D3tY9vsEd0YbUwLraC6AUCYGxb2sCEyg+tse5RDicDd0aqiEwyq8OHnCI1R3aQ==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@uniswap/v4-sdk/-/v4-sdk-1.12.0.tgz", + "integrity": "sha512-a1SpbjEYf55alEpmbM2G3frKEDkVBhz5arifxjGQS0FXr4sOC+baZuSYqu0JA5FTGjGV7V5MVQdivwX0+KyQnA==", "requires": { "@ethersproject/solidity": "^5.0.9", - "@uniswap/sdk-core": "^5.3.1", - "@uniswap/v3-sdk": "3.12.0", + "@uniswap/sdk-core": "^6.0.0", + "@uniswap/v3-sdk": "3.19.0", "tiny-invariant": "^1.1.0", "tiny-warning": "^1.0.3" - }, - "dependencies": { - "@uniswap/v3-sdk": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/@uniswap/v3-sdk/-/v3-sdk-3.12.0.tgz", - "integrity": "sha512-mUCg9HLKl20h6W8+QtELqN/uaO47/KDSf+EOht+W3C6jt2eGuzSANqS2CY7i8MsAsnZ+MjPhmN+JTOIvf7azfA==", - "requires": { - "@ethersproject/abi": "^5.5.0", - "@ethersproject/solidity": "^5.0.9", - "@uniswap/sdk-core": "^5.0.0", - "@uniswap/swap-router-contracts": "^1.3.0", - "@uniswap/v3-periphery": "^1.1.1", - "@uniswap/v3-staker": "1.0.0", - "tiny-invariant": "^1.1.0", - "tiny-warning": "^1.0.3" - } - } } }, "@yarnpkg/lockfile": { diff --git a/package.json b/package.json index 1326ebc579..a5f58f56be 100644 --- a/package.json +++ b/package.json @@ -86,15 +86,15 @@ "@types/stats-lite": "^2.2.0", "@uniswap/default-token-list": "^11.13.0", "@uniswap/permit2-sdk": "^1.3.0", - "@uniswap/router-sdk": "^1.14.0", - "@uniswap/sdk-core": "^5.9.0", - "@uniswap/smart-order-router": "4.8.1", + "@uniswap/router-sdk": "^1.15.0", + "@uniswap/sdk-core": "^6.0.0", + "@uniswap/smart-order-router": "file:/tmp/uniswap-smart-order-router-4.8.2.tgz", "@uniswap/token-lists": "^1.0.0-beta.33", - "@uniswap/universal-router-sdk": "^4.6.1", - "@uniswap/v2-sdk": "^4.6.1", + "@uniswap/universal-router-sdk": "file:/tmp/ur-sdk-001.tgz", + "@uniswap/v2-sdk": "^4.7.0", "@uniswap/v3-periphery": "^1.4.4", - "@uniswap/v3-sdk": "^3.17.1", - "@uniswap/v4-sdk": "^1.11.2", + "@uniswap/v3-sdk": "^3.19.0", + "@uniswap/v4-sdk": "^1.12.0", "async-retry": "^1.3.1", "aws-cdk-lib": "^2.137.0", "aws-embedded-metrics": "^2.0.6", diff --git a/test/mocha/e2e/quote.test.ts b/test/mocha/e2e/quote.test.ts index b75df4cae3..63822ddaa2 100644 --- a/test/mocha/e2e/quote.test.ts +++ b/test/mocha/e2e/quote.test.ts @@ -2830,7 +2830,8 @@ describe('quote', function () { [ChainId.BLAST]: () => USDB_BLAST, [ChainId.ZKSYNC]: () => USDC_ON(ChainId.ZKSYNC), [ChainId.WORLDCHAIN]: () => USDC_ON(ChainId.WORLDCHAIN), - [ChainId.ASTROCHAIN_SEPOLIA]: () => USDC_ON(ChainId.ASTROCHAIN_SEPOLIA), + [ChainId.UNICHAIN_SEPOLIA]: () => USDC_ON(ChainId.UNICHAIN_SEPOLIA), + [ChainId.UNICHAIN]: () => USDC_ON(ChainId.UNICHAIN), } const TEST_ERC20_2: { [chainId in ChainId]: () => Token | null } = { @@ -2860,7 +2861,8 @@ describe('quote', function () { [ChainId.BLAST]: () => WNATIVE_ON(ChainId.BLAST), [ChainId.ZKSYNC]: () => WNATIVE_ON(ChainId.ZKSYNC), [ChainId.WORLDCHAIN]: () => WLD_WORLDCHAIN, - [ChainId.ASTROCHAIN_SEPOLIA]: () => WNATIVE_ON(ChainId.ASTROCHAIN_SEPOLIA), + [ChainId.UNICHAIN_SEPOLIA]: () => WNATIVE_ON(ChainId.UNICHAIN_SEPOLIA), + [ChainId.UNICHAIN]: () => WNATIVE_ON(ChainId.UNICHAIN), } // TODO: Find valid pools/tokens on optimistic kovan and polygon mumbai. We skip those tests for now. @@ -2900,7 +2902,7 @@ describe('quote', function () { // Current WETH/USDB pool (https://blastscan.io/address/0xf52b4b69123cbcf07798ae8265642793b2e8990c) has low WETH amount const amount = - chain === ChainId.BLAST || chain === ChainId.WORLDCHAIN || chain === ChainId.ASTROCHAIN_SEPOLIA + chain === ChainId.BLAST || chain === ChainId.WORLDCHAIN || chain === ChainId.UNICHAIN_SEPOLIA ? type === 'exactOut' ? '0.002' : '0.01' @@ -2988,7 +2990,7 @@ describe('quote', function () { // Current WETH/USDB pool (https://blastscan.io/address/0xf52b4b69123cbcf07798ae8265642793b2e8990c) has low WETH amount const amount = - type === 'exactOut' && (chain === ChainId.BLAST || chain === ChainId.ASTROCHAIN_SEPOLIA) ? '0.002' : '1' + type === 'exactOut' && (chain === ChainId.BLAST || chain === ChainId.UNICHAIN_SEPOLIA) ? '0.002' : '1' const quoteReq: QuoteQueryParams = { tokenInAddress: erc1.address, @@ -3034,7 +3036,7 @@ describe('quote', function () { chain === ChainId.BLAST || chain === ChainId.ZORA || chain === ChainId.ZKSYNC || - chain === ChainId.ASTROCHAIN_SEPOLIA + chain === ChainId.UNICHAIN_SEPOLIA ) { // Blast doesn't have DAI or USDC yet // Zora doesn't have DAI @@ -3127,7 +3129,7 @@ describe('quote', function () { // Current WETH/USDB pool (https://blastscan.io/address/0xf52b4b69123cbcf07798ae8265642793b2e8990c) has low WETH amount const amount = - type === 'exactOut' && (chain === ChainId.BLAST || chain === ChainId.ASTROCHAIN_SEPOLIA) ? '0.002' : '1' + type === 'exactOut' && (chain === ChainId.BLAST || chain === ChainId.UNICHAIN_SEPOLIA) ? '0.002' : '1' const quoteReq: QuoteQueryParams = { tokenInAddress: erc1.address, diff --git a/test/utils/tokens.ts b/test/utils/tokens.ts index 36fc7a32b6..c25ec00688 100644 --- a/test/utils/tokens.ts +++ b/test/utils/tokens.ts @@ -15,7 +15,7 @@ import { log, NodeJSCache, USDC_ARBITRUM, - USDC_ASTROCHAIN_SEPOLIA, + USDC_UNICHAIN_SEPOLIA, USDC_AVAX, USDC_BASE, USDC_BASE_GOERLI, @@ -36,6 +36,7 @@ import { USDT_MAINNET, USDT_OPTIMISM, WRAPPED_NATIVE_CURRENCY, + USDC_UNICHAIN, } from '@uniswap/smart-order-router' import { ethers } from 'ethers' import NodeCache from 'node-cache' @@ -142,8 +143,10 @@ export const USDC_ON = (chainId: ChainId): Token => { return USDCE_ZKSYNC case ChainId.WORLDCHAIN: return USDC_WORLDCHAIN - case ChainId.ASTROCHAIN_SEPOLIA: - return USDC_ASTROCHAIN_SEPOLIA + case ChainId.UNICHAIN_SEPOLIA: + return USDC_UNICHAIN_SEPOLIA + case ChainId.UNICHAIN: + return USDC_UNICHAIN default: throw new Error(`Chain id: ${chainId} not supported`) } From e66623e1ae880521950796bc2fa7598eb5e7df0a Mon Sep 17 00:00:00 2001 From: Vasilis Xouris Date: Mon, 25 Nov 2024 09:20:06 -0800 Subject: [PATCH 2/2] upda ura version --- package-lock.json | 27 ++++++++++++++------------- package.json | 4 ++-- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5d1823d5cb..a84e652db0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,9 +29,9 @@ "@uniswap/permit2-sdk": "^1.3.0", "@uniswap/router-sdk": "^1.15.0", "@uniswap/sdk-core": "^6.0.0", - "@uniswap/smart-order-router": "file:/tmp/uniswap-smart-order-router-4.8.2.tgz", + "@uniswap/smart-order-router": "file:/tmp/uniswap-smart-order-router-4.8.3.tgz", "@uniswap/token-lists": "^1.0.0-beta.33", - "@uniswap/universal-router-sdk": "file:/tmp/ur-sdk-001.tgz", + "@uniswap/universal-router-sdk": "^4.7.0", "@uniswap/v2-sdk": "^4.7.0", "@uniswap/v3-periphery": "^1.4.4", "@uniswap/v3-sdk": "^3.19.0", @@ -4509,8 +4509,8 @@ }, "node_modules/@uniswap/smart-order-router": { "version": "4.8.1", - "resolved": "file:../../../../../tmp/uniswap-smart-order-router-4.8.2.tgz", - "integrity": "sha512-1fXFU0MS8/NYVEYMV8NdKyLw58wT68VhJLvizz9/RNb9gu0jzfpJuTvR3LQcFs0MpcfAoCWwHg9bzZF37ioDUQ==", + "resolved": "file:../../../../../tmp/uniswap-smart-order-router-4.8.3.tgz", + "integrity": "sha512-Vx7cUnrgNneooD6kyJ6eCer7NZ1BZL1nHMr7uFmQxd14g3bwB8mTEXN6JRKfUw6OsJBOs5yjlTDcvPGAjALbjw==", "license": "GPL", "dependencies": { "@eth-optimism/sdk": "^3.2.2", @@ -4522,7 +4522,7 @@ "@uniswap/swap-router-contracts": "^1.3.1", "@uniswap/token-lists": "^1.0.0-beta.31", "@uniswap/universal-router": "^1.6.0", - "@uniswap/universal-router-sdk": "file:/tmp/ur-sdk-001.tgz", + "@uniswap/universal-router-sdk": "^4.7.0", "@uniswap/v2-sdk": "^4.7.0", "@uniswap/v3-sdk": "^3.19.0", "@uniswap/v4-sdk": "^1.12.0", @@ -4606,9 +4606,9 @@ } }, "node_modules/@uniswap/universal-router-sdk": { - "resolved": "file:../../../../../tmp/ur-sdk-001.tgz", - "integrity": "sha512-YOljjERNiTE3HkK2wSPtm2rO23KXOhbWDs5aqI/LK1wgzSI0yD7cpH8kIgl1ObaNIyQS+HHKvBspH4LxzSME1g==", - "license": "MIT", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@uniswap/universal-router-sdk/-/universal-router-sdk-4.7.0.tgz", + "integrity": "sha512-auVZVRXUVxpvXcyPo7QWPprGB05KsYFVetM7s/ttlTcNNKwtVronGqdDMFZFIWjf7UM/sHbfSH08mhjogJKwgQ==", "dependencies": { "@openzeppelin/contracts": "4.7.0", "@uniswap/permit2-sdk": "^1.3.0", @@ -27937,8 +27937,8 @@ } }, "@uniswap/smart-order-router": { - "version": "file:/tmp/uniswap-smart-order-router-4.8.2.tgz", - "integrity": "sha512-1fXFU0MS8/NYVEYMV8NdKyLw58wT68VhJLvizz9/RNb9gu0jzfpJuTvR3LQcFs0MpcfAoCWwHg9bzZF37ioDUQ==", + "version": "file:/tmp/uniswap-smart-order-router-4.8.3.tgz", + "integrity": "sha512-Vx7cUnrgNneooD6kyJ6eCer7NZ1BZL1nHMr7uFmQxd14g3bwB8mTEXN6JRKfUw6OsJBOs5yjlTDcvPGAjALbjw==", "requires": { "@eth-optimism/sdk": "^3.2.2", "@types/brotli": "^1.3.4", @@ -27949,7 +27949,7 @@ "@uniswap/swap-router-contracts": "^1.3.1", "@uniswap/token-lists": "^1.0.0-beta.31", "@uniswap/universal-router": "^1.6.0", - "@uniswap/universal-router-sdk": "file:../../../../../../../../tmp/ur-sdk-001.tgz", + "@uniswap/universal-router-sdk": "^4.7.0", "@uniswap/v2-sdk": "^4.7.0", "@uniswap/v3-sdk": "^3.19.0", "@uniswap/v4-sdk": "^1.12.0", @@ -28016,8 +28016,9 @@ } }, "@uniswap/universal-router-sdk": { - "version": "file:/tmp/ur-sdk-001.tgz", - "integrity": "sha512-YOljjERNiTE3HkK2wSPtm2rO23KXOhbWDs5aqI/LK1wgzSI0yD7cpH8kIgl1ObaNIyQS+HHKvBspH4LxzSME1g==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@uniswap/universal-router-sdk/-/universal-router-sdk-4.7.0.tgz", + "integrity": "sha512-auVZVRXUVxpvXcyPo7QWPprGB05KsYFVetM7s/ttlTcNNKwtVronGqdDMFZFIWjf7UM/sHbfSH08mhjogJKwgQ==", "requires": { "@openzeppelin/contracts": "4.7.0", "@uniswap/permit2-sdk": "^1.3.0", diff --git a/package.json b/package.json index a5f58f56be..795df0265f 100644 --- a/package.json +++ b/package.json @@ -88,9 +88,9 @@ "@uniswap/permit2-sdk": "^1.3.0", "@uniswap/router-sdk": "^1.15.0", "@uniswap/sdk-core": "^6.0.0", - "@uniswap/smart-order-router": "file:/tmp/uniswap-smart-order-router-4.8.2.tgz", + "@uniswap/smart-order-router": "file:/tmp/uniswap-smart-order-router-4.8.3.tgz", "@uniswap/token-lists": "^1.0.0-beta.33", - "@uniswap/universal-router-sdk": "file:/tmp/ur-sdk-001.tgz", + "@uniswap/universal-router-sdk": "^4.7.0", "@uniswap/v2-sdk": "^4.7.0", "@uniswap/v3-periphery": "^1.4.4", "@uniswap/v3-sdk": "^3.19.0",