Skip to content

Commit

Permalink
chore: bump sor to 3.44.0 - feat: SOR modify on-chain-quote-provider …
Browse files Browse the repository at this point in the history
…to support v4 quoter (#819)

Release Uniswap/smart-order-router#679
  • Loading branch information
jsy1218 authored Aug 28, 2024
1 parent 9964bab commit 51410dc
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
2 changes: 2 additions & 0 deletions lib/handlers/injector-sor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ export abstract class InjectorSOR<Router, QueryParams> extends Injector<
process.env.TENDERLY_NODE_API_KEY!,
v2PoolProvider,
v3PoolProvider,
v4PoolProvider,
provider,
portionProvider,
undefined,
Expand All @@ -414,6 +415,7 @@ export abstract class InjectorSOR<Router, QueryParams> extends Injector<
provider,
v2PoolProvider,
v3PoolProvider,
v4PoolProvider,
portionProvider
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { IOnChainQuoteProvider, log, metric, MetricLoggerUnit, OnChainQuotes } from '@uniswap/smart-order-router'
import { MixedRoute, V2Route, V3Route } from '@uniswap/smart-order-router/build/main/routers'
import {
IOnChainQuoteProvider,
log,
metric,
MetricLoggerUnit,
OnChainQuotes,
SupportedExactOutRoutes,
SupportedRoutes,
} from '@uniswap/smart-order-router'
import { ChainId, Currency, CurrencyAmount } from '@uniswap/sdk-core'
import { ProviderConfig } from '@uniswap/smart-order-router/build/main/providers/provider'
import { QUOTE_PROVIDER_TRAFFIC_SWITCH_CONFIGURATION } from '../../util/quote-provider-traffic-switch-configuration'
Expand Down Expand Up @@ -35,7 +42,7 @@ export class TrafficSwitchOnChainQuoteProvider implements IOnChainQuoteProvider
this.chainId = props.chainId
}

async getQuotesManyExactIn<TRoute extends V3Route | V2Route | MixedRoute>(
async getQuotesManyExactIn<TRoute extends SupportedRoutes>(
amountIns: CurrencyAmount<Currency>[],
routes: TRoute[],
providerConfig?: ProviderConfig
Expand Down Expand Up @@ -117,7 +124,7 @@ export class TrafficSwitchOnChainQuoteProvider implements IOnChainQuoteProvider
}
}

async getQuotesManyExactOut<TRoute extends V3Route>(
async getQuotesManyExactOut<TRoute extends SupportedExactOutRoutes>(
amountOuts: CurrencyAmount<Currency>[],
routes: TRoute[],
providerConfig?: ProviderConfig
Expand Down Expand Up @@ -211,7 +218,7 @@ export class TrafficSwitchOnChainQuoteProvider implements IOnChainQuoteProvider
}
}

private compareQuotes<TRoute extends V3Route | V2Route | MixedRoute>(
private compareQuotes<TRoute extends SupportedRoutes>(
tradeTypeMetric: string,
currentRoutesWithQuotes: OnChainQuotes<TRoute>,
targetRoutesWithQuotes: OnChainQuotes<TRoute>
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"@uniswap/router-sdk": "^1.10.0",
"@uniswap/sdk-core": "^5.3.0",
"@types/semver": "^7.5.8",
"@uniswap/smart-order-router": "3.43.3",
"@uniswap/smart-order-router": "3.44.0",
"@uniswap/token-lists": "^1.0.0-beta.33",
"@uniswap/universal-router-sdk": "^2.2.4",
"@uniswap/v2-sdk": "^4.3.2",
Expand Down

0 comments on commit 51410dc

Please sign in to comment.