Skip to content

Commit 954aee9

Browse files
committed
Merge branch 'main' into layerswap
# Conflicts: # bin/app.ts # bin/stacks/routing-api-stack.ts # bin/stacks/routing-caching-stack.ts # lib/config/rpcProviderProdConfig.json # lib/cron/cache-config.ts # lib/handlers/injector-sor.ts
2 parents 1a4c190 + 462d10e commit 954aee9

17 files changed

+294
-111
lines changed

bin/stacks/routing-caching-stack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export class RoutingCachingStack extends cdk.NestedStack {
137137
layers: [lambdaLayerVersion],
138138
tracing: aws_lambda.Tracing.ACTIVE,
139139
environment: {
140-
VERSION: '3',
140+
VERSION: '4',
141141
POOL_CACHE_BUCKET: this.poolCacheBucket.bucketName,
142142
POOL_CACHE_BUCKET_3: this.poolCacheBucket3.bucketName,
143143
POOL_CACHE_GZIP_KEY: this.poolCacheGzipKey,

bin/stacks/routing-lambda-stack.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export class RoutingLambdaStack extends cdk.NestedStack {
115115

116116
description: 'Caching Routing Lambda',
117117
environment: {
118-
VERSION: '3',
118+
VERSION: '4',
119119
NODE_OPTIONS: '--enable-source-maps',
120120
POOL_CACHE_BUCKET: poolCacheBucket.bucketName,
121121
POOL_CACHE_BUCKET_3: poolCacheBucket3.bucketName,
@@ -172,7 +172,7 @@ export class RoutingLambdaStack extends cdk.NestedStack {
172172

173173
description: 'Routing Lambda',
174174
environment: {
175-
VERSION: '31',
175+
VERSION: '32',
176176
NODE_OPTIONS: '--enable-source-maps',
177177
POOL_CACHE_BUCKET: poolCacheBucket.bucketName,
178178
POOL_CACHE_BUCKET_3: poolCacheBucket3.bucketName,

lib/cron/cache-config.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@ export const ZORA_HOOKS_FOR_V4_SUBGRAPH_FILTERING = new Set([
5656
ZORA_POST_HOOK_ON_BASE_v2_3_0,
5757
])
5858

59-
// during local cdk stack update, the env vars are not populated
60-
// make sure to fill in the env vars below
61-
// process.env.ALCHEMY_QUERY_KEY = ''
62-
// process.env.ALCHEMY_QUERY_KEY_2 = ''
63-
6459
export const v4SubgraphUrlOverride = (chainId: ChainId) => {
6560
const apiKey = process.env.THEGRAPH_API_KEY || ''
6661
switch (chainId) {

lib/dashboards/rpc-providers-widgets-factory.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const ID_TO_PROVIDER = (id: ChainId): string => {
2424
case ChainId.UNICHAIN_SEPOLIA:
2525
case ChainId.MONAD_TESTNET:
2626
case ChainId.UNICHAIN:
27+
case ChainId.XLAYER:
2728
return ProviderName.QUIKNODE
2829
case ChainId.CELO_ALFAJORES:
2930
return ProviderName.FORNO

lib/graphql/graphql-provider.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ export class UniGraphQLProvider implements IUniGraphQLProvider {
7171
return 'UNICHAIN'
7272
case ChainId.SONEIUM:
7373
return 'SONEIUM'
74+
case ChainId.XLAYER:
75+
return 'XLAYER'
7476
default:
7577
throw new Error(`UniGraphQLProvider._chainIdToGraphQLChainName unsupported ChainId: ${chainId}`)
7678
}

lib/handlers/shared.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ export const DEFAULT_ROUTING_CONFIG_BY_CHAIN = (chainId: ChainId): AlphaRouterCo
8888
case ChainId.BASE_SEPOLIA:
8989
case ChainId.UNICHAIN:
9090
case ChainId.SONEIUM:
91+
case ChainId.XLAYER:
9192
return {
9293
v2PoolSelection: {
9394
topN: 3,

lib/util/defaultBlocksToLiveRoutesDB.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,5 @@ export const DEFAULT_BLOCKS_TO_LIVE_ROUTES_DB: { [chain in ChainId]: number } =
5454
// (1 minute) / (1 seconds) = 60
5555
[ChainId.ZKSYNC]: 60,
5656
[ChainId.SONEIUM]: 60,
57+
[ChainId.XLAYER]: 60,
5758
}

lib/util/extraV4FeeTiersTickSpacingsHookAddresses.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,5 @@ export const EXTRA_V4_FEE_TICK_SPACINGS_HOOK_ADDRESSES: { [chain in ChainId]: Ar
5151
[ChainId.MONAD_TESTNET]: emptyV4FeeTickSpacingsHookAddresses,
5252
[ChainId.MONAD]: emptyV4FeeTickSpacingsHookAddresses,
5353
[ChainId.SONEIUM]: emptyV4FeeTickSpacingsHookAddresses,
54+
[ChainId.XLAYER]: emptyV4FeeTickSpacingsHookAddresses,
5455
}

lib/util/hooksAddressesAllowlist.ts

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,62 @@ export const TOKENWORKS_HOOK_ON_MAINNET_5 = '0x5d8a61fa2ced43eeabffc00c85f705e3e
107107
// example pool: https://app.uniswap.org/explore/pools/ethereum/0xeea2c1344c876f4c8d7545cba9ed8b199e124d6dc3e2063e3f90ba94e7b53093
108108
export const ENS_WHEEL_HOOK_ON_MAINNET = '0xf13bdafb90c79f2201e2ce42010c8ef75fede8c4'
109109

110+
// example pool: https://app.uniswap.org/explore/pools/monad/0xfb2e06638df93ad3080109c410714b0903213135ff6f5909b3a846764df0b801
111+
export const CULT_FEE_HOOK_ADDRESS_ON_MONAD = '0x7A2524cE937F206844b9508EEc8f6486800a40CC'
112+
113+
// example pool: https://app.uniswap.org/explore/pools/base/0xab22898bde69271720124833eb07b8e7268f69cb833d33cb2442e57e8b57eea1
114+
export const AQUINAS_HOOK_ADDRESS_ON_BASE = '0xd3c1f2174f37f88811f99b1b1b4c1356c0246000'
115+
116+
// example pool: https://app.uniswap.org/explore/pools/ethereum/0x389a26ef4a4634e55fc4e3ae2149c1cafdbc141af16057ab5fab962c2dca5221
117+
export const ASTERIX_HOOK_ADDRESS_ON_MAINNET = '0xdad7ea85ff786b389a13f4714a56b1721b56c044'
118+
119+
// example pool: https://app.uniswap.org/explore/pools/base/0x02aaacb8bf6a4c3c3a99d8de43fad01348e68e314b7773fb2df3edac065e0c4e
120+
export const DELI_HOOK_ADDRESS_ON_BASE = '0x570a48f96035c2874de1c0f13c5075a05683b0cc'
121+
// example pool: https://app.uniswap.org/explore/pools/base/0xa900d06df8073e50a50971720d6d3470d00e64198da3b03c82388f247e0d13c1
122+
export const DELI_HOOK_CONSTANT_PRODUCT_ON_BASE = '0x95afbc0fccf974b41380f24e562f15b6dd90fac8'
123+
124+
// example pool: https://app.uniswap.org/explore/pools/optimism/0xa30abc0ccd08c0c16d28ccfaf15de692a1778775de9f6dea337fb9b490163b18
125+
export const FINDEX_HOOK_ON_OPTIMISM = '0xb35297543d357ef62df204d8c3bd0e96038cf440'
126+
127+
// example pool: https://app.uniswap.org/explore/pools/ethereum/0x26b73e77f7b2cfc05d28a8978b917eced1cdf7915862292cfbb507731d5120fd
128+
export const ACTION_HOOK_ON_MAINNET = '0x00bbc6fc07342cf80d14b60695cf0e1aa8de00cc'
129+
130+
// example pool: https://app.uniswap.org/explore/pools/ethereum/0x4de849063d9559a699e26463a433c6d29e7570de49209f95295529afee20eb05
131+
export const M0_ALLOWLIST_HOOKS_ADDRESS_ON_MAINNET = '0xaf53cb78035a8e0acce38441793e2648b15b88a0'
132+
133+
// example pool: https://app.uniswap.org/explore/pools/ethereum/0x6b3403809baa251f186c546908d6ebdbd5dc52527b2b3f8bc7d4f5a437091b0f
134+
export const M0_TICK_RANGE_HOOKS_ADDRESS_ON_MAINNET = '0xde400595199e6dae55a1bcb742b3eb249af00800'
135+
136+
// example pool: https://app.uniswap.org/explore/pools/unichain/0x087de24dbfcd8c833dc54b73e3963451d315b7fda506dff0e45e5938e894dfbd
137+
export const UNIDERP_HOOK_ON_UNICHAIN = '0xcc2efb167503f2d7df0eae906600066aec9e8444'
138+
139+
// example pool: https://app.uniswap.org/explore/pools/base/0xa113103448f7b09199e019656f377988c87f8f312ddcebc6fea9e78bcd6ec2af
140+
export const SUPERSTRATEGY_HOOK_ON_BASE = '0x1e0c810a30fb82391df936602c1161421381b0c8'
141+
// example pool: https://app.uniswap.org/explore/pools/base/0xe4821b1cbfce1906c2249d1b34366610960c01fa3f762b0579c594d2033b9152
142+
export const WASSBLASTER_HOOK_ON_BASE = '0x35b9b5b023897da8c7375ba6141245b8416460cc'
143+
144+
// example pool: https://app.uniswap.org/explore/pools/base/0x3cdfb68e7c413e3ae9e5822ca428975a334d062388b2e3a0d42dc329880cbf36
145+
export const SIMPLE_SELL_TAX_HOOK_ON_BASE = '0xca975b9daf772c71161f3648437c3616e5be0088'
146+
147+
// example pool: https://app.uniswap.org/explore/pools/ethereum/0x7a5a8f5a36a6a2e9961caf6bb047a5a7580d0fe16a532aad93efc596028dfa54
148+
export const RING_FEW_ETH_HOOK_ON_MAINNET = '0x044301939deb7ca53c4733dd4d9b3bc5ea0c6888'
149+
// example pool: https://app.uniswap.org/explore/pools/ethereum/0x301d41ff23b73b209ab2b1112f4effd0d8ff978ec29d743c1431463f84cbec24
150+
export const RING_FEW_UNI_HOOK_ON_MAINNET = '0x4b3e2a8cf36c7eb0fba2a5b39b20c896c6f22888'
151+
// example pool: https://app.uniswap.org/explore/pools/ethereum/0x18605c7a76101aeccc414cc300dd5e5ae44b30d6c247ba164ccd88952c259735
152+
export const RING_FEW_WBTC_HOOK_ON_MAINNET = '0x0fe942afdb2f51e25cbf892aad175c6a574f2888'
153+
// example pool: https://app.uniswap.org/explore/pools/ethereum/0x8f8b0b21fb429ffb5210f2bf0f8b7cb267b944a0c61beaae35f20f6839c0f33b
154+
export const RING_FEW_CBBTC_HOOK_ON_MAINNET = '0x8347b7a3807c681513d2b51b8223e59aa16a2888'
155+
// example pool: https://app.uniswap.org/explore/pools/ethereum/0x5837e6b4fd4b8193f2f7a8b4490c0f154344bb9a52b36a885578ff6d3193fc47
156+
export const RING_FEW_USDC_HOOK_ON_MAINNET = '0x4b2eb653d13e6c9ac5a0a01fde22f2c8d6592888'
157+
// example pool: https://app.uniswap.org/explore/pools/ethereum/0x7db868544c8f7f6ddb107c7749c94f03c9e0155f2138aef3f8a020e4a469d95a
158+
export const RING_FEW_USDT_HOOK_ON_MAINNET = '0xbadf77d50478b4432ef1f243b9c0bc7869486888'
159+
// example pool: https://app.uniswap.org/explore/pools/ethereum/0xf906beb74154ca4d057b7079c90eb1044efaf40ef468e62ec983930cf80a1e2b
160+
export const RING_FEW_DAI_HOOK_ON_MAINNET = '0x85b648a64aed6307d5d5ce26e6ae086c17bde888'
161+
// example pool: https://app.uniswap.org/explore/pools/ethereum/0x6933dfbf7441cc4ee4439843fdd464e215a6c90f07c5a769198e2a047f1f3f3e
162+
export const RING_FEW_WEETH_HOOK_ON_MAINNET = '0x877323adbf747f85eb8d182d42f01f34a5492888'
163+
// example pool: https://app.uniswap.org/explore/pools/ethereum/0xe7c2f30fd89238331b0e3e6ac6351578d5e3091b7839eff321c29cf88e17274e
164+
export const RING_FEW_WSTETH_HOOK_ON_MAINNET = '0x75ae0292e8ad3ab60b9a1a7b3046d3f4abdfa888'
165+
110166
// we do not allow v4 pools with non-zero hook address to be routed through in the initial v4 launch.
111167
// this is the ultimate safeguard in the routing subgraph pool cron job.
112168
export const HOOKS_ADDRESSES_ALLOWLIST: { [chain in ChainId]: Array<string> } = {
@@ -121,10 +177,23 @@ export const HOOKS_ADDRESSES_ALLOWLIST: { [chain in ChainId]: Array<string> } =
121177
TOKENWORKS_HOOK_ON_MAINNET_4,
122178
TOKENWORKS_HOOK_ON_MAINNET_5,
123179
ENS_WHEEL_HOOK_ON_MAINNET,
180+
ASTERIX_HOOK_ADDRESS_ON_MAINNET,
181+
ACTION_HOOK_ON_MAINNET,
182+
M0_ALLOWLIST_HOOKS_ADDRESS_ON_MAINNET,
183+
M0_TICK_RANGE_HOOKS_ADDRESS_ON_MAINNET,
184+
RING_FEW_ETH_HOOK_ON_MAINNET,
185+
RING_FEW_UNI_HOOK_ON_MAINNET,
186+
RING_FEW_WBTC_HOOK_ON_MAINNET,
187+
RING_FEW_CBBTC_HOOK_ON_MAINNET,
188+
RING_FEW_USDC_HOOK_ON_MAINNET,
189+
RING_FEW_USDT_HOOK_ON_MAINNET,
190+
RING_FEW_DAI_HOOK_ON_MAINNET,
191+
RING_FEW_WEETH_HOOK_ON_MAINNET,
192+
RING_FEW_WSTETH_HOOK_ON_MAINNET,
124193
],
125194
[ChainId.GOERLI]: [ADDRESS_ZERO],
126195
[ChainId.SEPOLIA]: [ADDRESS_ZERO, extraHooksAddressesOnSepolia, FEY_ON_SEPOLIA],
127-
[ChainId.OPTIMISM]: [ADDRESS_ZERO, WETH_HOOKS_ADDRESS_ON_OP_MAINNET],
196+
[ChainId.OPTIMISM]: [ADDRESS_ZERO, WETH_HOOKS_ADDRESS_ON_OP_MAINNET, FINDEX_HOOK_ON_OPTIMISM],
128197
[ChainId.OPTIMISM_GOERLI]: [ADDRESS_ZERO],
129198
[ChainId.OPTIMISM_SEPOLIA]: [ADDRESS_ZERO],
130199
[ChainId.ARBITRUM_ONE]: [
@@ -184,6 +253,12 @@ export const HOOKS_ADDRESSES_ALLOWLIST: { [chain in ChainId]: Array<string> } =
184253
ZORA_POST_HOOK_ON_BASE_v2_3_0,
185254
FEY_ON_BASE,
186255
PUBHOUSE_HOOK_ON_BASE,
256+
DELI_HOOK_ADDRESS_ON_BASE,
257+
DELI_HOOK_CONSTANT_PRODUCT_ON_BASE,
258+
AQUINAS_HOOK_ADDRESS_ON_BASE,
259+
SUPERSTRATEGY_HOOK_ON_BASE,
260+
SIMPLE_SELL_TAX_HOOK_ON_BASE,
261+
WASSBLASTER_HOOK_ON_BASE,
187262
],
188263
[ChainId.ZORA]: [ADDRESS_ZERO],
189264
[ChainId.ZORA_SEPOLIA]: [ADDRESS_ZERO],
@@ -203,13 +278,16 @@ export const HOOKS_ADDRESSES_ALLOWLIST: { [chain in ChainId]: Array<string> } =
203278
CLANKER_STATIC_FEE_HOOKS_ADDRESS_ON_UNICHAIN,
204279
LIMIT_ORDER_HOOKS_ADDRESS_ON_UNICHAIN,
205280
PANOPTIC_ORACLE_HOOK_ON_UNICHAIN,
281+
UNIDERP_HOOK_ON_UNICHAIN,
206282
],
207283
[ChainId.MONAD_TESTNET]: [ADDRESS_ZERO],
208284
[ChainId.MONAD]: [
209285
ADDRESS_ZERO,
210286
WETH_HOOKS_ADDRESS_ON_MONAD,
211287
CLANKER_STATIC_FEE_HOOKS_ADDRESS_ON_MONAD,
212288
DOPPLER_HOOKS_ADDRESS_ON_MONAD,
289+
CULT_FEE_HOOK_ADDRESS_ON_MONAD,
213290
],
214291
[ChainId.SONEIUM]: [ADDRESS_ZERO],
292+
[ChainId.XLAYER]: [ADDRESS_ZERO],
215293
}

lib/util/newCachedRoutesRolloutPercent.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ export const NEW_CACHED_ROUTES_ROLLOUT_PERCENT: { [chain in ChainId]: number } =
3636
[ChainId.MONAD]: 100,
3737
[ChainId.BASE_SEPOLIA]: 100,
3838
[ChainId.SONEIUM]: 100,
39+
[ChainId.XLAYER]: 100,
3940
}

0 commit comments

Comments
 (0)