diff --git a/lib/cron/cache-config.ts b/lib/cron/cache-config.ts index e25ec4f277..fb913a506d 100644 --- a/lib/cron/cache-config.ts +++ b/lib/cron/cache-config.ts @@ -1,11 +1,20 @@ import { Protocol } from '@uniswap/router-sdk' -import { V2SubgraphProvider, V3SubgraphProvider } from '@uniswap/smart-order-router' +import { V2SubgraphProvider, V3SubgraphProvider, V4SubgraphProvider } from '@uniswap/smart-order-router' import { ChainId } from '@uniswap/sdk-core' // during local cdk stack update, the env vars are not populated // make sure to fill in the env vars below // process.env.ALCHEMY_QUERY_KEY = '' +export const v4SubgraphUrlOverride = (chainId: ChainId) => { + switch (chainId) { + case ChainId.SEPOLIA: + return `https://subgraph.satsuma-prod.com/${process.env.ALCHEMY_QUERY_KEY}/uniswap/uniswap-v4-sepolia-test/api` + default: + return undefined + } +} + export const v3SubgraphUrlOverride = (chainId: ChainId) => { switch (chainId) { case ChainId.MAINNET: @@ -54,6 +63,10 @@ export const v2SubgraphUrlOverride = (chainId: ChainId) => { } } +// TODO: ROUTE-225 - follow up on v4 subgraph pools filtering threshold +const v4TrackedEthThreshold = 0 // Pools need at least 0 of trackedEth to be selected +const v4UntrackedUsdThreshold = 0 // Pools need at least 0k USD (untracked) to be selected (for metrics only) + export const v3TrackedEthThreshold = 0.01 // Pools need at least 0.01 of trackedEth to be selected const v3UntrackedUsdThreshold = 25000 // Pools need at least 25K USD (untracked) to be selected (for metrics only) @@ -311,4 +324,18 @@ export const chainProtocols = [ v2SubgraphUrlOverride(ChainId.BLAST) ), }, + { + protocol: Protocol.V4, + chainId: ChainId.SEPOLIA, + timeout: 90000, + provider: new V4SubgraphProvider( + ChainId.SEPOLIA, + 3, + 90000, + true, + v4TrackedEthThreshold, + v4UntrackedUsdThreshold, + v4SubgraphUrlOverride(ChainId.SEPOLIA) + ), + }, ] diff --git a/lib/handlers/marshalling/cached-route-marshaller.ts b/lib/handlers/marshalling/cached-route-marshaller.ts index ab4591d49c..2d82a3361c 100644 --- a/lib/handlers/marshalling/cached-route-marshaller.ts +++ b/lib/handlers/marshalling/cached-route-marshaller.ts @@ -1,5 +1,4 @@ -import { CachedRoute } from '@uniswap/smart-order-router' -import { MixedRoute, V2Route, V3Route } from '@uniswap/smart-order-router/build/main/routers' +import { CachedRoute, SupportedRoutes } from '@uniswap/smart-order-router' import { MarshalledRoute, RouteMarshaller } from './route-marshaller' export interface MarshalledCachedRoute { @@ -8,15 +7,15 @@ export interface MarshalledCachedRoute { } export class CachedRouteMarshaller { - public static marshal(cachedRoute: CachedRoute): MarshalledCachedRoute { + public static marshal(cachedRoute: CachedRoute): MarshalledCachedRoute { return { route: RouteMarshaller.marshal(cachedRoute.route), percent: cachedRoute.percent, } } - public static unmarshal(marshalledCachedRoute: MarshalledCachedRoute): CachedRoute { - return new CachedRoute({ + public static unmarshal(marshalledCachedRoute: MarshalledCachedRoute): CachedRoute { + return new CachedRoute({ route: RouteMarshaller.unmarshal(marshalledCachedRoute.route), percent: marshalledCachedRoute.percent, }) diff --git a/lib/handlers/marshalling/index.ts b/lib/handlers/marshalling/index.ts index f93c89e3cf..23295e31a7 100644 --- a/lib/handlers/marshalling/index.ts +++ b/lib/handlers/marshalling/index.ts @@ -2,6 +2,6 @@ export * from './cached-route-marshaller' export * from './cached-routes-marshaller' export * from './currency-amount-marshaller' export * from './pair-marshaller' -export * from './pool-marshaller' +export * from './v3/pool-marshaller' export * from './route-marshaller' export * from './token-marshaller' diff --git a/lib/handlers/marshalling/route-marshaller.ts b/lib/handlers/marshalling/route-marshaller.ts index d9bf9f11ac..6b4a757061 100644 --- a/lib/handlers/marshalling/route-marshaller.ts +++ b/lib/handlers/marshalling/route-marshaller.ts @@ -1,9 +1,13 @@ -import { MixedRoute, V2Route, V3Route } from '@uniswap/smart-order-router/build/main/routers' +import { MixedRoute, V2Route, V3Route, V4Route } from '@uniswap/smart-order-router/build/main/routers' import { Protocol } from '@uniswap/router-sdk' import { MarshalledToken, TokenMarshaller } from './token-marshaller' import { MarshalledPair, PairMarshaller } from './pair-marshaller' -import { MarshalledPool, PoolMarshaller } from './pool-marshaller' -import { Pool } from '@uniswap/v3-sdk' +import { MarshalledPool as V3MarshalledPool, PoolMarshaller as V3PoolMarshaller } from './v3/pool-marshaller' +import { MarshalledPool as V4MarshalledPool, PoolMarshaller as V4PoolMarshaller } from './v4/pool-marshaller' +import { Pool as V3Pool } from '@uniswap/v3-sdk' +import { Pool as V4Pool } from '@uniswap/v4-sdk' +import { SupportedRoutes } from '@uniswap/smart-order-router' +import { Pair } from '@uniswap/v2-sdk' export interface MarshalledV2Route { protocol: Protocol @@ -16,20 +20,27 @@ export interface MarshalledV3Route { protocol: Protocol input: MarshalledToken output: MarshalledToken - pools: MarshalledPool[] + pools: V3MarshalledPool[] +} + +export interface MarshalledV4Route { + protocol: Protocol + input: MarshalledToken + output: MarshalledToken + pools: V4MarshalledPool[] } export interface MarshalledMixedRoute { protocol: Protocol input: MarshalledToken output: MarshalledToken - pools: (MarshalledPool | MarshalledPair)[] + pools: (V4MarshalledPool | V3MarshalledPool | MarshalledPair)[] } export type MarshalledRoute = MarshalledV2Route | MarshalledV3Route | MarshalledMixedRoute export class RouteMarshaller { - public static marshal(route: V3Route | V2Route | MixedRoute): MarshalledRoute { + public static marshal(route: SupportedRoutes): MarshalledRoute { switch (route.protocol) { case Protocol.V2: return { @@ -43,7 +54,18 @@ export class RouteMarshaller { protocol: Protocol.V3, input: TokenMarshaller.marshal(route.input), output: TokenMarshaller.marshal(route.output), - pools: route.pools.map((pool) => PoolMarshaller.marshal(pool)), + pools: route.pools.map((pool) => V3PoolMarshaller.marshal(pool)), + } + case Protocol.V4: + return { + protocol: Protocol.V4, + // TODO: ROUTE-217 - Support native currency routing in V4 + // token.wrapped is wrong for V4 + // Probably need to use the token symbol for native, and still use address for non-native tokens + // Check later CELO token, which is both native and ERC20, which one to use + input: TokenMarshaller.marshal(route.input.wrapped), + output: TokenMarshaller.marshal(route.output.wrapped), + pools: route.pools.map((pool) => V4PoolMarshaller.marshal(pool)), } case Protocol.MIXED: return { @@ -51,17 +73,23 @@ export class RouteMarshaller { input: TokenMarshaller.marshal(route.input), output: TokenMarshaller.marshal(route.output), pools: route.pools.map((tpool) => { - if (tpool instanceof Pool) { - return PoolMarshaller.marshal(tpool) - } else { + if (tpool instanceof V3Pool) { + return V3PoolMarshaller.marshal(tpool) + } else if (tpool instanceof V4Pool) { + return V4PoolMarshaller.marshal(tpool) + } else if (tpool instanceof Pair) { return PairMarshaller.marshal(tpool) + } else { + throw new Error(`Unsupported pool type ${JSON.stringify(tpool)}`) } }), } + default: + throw new Error(`Unsupported protocol ${JSON.stringify(route)}`) } } - public static unmarshal(marshalledRoute: MarshalledRoute): V3Route | V2Route | MixedRoute { + public static unmarshal(marshalledRoute: MarshalledRoute): SupportedRoutes { switch (marshalledRoute.protocol) { case Protocol.V2: const v2Route = marshalledRoute as MarshalledV2Route @@ -73,17 +101,29 @@ export class RouteMarshaller { case Protocol.V3: const v3Route = marshalledRoute as MarshalledV3Route return new V3Route( - v3Route.pools.map((marshalledPool) => PoolMarshaller.unmarshal(marshalledPool)), + v3Route.pools.map((marshalledPool) => V3PoolMarshaller.unmarshal(marshalledPool)), TokenMarshaller.unmarshal(v3Route.input), TokenMarshaller.unmarshal(v3Route.output) ) + case Protocol.V4: + const v4Route = marshalledRoute as MarshalledV4Route + return new V4Route( + v4Route.pools.map((marshalledPool) => V4PoolMarshaller.unmarshal(marshalledPool)), + TokenMarshaller.unmarshal(v4Route.input), + TokenMarshaller.unmarshal(v4Route.output) + ) case Protocol.MIXED: const mixedRoute = marshalledRoute as MarshalledMixedRoute const tpools = mixedRoute.pools.map((tpool) => { - if (tpool.protocol === Protocol.V2) { - return PairMarshaller.unmarshal(tpool as MarshalledPair) - } else { - return PoolMarshaller.unmarshal(tpool as MarshalledPool) + switch (tpool.protocol) { + case Protocol.V2: + return PairMarshaller.unmarshal(tpool as MarshalledPair) + case Protocol.V3: + return V3PoolMarshaller.unmarshal(tpool as V3MarshalledPool) + case Protocol.V4: + return V4PoolMarshaller.unmarshal(tpool as V4MarshalledPool) + default: + throw new Error(`Unsupported protocol ${JSON.stringify(tpool)}`) } }) diff --git a/lib/handlers/marshalling/pool-marshaller.ts b/lib/handlers/marshalling/v3/pool-marshaller.ts similarity index 93% rename from lib/handlers/marshalling/pool-marshaller.ts rename to lib/handlers/marshalling/v3/pool-marshaller.ts index 6b0301e26f..8f810b23cb 100644 --- a/lib/handlers/marshalling/pool-marshaller.ts +++ b/lib/handlers/marshalling/v3/pool-marshaller.ts @@ -1,6 +1,6 @@ import { Pool } from '@uniswap/v3-sdk' import { FeeAmount } from '@uniswap/v3-sdk/dist/constants' -import { MarshalledToken, TokenMarshaller } from './token-marshaller' +import { MarshalledToken, TokenMarshaller } from '../token-marshaller' import { Protocol } from '@uniswap/router-sdk' export interface MarshalledPool { diff --git a/lib/handlers/marshalling/v4/pool-marshaller.ts b/lib/handlers/marshalling/v4/pool-marshaller.ts new file mode 100644 index 0000000000..af8b326d66 --- /dev/null +++ b/lib/handlers/marshalling/v4/pool-marshaller.ts @@ -0,0 +1,47 @@ +import { Pool } from '@uniswap/v4-sdk' +import { FeeAmount } from '@uniswap/v3-sdk/dist/constants' +import { MarshalledToken, TokenMarshaller } from '../token-marshaller' +import { Protocol } from '@uniswap/router-sdk' + +export interface MarshalledPool { + protocol: Protocol + token0: MarshalledToken + token1: MarshalledToken + fee: FeeAmount + tickSpacing: number + hooks: string + sqrtRatioX96: string + liquidity: string + tickCurrent: number +} + +export class PoolMarshaller { + public static marshal(pool: Pool): MarshalledPool { + return { + protocol: Protocol.V4, + // TODO: ROUTE-217 - Support native currency routing in V4 + // V4 we should not just wrap + token0: TokenMarshaller.marshal(pool.token0.wrapped), + token1: TokenMarshaller.marshal(pool.token1.wrapped), + fee: pool.fee, + tickSpacing: pool.tickSpacing, + hooks: pool.hooks, + sqrtRatioX96: pool.sqrtRatioX96.toString(), + liquidity: pool.liquidity.toString(), + tickCurrent: pool.tickCurrent, + } + } + + public static unmarshal(marshalledPool: MarshalledPool): Pool { + return new Pool( + TokenMarshaller.unmarshal(marshalledPool.token0), + TokenMarshaller.unmarshal(marshalledPool.token1), + marshalledPool.fee, + marshalledPool.tickSpacing, + marshalledPool.hooks, + marshalledPool.sqrtRatioX96, + marshalledPool.liquidity, + marshalledPool.tickCurrent + ) + } +} diff --git a/lib/handlers/pools/pool-caching/v3/cache-dynamo-pool.ts b/lib/handlers/pools/pool-caching/v3/cache-dynamo-pool.ts index 0167c7e317..15d991128f 100644 --- a/lib/handlers/pools/pool-caching/v3/cache-dynamo-pool.ts +++ b/lib/handlers/pools/pool-caching/v3/cache-dynamo-pool.ts @@ -1,7 +1,7 @@ import { DynamoCaching, DynamoCachingProps } from '../cache-dynamo' import { Pool } from '@uniswap/v3-sdk' import { log, metric, MetricLoggerUnit } from '@uniswap/smart-order-router' -import { PoolMarshaller } from '../../../marshalling/pool-marshaller' +import { PoolMarshaller } from '../../../marshalling/v3/pool-marshaller' interface DynamoCachingV3PoolProps extends DynamoCachingProps {} diff --git a/lib/handlers/quote/quote.ts b/lib/handlers/quote/quote.ts index 78876b6fae..3333283aee 100644 --- a/lib/handlers/quote/quote.ts +++ b/lib/handlers/quote/quote.ts @@ -12,7 +12,8 @@ import { SwapOptions, SwapRoute, } from '@uniswap/smart-order-router' -import { Pool } from '@uniswap/v3-sdk' +import { Pool as V3Pool } from '@uniswap/v3-sdk' +import { Pool as V4Pool } from '@uniswap/v4-sdk' import JSBI from 'jsbi' import _ from 'lodash' import { APIGLambdaHandler, ErrorResponse, HandleRequestParams, Response } from '../handler' @@ -35,6 +36,7 @@ import { SwapOptionsFactory } from './SwapOptionsFactory' import { GlobalRpcProviders } from '../../rpc/GlobalRpcProviders' import { adhocCorrectGasUsed } from '../../util/estimateGasUsed' import { adhocCorrectGasUsedUSD } from '../../util/estimateGasUsedUSD' +import { Pair } from '@uniswap/v2-sdk' export class QuoteHandler extends APIGLambdaHandler< ContainerInjected, @@ -502,20 +504,23 @@ export class QuoteHandler extends APIGLambdaHandler< edgeAmountOut = type == 'exactIn' ? quote.quotient.toString() : amount.quotient.toString() } - if (nextPool instanceof Pool) { + if (nextPool instanceof V4Pool) { + // TODO - ROUTE-220: Support V4 Pool + throw new Error(`V4 pools are not supported in quote response deserialization ${JSON.stringify(nextPool)}`) + } else if (nextPool instanceof V3Pool) { curRoute.push({ type: 'v3-pool', address: v3PoolProvider.getPoolAddress(nextPool.token0, nextPool.token1, nextPool.fee).poolAddress, tokenIn: { chainId: tokenIn.chainId, decimals: tokenIn.decimals.toString(), - address: tokenIn.address, + address: tokenIn.wrapped.address, symbol: tokenIn.symbol!, }, tokenOut: { chainId: tokenOut.chainId, decimals: tokenOut.decimals.toString(), - address: tokenOut.address, + address: tokenOut.wrapped.address, symbol: tokenOut.symbol!, }, fee: nextPool.fee.toString(), @@ -525,7 +530,7 @@ export class QuoteHandler extends APIGLambdaHandler< amountIn: edgeAmountIn, amountOut: edgeAmountOut, }) - } else { + } else if (nextPool instanceof Pair) { const reserve0 = nextPool.reserve0 const reserve1 = nextPool.reserve1 @@ -535,7 +540,7 @@ export class QuoteHandler extends APIGLambdaHandler< tokenIn: { chainId: tokenIn.chainId, decimals: tokenIn.decimals.toString(), - address: tokenIn.address, + address: tokenIn.wrapped.address, symbol: tokenIn.symbol!, buyFeeBps: this.deriveBuyFeeBps(tokenIn, reserve0, reserve1, enableFeeOnTransferFeeFetching), sellFeeBps: this.deriveSellFeeBps(tokenIn, reserve0, reserve1, enableFeeOnTransferFeeFetching), @@ -543,7 +548,7 @@ export class QuoteHandler extends APIGLambdaHandler< tokenOut: { chainId: tokenOut.chainId, decimals: tokenOut.decimals.toString(), - address: tokenOut.address, + address: tokenOut.wrapped.address, symbol: tokenOut.symbol!, buyFeeBps: this.deriveBuyFeeBps(tokenOut, reserve0, reserve1, enableFeeOnTransferFeeFetching), sellFeeBps: this.deriveSellFeeBps(tokenOut, reserve0, reserve1, enableFeeOnTransferFeeFetching), @@ -593,6 +598,8 @@ export class QuoteHandler extends APIGLambdaHandler< amountIn: edgeAmountIn, amountOut: edgeAmountOut, }) + } else { + throw new Error(`Unsupported pool type ${JSON.stringify(nextPool)}`) } } diff --git a/lib/handlers/router-entities/route-caching/dynamo-route-caching-provider.ts b/lib/handlers/router-entities/route-caching/dynamo-route-caching-provider.ts index ec0ac4adfd..d835152cca 100644 --- a/lib/handlers/router-entities/route-caching/dynamo-route-caching-provider.ts +++ b/lib/handlers/router-entities/route-caching/dynamo-route-caching-provider.ts @@ -8,13 +8,13 @@ import { metric, MetricLoggerUnit, routeToString, + SupportedRoutes, } from '@uniswap/smart-order-router' import { AWSError, DynamoDB, Lambda } from 'aws-sdk' import { ChainId, Currency, CurrencyAmount, Fraction, Token, TradeType } from '@uniswap/sdk-core' import { Protocol } from '@uniswap/router-sdk' import { PairTradeTypeChainId } from './model/pair-trade-type-chain-id' import { CachedRoutesMarshaller } from '../../marshalling/cached-routes-marshaller' -import { MixedRoute, V2Route, V3Route } from '@uniswap/smart-order-router/build/main/routers' import { PromiseResult } from 'aws-sdk/lib/request' interface ConstructorParams { @@ -208,7 +208,7 @@ export class DynamoRouteCachingProvider extends IRouteCachingProvider { return CachedRoutesMarshaller.unmarshal(cachedRoutesJson) }) - const routesMap: Map> = new Map() + const routesMap: Map> = new Map() let blockNumber: number = 0 let originalAmount: string = '' diff --git a/package-lock.json b/package-lock.json index 4358ac9b7e..6e22247386 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,11 +26,11 @@ "@types/stats-lite": "^2.2.0", "@uniswap/default-token-list": "^11.13.0", "@uniswap/permit2-sdk": "^1.3.0", - "@uniswap/router-sdk": "^1.9.2", + "@uniswap/router-sdk": "^1.10.0", "@uniswap/sdk-core": "^5.3.0", - "@uniswap/smart-order-router": "3.39.0", + "@uniswap/smart-order-router": "3.40.0", "@uniswap/token-lists": "^1.0.0-beta.33", - "@uniswap/universal-router-sdk": "^2.2.0", + "@uniswap/universal-router-sdk": "^2.2.4", "@uniswap/v2-sdk": "^4.3.2", "@uniswap/v3-periphery": "^1.4.4", "@uniswap/v3-sdk": "^3.13.0", @@ -4717,21 +4717,22 @@ } }, "node_modules/@uniswap/router-sdk": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@uniswap/router-sdk/-/router-sdk-1.9.2.tgz", - "integrity": "sha512-J63Of3HRpV0s3ZtEnhGlyvbBuZFfjK7NtnMwflzFMKzfdm+75APHYqnvHAnVARKuL/hMYHF4hni0o84bHem2Ng==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@uniswap/router-sdk/-/router-sdk-1.10.0.tgz", + "integrity": "sha512-XKDc46DDVqFOGwDqUFe6QkQMUue3FNsycxwKrbtBXbfw8eDpWrXIi7XpYF+5C/RI8TeRDpRvzorToJTw4DvaIA==", "dependencies": { "@ethersproject/abi": "^5.5.0", - "@uniswap/sdk-core": "^5.0.0", + "@uniswap/sdk-core": "^5.3.1", "@uniswap/swap-router-contracts": "^1.3.0", "@uniswap/v2-sdk": "^4.3.2", - "@uniswap/v3-sdk": "^3.11.2" + "@uniswap/v3-sdk": "^3.11.2", + "@uniswap/v4-sdk": "^1.0.0" } }, "node_modules/@uniswap/sdk-core": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@uniswap/sdk-core/-/sdk-core-5.3.0.tgz", - "integrity": "sha512-wbMzSY3wbByOkoirZXyeomof4a7goueT4bOa4YqoXDWqIftqrT70UuCgjk98nIBu3UqPxRNMptXusppxZVvwWA==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@uniswap/sdk-core/-/sdk-core-5.3.1.tgz", + "integrity": "sha512-XLJY8PcMZnKYBGLABJnLXcr3EgWql3mmnmpHyV1/MmEh9pLJLHYz4HLwVHb8pGDCqpOFX0e+Ei44/qhC7Q5Dsg==", "dependencies": { "@ethersproject/address": "^5.0.2", "@ethersproject/bytes": "^5.7.0", @@ -4748,22 +4749,23 @@ } }, "node_modules/@uniswap/smart-order-router": { - "version": "3.39.0", - "resolved": "https://registry.npmjs.org/@uniswap/smart-order-router/-/smart-order-router-3.39.0.tgz", - "integrity": "sha512-6PHMeJvXp7lpJvX4rE66ofHIJa/OB0s+TSQ802qu7cljj7E0SRDG/QAi3WBXIX3QlTyn1pp4Yvkqk7crtMRkgw==", + "version": "3.40.0", + "resolved": "https://registry.npmjs.org/@uniswap/smart-order-router/-/smart-order-router-3.40.0.tgz", + "integrity": "sha512-+Ffua7+neXz2w5Gyd8PKRB9NebEu+sZVQ9nxlaizsQuXo3KWU0yx79YiBubTqqrilI7foobtYYqTH+YAWyW+Dg==", "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.9.2", + "@uniswap/router-sdk": "^1.10.0", "@uniswap/sdk-core": "^5.3.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": "^2.2.0", + "@uniswap/universal-router-sdk": "^2.2.4", "@uniswap/v2-sdk": "^4.3.2", "@uniswap/v3-sdk": "^3.13.0", + "@uniswap/v4-sdk": "^1.0.0", "async-retry": "^1.3.1", "await-timeout": "^1.1.1", "axios": "^0.21.1", @@ -4844,16 +4846,17 @@ } }, "node_modules/@uniswap/universal-router-sdk": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@uniswap/universal-router-sdk/-/universal-router-sdk-2.2.0.tgz", - "integrity": "sha512-8ys8eVLLMBMuTya9d4LjqBQrlunkdTm9HNgcE6IXG/Ro3Lekxe1e0mak0MaIQEFfrE44JvaJu6M/BenxBYWqaw==", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/@uniswap/universal-router-sdk/-/universal-router-sdk-2.2.4.tgz", + "integrity": "sha512-6+ErgDDtCJLM2ro/krCKtu6ucUpcaQEEPRrAPuJiMTWbR0UyR+6Otp+KdBcT9LmyzSoXuSHhIRr+6s25no1J6A==", "dependencies": { "@uniswap/permit2-sdk": "^1.3.0", - "@uniswap/router-sdk": "^1.9.2", - "@uniswap/sdk-core": "^5.3.0", + "@uniswap/router-sdk": "^1.10.0", + "@uniswap/sdk-core": "^5.3.1", "@uniswap/universal-router": "1.6.0", - "@uniswap/v2-sdk": "^4.3.2", - "@uniswap/v3-sdk": "^3.13.0", + "@uniswap/v2-sdk": "^4.4.1", + "@uniswap/v3-sdk": "^3.13.1", + "@uniswap/v4-sdk": "^1.0.0", "bignumber.js": "^9.0.2", "ethers": "^5.7.0" }, @@ -4875,13 +4878,13 @@ } }, "node_modules/@uniswap/v2-sdk": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@uniswap/v2-sdk/-/v2-sdk-4.3.2.tgz", - "integrity": "sha512-yNxfQZuzmQ2xqiKutzyzzoXuiuwFrHWba6GG9gT8JeJ4NT5sTJOeLY1FEdEMVsJQwXfMc+goG/srNBRZXVRtSA==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@uniswap/v2-sdk/-/v2-sdk-4.4.1.tgz", + "integrity": "sha512-mU0YNgpm7Nmh3RSlcltluYVECdBcfQQIIQIDCM49Rog8ZnW4wp5QqEYkVjgAuqdu1mwLkMDMQUhzhtC0Z2Df6g==", "dependencies": { "@ethersproject/address": "^5.0.2", "@ethersproject/solidity": "^5.0.9", - "@uniswap/sdk-core": "^5.0.0", + "@uniswap/sdk-core": "^5.3.1", "tiny-invariant": "^1.1.0", "tiny-warning": "^1.0.3" }, @@ -4918,13 +4921,13 @@ "integrity": "sha512-W6QmqgkADuFcTLzHL8vVoNBtkwjvQRpYIAom7KiUNoLKghyx3FgH0GBjt8NRvigV1ZmMOBllvE1By1C+bi8WpA==" }, "node_modules/@uniswap/v3-sdk": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@uniswap/v3-sdk/-/v3-sdk-3.13.0.tgz", - "integrity": "sha512-Jz8aEU7RrDK4LfFNLClXFr2hkBE08QANLEBTofmu+ueCCKoNoRd/OTR4q04HhIeMyXtzsSOzi32a5yS7OY9glg==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/@uniswap/v3-sdk/-/v3-sdk-3.13.1.tgz", + "integrity": "sha512-MCc96HrUZy17DINwrGnMtCvr+yXQlWUJJVaIiRRKe1DQzSuv97/G4lzM+zAaSymrxbR2qnHHWL5vMFjmwzCN9Q==", "dependencies": { "@ethersproject/abi": "^5.5.0", "@ethersproject/solidity": "^5.0.9", - "@uniswap/sdk-core": "^5.3.0", + "@uniswap/sdk-core": "^5.3.1", "@uniswap/swap-router-contracts": "^1.3.0", "@uniswap/v3-periphery": "^1.1.1", "@uniswap/v3-staker": "1.0.0", @@ -4949,6 +4952,39 @@ "node": ">=10" } }, + "node_modules/@uniswap/v4-sdk": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@uniswap/v4-sdk/-/v4-sdk-1.0.0.tgz", + "integrity": "sha512-zC4cfOY9pFA6PUOARvmkAndOR0r5yiAwwcaFBxOoZe2kXLoh5wGH3svDZCQ4ZLpiPOevUPl+NXXC/KCEErbw2g==", + "dependencies": { + "@ethersproject/solidity": "^5.0.9", + "@uniswap/sdk-core": "^5.3.1", + "@uniswap/v3-sdk": "3.12.0", + "tiny-invariant": "^1.1.0", + "tiny-warning": "^1.0.3" + }, + "engines": { + "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", @@ -28357,21 +28393,22 @@ } }, "@uniswap/router-sdk": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@uniswap/router-sdk/-/router-sdk-1.9.2.tgz", - "integrity": "sha512-J63Of3HRpV0s3ZtEnhGlyvbBuZFfjK7NtnMwflzFMKzfdm+75APHYqnvHAnVARKuL/hMYHF4hni0o84bHem2Ng==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@uniswap/router-sdk/-/router-sdk-1.10.0.tgz", + "integrity": "sha512-XKDc46DDVqFOGwDqUFe6QkQMUue3FNsycxwKrbtBXbfw8eDpWrXIi7XpYF+5C/RI8TeRDpRvzorToJTw4DvaIA==", "requires": { "@ethersproject/abi": "^5.5.0", - "@uniswap/sdk-core": "^5.0.0", + "@uniswap/sdk-core": "^5.3.1", "@uniswap/swap-router-contracts": "^1.3.0", "@uniswap/v2-sdk": "^4.3.2", - "@uniswap/v3-sdk": "^3.11.2" + "@uniswap/v3-sdk": "^3.11.2", + "@uniswap/v4-sdk": "^1.0.0" } }, "@uniswap/sdk-core": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@uniswap/sdk-core/-/sdk-core-5.3.0.tgz", - "integrity": "sha512-wbMzSY3wbByOkoirZXyeomof4a7goueT4bOa4YqoXDWqIftqrT70UuCgjk98nIBu3UqPxRNMptXusppxZVvwWA==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@uniswap/sdk-core/-/sdk-core-5.3.1.tgz", + "integrity": "sha512-XLJY8PcMZnKYBGLABJnLXcr3EgWql3mmnmpHyV1/MmEh9pLJLHYz4HLwVHb8pGDCqpOFX0e+Ei44/qhC7Q5Dsg==", "requires": { "@ethersproject/address": "^5.0.2", "@ethersproject/bytes": "^5.7.0", @@ -28385,22 +28422,23 @@ } }, "@uniswap/smart-order-router": { - "version": "3.39.0", - "resolved": "https://registry.npmjs.org/@uniswap/smart-order-router/-/smart-order-router-3.39.0.tgz", - "integrity": "sha512-6PHMeJvXp7lpJvX4rE66ofHIJa/OB0s+TSQ802qu7cljj7E0SRDG/QAi3WBXIX3QlTyn1pp4Yvkqk7crtMRkgw==", + "version": "3.40.0", + "resolved": "https://registry.npmjs.org/@uniswap/smart-order-router/-/smart-order-router-3.40.0.tgz", + "integrity": "sha512-+Ffua7+neXz2w5Gyd8PKRB9NebEu+sZVQ9nxlaizsQuXo3KWU0yx79YiBubTqqrilI7foobtYYqTH+YAWyW+Dg==", "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.9.2", + "@uniswap/router-sdk": "^1.10.0", "@uniswap/sdk-core": "^5.3.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": "^2.2.0", + "@uniswap/universal-router-sdk": "^2.2.4", "@uniswap/v2-sdk": "^4.3.2", "@uniswap/v3-sdk": "^3.13.0", + "@uniswap/v4-sdk": "^1.0.0", "async-retry": "^1.3.1", "await-timeout": "^1.1.1", "axios": "^0.21.1", @@ -28471,16 +28509,17 @@ } }, "@uniswap/universal-router-sdk": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@uniswap/universal-router-sdk/-/universal-router-sdk-2.2.0.tgz", - "integrity": "sha512-8ys8eVLLMBMuTya9d4LjqBQrlunkdTm9HNgcE6IXG/Ro3Lekxe1e0mak0MaIQEFfrE44JvaJu6M/BenxBYWqaw==", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/@uniswap/universal-router-sdk/-/universal-router-sdk-2.2.4.tgz", + "integrity": "sha512-6+ErgDDtCJLM2ro/krCKtu6ucUpcaQEEPRrAPuJiMTWbR0UyR+6Otp+KdBcT9LmyzSoXuSHhIRr+6s25no1J6A==", "requires": { "@uniswap/permit2-sdk": "^1.3.0", - "@uniswap/router-sdk": "^1.9.2", - "@uniswap/sdk-core": "^5.3.0", + "@uniswap/router-sdk": "^1.10.0", + "@uniswap/sdk-core": "^5.3.1", "@uniswap/universal-router": "1.6.0", - "@uniswap/v2-sdk": "^4.3.2", - "@uniswap/v3-sdk": "^3.13.0", + "@uniswap/v2-sdk": "^4.4.1", + "@uniswap/v3-sdk": "^3.13.1", + "@uniswap/v4-sdk": "^1.0.0", "bignumber.js": "^9.0.2", "ethers": "^5.7.0" } @@ -28491,13 +28530,13 @@ "integrity": "sha512-MtybtkUPSyysqLY2U210NBDeCHX+ltHt3oADGdjqoThZaFRDKwM6k1Nb3F0A3hk5hwuQvytFWhrWHOEq6nVJ8Q==" }, "@uniswap/v2-sdk": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@uniswap/v2-sdk/-/v2-sdk-4.3.2.tgz", - "integrity": "sha512-yNxfQZuzmQ2xqiKutzyzzoXuiuwFrHWba6GG9gT8JeJ4NT5sTJOeLY1FEdEMVsJQwXfMc+goG/srNBRZXVRtSA==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@uniswap/v2-sdk/-/v2-sdk-4.4.1.tgz", + "integrity": "sha512-mU0YNgpm7Nmh3RSlcltluYVECdBcfQQIIQIDCM49Rog8ZnW4wp5QqEYkVjgAuqdu1mwLkMDMQUhzhtC0Z2Df6g==", "requires": { "@ethersproject/address": "^5.0.2", "@ethersproject/solidity": "^5.0.9", - "@uniswap/sdk-core": "^5.0.0", + "@uniswap/sdk-core": "^5.3.1", "tiny-invariant": "^1.1.0", "tiny-warning": "^1.0.3" } @@ -28527,13 +28566,13 @@ } }, "@uniswap/v3-sdk": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@uniswap/v3-sdk/-/v3-sdk-3.13.0.tgz", - "integrity": "sha512-Jz8aEU7RrDK4LfFNLClXFr2hkBE08QANLEBTofmu+ueCCKoNoRd/OTR4q04HhIeMyXtzsSOzi32a5yS7OY9glg==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/@uniswap/v3-sdk/-/v3-sdk-3.13.1.tgz", + "integrity": "sha512-MCc96HrUZy17DINwrGnMtCvr+yXQlWUJJVaIiRRKe1DQzSuv97/G4lzM+zAaSymrxbR2qnHHWL5vMFjmwzCN9Q==", "requires": { "@ethersproject/abi": "^5.5.0", "@ethersproject/solidity": "^5.0.9", - "@uniswap/sdk-core": "^5.3.0", + "@uniswap/sdk-core": "^5.3.1", "@uniswap/swap-router-contracts": "^1.3.0", "@uniswap/v3-periphery": "^1.1.1", "@uniswap/v3-staker": "1.0.0", @@ -28551,6 +28590,35 @@ "@uniswap/v3-periphery": "^1.0.1" } }, + "@uniswap/v4-sdk": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@uniswap/v4-sdk/-/v4-sdk-1.0.0.tgz", + "integrity": "sha512-zC4cfOY9pFA6PUOARvmkAndOR0r5yiAwwcaFBxOoZe2kXLoh5wGH3svDZCQ4ZLpiPOevUPl+NXXC/KCEErbw2g==", + "requires": { + "@ethersproject/solidity": "^5.0.9", + "@uniswap/sdk-core": "^5.3.1", + "@uniswap/v3-sdk": "3.12.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": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", diff --git a/package.json b/package.json index 3dc9fc97f2..f5a1794f49 100644 --- a/package.json +++ b/package.json @@ -84,12 +84,12 @@ "@types/stats-lite": "^2.2.0", "@uniswap/default-token-list": "^11.13.0", "@uniswap/permit2-sdk": "^1.3.0", - "@uniswap/router-sdk": "^1.9.2", + "@uniswap/router-sdk": "^1.10.0", "@uniswap/sdk-core": "^5.3.0", "@types/semver": "^7.5.8", - "@uniswap/smart-order-router": "3.39.0", + "@uniswap/smart-order-router": "3.40.0", "@uniswap/token-lists": "^1.0.0-beta.33", - "@uniswap/universal-router-sdk": "^2.2.0", + "@uniswap/universal-router-sdk": "^2.2.4", "@uniswap/v2-sdk": "^4.3.2", "@uniswap/v3-periphery": "^1.4.4", "@uniswap/v3-sdk": "^3.13.0",