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

feat: support monad testnet + base sepolia #961

Merged
merged 8 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 2 additions & 2 deletions bin/stacks/routing-lambda-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
18 changes: 18 additions & 0 deletions lib/config/rpcProviderProdConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,23 @@
"providerInitialWeights": [1],
"providerUrls": ["QUICKNODE_1301"],
"providerNames": ["QUICKNODE"]
},
{
"chainId": 10143,
"useMultiProviderProb": 1,
"latencyEvaluationSampleProb": 0,
"healthCheckSampleProb": 0,
"providerInitialWeights": [1],
"providerUrls": ["UNIRPC_0"],
"providerNames": ["UNIRPC"]
},
{
"chainId": 84532,
"useMultiProviderProb": 1,
"latencyEvaluationSampleProb": 0,
"healthCheckSampleProb": 0,
"providerInitialWeights": [1],
"providerUrls": ["UNIRPC_0"],
"providerNames": ["UNIRPC"]
}
]
3 changes: 3 additions & 0 deletions lib/cron/cache-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ export const v2SubgraphUrlOverride = (chainId: ChainId) => {
return `https://subgraph.satsuma-prod.com/${process.env.ALCHEMY_QUERY_KEY}/uniswap/uniswap-v2-worldchain/api`
case ChainId.UNICHAIN_SEPOLIA:
return `https://subgraph.satsuma-prod.com/${process.env.ALCHEMY_QUERY_KEY}/uniswap/uniswap-v2-astrochain-sepolia/api`
case ChainId.MONAD_TESTNET:
// TODO: is this correct?
return `https://subgraph.satsuma-prod.com/${process.env.ALCHEMY_QUERY_KEY}/uniswap/uniswap-v2-monad-testnet/api`
xrsv marked this conversation as resolved.
Show resolved Hide resolved
default:
return undefined
}
Expand Down
2 changes: 2 additions & 0 deletions lib/dashboards/rpc-providers-widgets-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ const ID_TO_PROVIDER = (id: ChainId): string => {
case ChainId.CELO:
case ChainId.BNB:
case ChainId.BASE:
case ChainId.BASE_SEPOLIA:
case ChainId.UNICHAIN_SEPOLIA:
case ChainId.MONAD_TESTNET:
return ProviderName.QUIKNODE
case ChainId.CELO_ALFAJORES:
return ProviderName.FORNO
Expand Down
4 changes: 4 additions & 0 deletions lib/graphql/graphql-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export class UniGraphQLProvider implements IUniGraphQLProvider {
return 'BNB'
case ChainId.BASE:
return 'BASE'
case ChainId.BASE_SEPOLIA:
return 'BASE_SEPOLIA'
case ChainId.BLAST:
return 'BLAST'
case ChainId.ZORA:
Expand All @@ -61,6 +63,8 @@ export class UniGraphQLProvider implements IUniGraphQLProvider {
return 'WORLDCHAIN'
case ChainId.UNICHAIN_SEPOLIA:
return 'UNICHAIN_SEPOLIA'
case ChainId.MONAD_TESTNET:
return 'MONAD_TESTNET'
default:
throw new Error(`UniGraphQLProvider._chainIdToGraphQLChainName unsupported ChainId: ${chainId}`)
}
Expand Down
5 changes: 5 additions & 0 deletions lib/handlers/injector-sor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ export const SUPPORTED_CHAINS: ChainId[] = [
ChainId.ZKSYNC,
ChainId.WORLDCHAIN,
ChainId.UNICHAIN_SEPOLIA,
ChainId.MONAD_TESTNET,
ChainId.BASE_SEPOLIA,
]
const DEFAULT_TOKEN_LIST = 'https://gateway.ipfs.io/ipns/tokens.uniswap.org'

Expand Down Expand Up @@ -367,6 +369,8 @@ export abstract class InjectorSOR<Router, QueryParams> extends Injector<
case ChainId.ZKSYNC:
case ChainId.WORLDCHAIN:
case ChainId.UNICHAIN_SEPOLIA:
case ChainId.MONAD_TESTNET:
case ChainId.BASE_SEPOLIA:
const currentQuoteProvider = new OnChainQuoteProvider(
chainId,
provider,
Expand Down Expand Up @@ -507,6 +511,7 @@ export abstract class InjectorSOR<Router, QueryParams> extends Injector<
ChainId.AVALANCHE,
ChainId.BLAST,
ChainId.WORLDCHAIN,
ChainId.MONAD_TESTNET,
]

const v4Supported = [ChainId.SEPOLIA]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ export const QUOTE_PROVIDER_TRAFFIC_SWITCH_CONFIGURATION = (
// 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.UNICHAIN_SEPOLIA:
case ChainId.BASE_SEPOLIA:
case ChainId.MONAD_TESTNET:
switch (protocol) {
case Protocol.MIXED:
case Protocol.V4:
Expand Down
2 changes: 2 additions & 0 deletions lib/handlers/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ export const DEFAULT_ROUTING_CONFIG_BY_CHAIN = (chainId: ChainId): AlphaRouterCo
case ChainId.OPTIMISM:
case ChainId.WORLDCHAIN:
case ChainId.UNICHAIN_SEPOLIA:
case ChainId.MONAD_TESTNET:
case ChainId.BASE_SEPOLIA:
return {
v2PoolSelection: {
topN: 3,
Expand Down
7 changes: 7 additions & 0 deletions lib/rpc/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export function chainIdToNetworkName(networkId: ChainId): string {
return 'worldchain'
case ChainId.UNICHAIN_SEPOLIA:
return 'unichain-sepolia'
case ChainId.MONAD_TESTNET:
return 'monad-testnet'
case ChainId.BASE_SEPOLIA:
return 'base-sepolia'
default:
return 'ethereum'
}
Expand Down Expand Up @@ -83,6 +87,9 @@ export function generateProviderUrl(key: string, value: string, chainId: number)
case 'QUICKNODE_8453': {
return `https://${tokens[0]}.base-mainnet.quiknode.pro/${tokens[1]}`
}
case 'QUICKNODE_84532': {
return `https://${tokens[0]}.base-sepolia.quiknode.pro/${tokens[1]}`
}
case 'QUICKNODE_42161': {
return `https://${tokens[0]}.arbitrum-mainnet.quiknode.pro/${tokens[1]}`
}
Expand Down
2 changes: 2 additions & 0 deletions lib/util/defaultBlocksToLiveRoutesDB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const DEFAULT_BLOCKS_TO_LIVE_ROUTES_DB: { [chain in ChainId]: number } =
[ChainId.BASE]: 1800,
[ChainId.ZORA]: 1800,
[ChainId.BASE_GOERLI]: 1800,
[ChainId.BASE_SEPOLIA]: 1800,
[ChainId.ZORA_SEPOLIA]: 1800,
[ChainId.BLAST]: 1800,
// Note: Experiment with longer TTL
Expand Down Expand Up @@ -49,4 +50,5 @@ export const DEFAULT_BLOCKS_TO_LIVE_ROUTES_DB: { [chain in ChainId]: number } =
[ChainId.ROOTSTOCK]: 148,
// (60 minutes) / (1 seconds) = 3600
[ChainId.ZKSYNC]: 3600,
[ChainId.MONAD_TESTNET]: 3600,
}
1 change: 1 addition & 0 deletions lib/util/extraV4FeeTiersTickSpacingsHookAddresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const EXTRA_V4_FEE_TICK_SPACINGS_HOOK_ADDRESSES: { [chain in ChainId]: Ar
[ChainId.BNB]: emptyV4FeeTickSpacingsHookAddresses,
[ChainId.AVALANCHE]: emptyV4FeeTickSpacingsHookAddresses,
[ChainId.BASE_GOERLI]: emptyV4FeeTickSpacingsHookAddresses,
[ChainId.BASE_SEPOLIA]: emptyV4FeeTickSpacingsHookAddresses,
[ChainId.BASE]: emptyV4FeeTickSpacingsHookAddresses,
[ChainId.ZORA]: emptyV4FeeTickSpacingsHookAddresses,
[ChainId.ZORA_SEPOLIA]: emptyV4FeeTickSpacingsHookAddresses,
Expand Down
1 change: 1 addition & 0 deletions lib/util/hooksAddressesAllowlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const HOOKS_ADDRESSES_ALLOWLIST: { [chain in ChainId]: Array<string> } =
[ChainId.BNB]: [ADDRESS_ZERO],
[ChainId.AVALANCHE]: [ADDRESS_ZERO],
[ChainId.BASE_GOERLI]: [ADDRESS_ZERO],
[ChainId.BASE_SEPOLIA]: [ADDRESS_ZERO],
[ChainId.BASE]: [ADDRESS_ZERO],
[ChainId.ZORA]: [ADDRESS_ZERO],
[ChainId.ZORA_SEPOLIA]: [ADDRESS_ZERO],
Expand Down
1 change: 1 addition & 0 deletions lib/util/newCachedRoutesRolloutPercent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ export const NEW_CACHED_ROUTES_ROLLOUT_PERCENT: { [chain in ChainId]: number } =
[ChainId.UNICHAIN_SEPOLIA]: 100,
[ChainId.UNICHAIN]: 100,
[ChainId.MONAD_TESTNET]: 100,
[ChainId.BASE_SEPOLIA]: 100,
}
Loading
Loading