Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump sor to 3.42.0 - feat: implement v4 candidate pools from top tvl v4 subgraph #814

Merged
merged 3 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/handlers/injector-sor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ export abstract class InjectorSOR<Router, QueryParams> extends Injector<
v4SubgraphProvider,
v3SubgraphProvider,
onChainQuoteProvider: quoteProvider,
v4PoolProvider,
v3PoolProvider,
v2PoolProvider,
v2QuoteProvider: new V2QuoteProvider(),
Expand Down
3 changes: 2 additions & 1 deletion lib/handlers/router-entities/aws-subgraph-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
MetricLoggerUnit,
V2SubgraphPool,
V3SubgraphPool,
V4SubgraphPool,
} from '@uniswap/smart-order-router'
import { S3 } from 'aws-sdk'
import { ChainId } from '@uniswap/sdk-core'
Expand Down Expand Up @@ -106,7 +107,7 @@ export const cachePoolsFromS3 = async <TSubgraphPool>(
return pools
}

export class V4AWSSubgraphProvider extends AWSSubgraphProvider<V3SubgraphPool> implements IV3SubgraphProvider {
export class V4AWSSubgraphProvider extends AWSSubgraphProvider<V4SubgraphPool> implements IV3SubgraphProvider {
constructor(chainId: ChainId, bucket: string, baseKey: string) {
super(chainId, Protocol.V4, bucket, baseKey)
}
Expand Down
38 changes: 38 additions & 0 deletions lib/handlers/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ export const DEFAULT_ROUTING_CONFIG_BY_CHAIN = (chainId: ChainId): AlphaRouterCo
topNWithEachBaseToken: 3,
topNWithBaseToken: 3,
},
v4PoolSelection: {
topN: 2,
topNDirectSwaps: 2,
topNTokenInOut: 2,
topNSecondHop: 1,
topNWithEachBaseToken: 3,
topNWithBaseToken: 3,
},
maxSwapsPerPath: 3,
minSplits: 1,
maxSplits: 7,
Expand Down Expand Up @@ -61,6 +69,14 @@ export const DEFAULT_ROUTING_CONFIG_BY_CHAIN = (chainId: ChainId): AlphaRouterCo
topNWithEachBaseToken: 3,
topNWithBaseToken: 2,
},
v4PoolSelection: {
topN: 2,
topNDirectSwaps: 2,
topNTokenInOut: 2,
topNSecondHop: 1,
topNWithEachBaseToken: 3,
topNWithBaseToken: 2,
},
maxSwapsPerPath: 2,
minSplits: 1,
maxSplits: 7,
Expand Down Expand Up @@ -91,6 +107,17 @@ export const DEFAULT_ROUTING_CONFIG_BY_CHAIN = (chainId: ChainId): AlphaRouterCo
topNWithEachBaseToken: 3,
topNWithBaseToken: 5,
},
v4PoolSelection: {
topN: 2,
topNDirectSwaps: 2,
topNTokenInOut: 3,
topNSecondHop: 1,
topNSecondHopForTokenAddress: new MapWithLowerCaseKey<number>([
['0x5f98805a4e8be255a32880fdec7f6728c6568ba0', 2], // LUSD
]),
topNWithEachBaseToken: 3,
topNWithBaseToken: 5,
},
maxSwapsPerPath: 3,
minSplits: 1,
maxSplits: 2,
Expand Down Expand Up @@ -121,6 +148,17 @@ export const DEFAULT_ROUTING_CONFIG_BY_CHAIN = (chainId: ChainId): AlphaRouterCo
topNWithEachBaseToken: 3,
topNWithBaseToken: 5,
},
v4PoolSelection: {
topN: 2,
topNDirectSwaps: 2,
topNTokenInOut: 3,
topNSecondHop: 1,
topNSecondHopForTokenAddress: new MapWithLowerCaseKey<number>([
['0x5f98805a4e8be255a32880fdec7f6728c6568ba0', 2], // LUSD
]),
topNWithEachBaseToken: 3,
topNWithBaseToken: 5,
},
maxSwapsPerPath: 3,
minSplits: 1,
maxSplits: 7,
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.41.0",
"@uniswap/smart-order-router": "3.42.0",
"@uniswap/token-lists": "^1.0.0-beta.33",
"@uniswap/universal-router-sdk": "^2.2.4",
"@uniswap/v2-sdk": "^4.3.2",
Expand Down
Loading