Skip to content

Commit 6aaa420

Browse files
Merge branch 'main' into whitelist-buy-hook-bsc
2 parents 98142af + 8c25c46 commit 6aaa420

File tree

7 files changed

+94
-83
lines changed

7 files changed

+94
-83
lines changed

bin/stacks/routing-api-stack.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ export class RoutingAPIStack extends cdk.Stack {
288288
} = new RoutingDatabaseStack(this, 'RoutingDatabaseStack', {})
289289

290290
const { routingLambda, routingLambdaAlias } = new RoutingLambdaStack(this, 'RoutingLambdaStack', {
291+
stage,
291292
poolCacheBucket,
292293
poolCacheBucket2,
293294
poolCacheBucket3,

bin/stacks/routing-lambda-stack.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ import { Construct } from 'constructs'
1313
import * as path from 'path'
1414
import { DynamoDBTableProps } from './routing-database-stack'
1515
import { RetentionDays } from 'aws-cdk-lib/aws-logs'
16+
import { STAGE } from '../../lib/util/stage'
1617

1718
export interface RoutingLambdaStackProps extends cdk.NestedStackProps {
19+
stage: string
1820
poolCacheBucket: aws_s3.Bucket
1921
poolCacheBucket2: aws_s3.Bucket
2022
poolCacheBucket3: aws_s3.Bucket
@@ -48,6 +50,7 @@ export class RoutingLambdaStack extends cdk.NestedStack {
4850
constructor(scope: Construct, name: string, props: RoutingLambdaStackProps) {
4951
super(scope, name, props)
5052
const {
53+
stage,
5154
poolCacheBucket,
5255
poolCacheBucket2,
5356
poolCacheBucket3,
@@ -172,7 +175,8 @@ export class RoutingLambdaStack extends cdk.NestedStack {
172175
// 11/8/23: URA currently calls the Routing API with a timeout of 10 seconds.
173176
// Set this lambda's timeout to be slightly lower to give them time to
174177
// log the response in the event of a failure on our end.
175-
timeout: cdk.Duration.seconds(9),
178+
// Beta uses a higher timeout to allow for more thorough routing exploration.
179+
timeout: cdk.Duration.seconds(stage === STAGE.BETA ? 18 : 9),
176180
memorySize: 5120,
177181
deadLetterQueueEnabled: true,
178182
bundling: {

lib/handlers/router-entities/route-caching/dynamo-route-caching-provider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ export class DynamoRouteCachingProvider extends IRouteCachingProvider {
457457
// requestId is from upstream TAPI
458458
// then we can correlate the async request with the sync request
459459
asyncRequestId: alphaRouterConfig?.requestId,
460+
slippageTolerance: swapOptions?.slippageTolerance,
460461
},
461462
}
462463

lib/util/hooksAddressesAllowlist.ts

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,11 @@ export const ZORA_POST_HOOK_ON_BASE_v1_1_2 = '0x9ea932730a7787000042e34390b8e435
6969
export const ZORA_POST_HOOK_ON_BASE_v2_2 = '0xff74be9d3596ea7a33bb4983dd7906fb34135040'
7070
export const ZORA_POST_HOOK_ON_BASE_v2_2_1 = '0x2b15a16b3ef024005ba899bb51764fcd58cf9040'
7171
export const ZORA_POST_HOOK_ON_BASE_v2_3_0 = '0xc8d077444625eb300a427a6dfb2b1dbf9b159040'
72+
export const ZORA_POST_HOOK_ON_BASE_v2_4_0 = '0xf6d0a13609bb5779bc5d639f2ba3bfda83d4d0c0'
7273

7374
// example pool: https://app.uniswap.org/explore/pools/base/0x9cd78cc37624a69c32bc554d98460f9290bde0a3067583afaa7ec8de0a753ee3
7475
export const DOPPLER_HOOKS_ADDRESS_ON_BASE = '0x77bb2a8f1ab2a384918a4c090cd8ae82dc5078e0'
76+
export const DOPPLER_HOOKS_ADDRESS_ON_BASE_V2 = '0xbb7784a4d481184283ed89619a3e3ed143e1adc0'
7577
export const DOPPLER_HOOKS_ADDRESS_ON_MONAD = '0x580ca49389d83b019d07E17e99454f2F218e2dc0'
7678

7779
// LimitOrderHook addresses: https://linear.app/uniswap/issue/ROUTE-625
@@ -120,6 +122,8 @@ export const AQUINAS_HOOK_ADDRESS_ON_BASE = '0xd3c1f2174f37f88811f99b1b1b4c1356c
120122
// example pool: https://app.uniswap.org/explore/pools/ethereum/0x389a26ef4a4634e55fc4e3ae2149c1cafdbc141af16057ab5fab962c2dca5221
121123
export const ASTERIX_HOOK_ADDRESS_ON_MAINNET = '0xdad7ea85ff786b389a13f4714a56b1721b56c044'
122124

125+
export const AZTEC_HOOK_ADDRESS_ON_MAINNET = '0xd53006d1e3110fd319a79aeec4c527a0d265e080'
126+
123127
// example pool: https://app.uniswap.org/explore/pools/base/0x02aaacb8bf6a4c3c3a99d8de43fad01348e68e314b7773fb2df3edac065e0c4e
124128
export const DELI_HOOK_ADDRESS_ON_BASE = '0x570a48f96035c2874de1c0f13c5075a05683b0cc'
125129
// example pool: https://app.uniswap.org/explore/pools/base/0xa900d06df8073e50a50971720d6d3470d00e64198da3b03c82388f247e0d13c1
@@ -166,6 +170,11 @@ export const RING_FEW_DAI_HOOK_ON_MAINNET = '0x85b648a64aed6307d5d5ce26e6ae086c1
166170
export const RING_FEW_WEETH_HOOK_ON_MAINNET = '0x877323adbf747f85eb8d182d42f01f34a5492888'
167171
// example pool: https://app.uniswap.org/explore/pools/ethereum/0xe7c2f30fd89238331b0e3e6ac6351578d5e3091b7839eff321c29cf88e17274e
168172
export const RING_FEW_WSTETH_HOOK_ON_MAINNET = '0x75ae0292e8ad3ab60b9a1a7b3046d3f4abdfa888'
173+
// example pool BSC: https://app.uniswap.org/explore/pools/bnb/0x085182518e82062e732fcb912becdf7140b42f8da31c7afd850db3c6d4309c8a
174+
export const BVCC_DYNAMIC_FEE_HOOK_ON_BSC = '0x8a36d8408f5285c3f81509947bc187b3c0efd0c4'
175+
export const BVCC_DYNAMIC_FEE_HOOK_ON_MAINNET = '0xf9ced7d0f5292af02385410eda5b7570b10b50c4'
176+
export const BVCC_DYNAMIC_FEE_HOOK_ON_ARBITRUM = '0x2097d7329389264a1542ad50802bb0de84a650c4'
177+
export const BVCC_DYNAMIC_FEE_HOOK_ON_BASE = '0x2c56c1302b6224b2bb1906c46f554622e12f10c4'
169178

170179
// example pool: https://app.uniswap.org/explore/pools/ethereum/0x95caa20ff578db4ceec56162bedc21e31adc70ef717661e11d6d1d74e9b2f844
171180
export const MEME_STRATEGY_HOOK_ON_MAINNET = '0x3ba779bad405d9b68a7a7a86ff6916c806a200cc'
@@ -189,13 +198,29 @@ export const GPO_HOOKS = '0x6cabe2fd9fb60c5afcab7de732b0a224fc382eec'
189198
// example pool: https://app.uniswap.org/explore/pools/base/0xe6b8b2f7320759927c826e663ba1a77eaf8156bad1422234d5282c17c5e8f637
190199
export const GPX_HOOKS = '0x4519e2b040ff1b64fa03abe2aef0bc99d7cceaa8'
191200

201+
// example pool: https://app.uniswap.org/explore/pools/base/0xD532BF016A98A1329B83507B376493B0AEBEF85C89AAF6B505A7070ECDD63CDF
202+
export const LIQUID_LAUNCH_HOOK_ON_BASE = '0xea9346e83952840e69beb36df365c4e68de0e080'
203+
192204
// example pool: https://app.uniswap.org/explore/pools/base/0x20aab1b33d63b7d6fc95deed43dfdf986a23a2d82857025533d2c18e2fef9e4b
193205
export const ARRAKIS_PRIVATE_HOOK_ON_BASE = '0xf9527fb5a34ac6fbc579e4fbc3bf292ed57d4880'
194206
// example pool: https://app.uniswap.org/explore/pools/ethereum/0x8679ef619b4ae7a464f8c208df1c49f294df41a237671d98882b50554c20a5c8
195207
export const ARRAKIS_PRIVATE_HOOK_ON_MAINNET = '0xf9527fb5a34ac6fbc579e4fbc3bf292ed57d4880'
196208

197-
// example pool: https://app.uniswap.org/positions/v4/bnb/215293
209+
// example pool: https://app.uniswap.org/explore/pools/bnb/0xe59ed249748b6a94f36c1995e903acf3489b1a3c8eabb9e2f6ac5c9be545e499
198210
export const WHITELIST_BUY_HOOK_ADDRESS_ON_BSC = '0xabf1f4421f2c4893a7fa9b411c59ddf248508080'
211+
// example pool: https://app.uniswap.org/explore/pools/ethereum/0xe1b5535dda2fc16079a8bfaf408acec9ca7aca84e2e48c3715e51da6ec8051f6
212+
export const CUSTOM_FEE_MEV_PROTECTION_HOOK_ON_MAINNET = '0xD5770936a6678353F1B17C342B29c4416B029080'
213+
214+
// example pool: https://app.uniswap.org/explore/pools/arbitrum/0xec6e37b2d66aa5ef5a9fc296b4da3474b121f512428dd425a51c6424955fc5eb
215+
export const DORY_BURN_AND_MINT_POWER_HOOK_ON_ARBITRUM = '0x6b70fef40d3925881251c018164dBCEC6bc94040'
216+
217+
// example pool: https://app.uniswap.org/explore/pools/base/0xd2e486be751887088da2f4bf76a5872e0810d1bcaf43efec7d4bea3acbc3135a
218+
export const BASEMEME_HOOK_ADDRESS_ON_BASE = '0x755776c51399f7ee15d47ddaf47347d26f5ca840'
219+
220+
// example pool: https://app.uniswap.org/explore/pools/base/0xaca93c6543498289affeab3b3645b0faa3c660d73d76a3d271c8b92339f88589
221+
export const AI_PROTOCOL_SWAP_FEE_HOOK_V1_ON_BASE = '0x121f94835dab08ebaf084809a97e525b69e400cc'
222+
223+
export const CLAUNCH_HOOK_ON_BASE = '0x2f9354bbb0edef5c2a5c4b78d0c59d73412a28cc'
199224

200225
// we do not allow v4 pools with non-zero hook address to be routed through in the initial v4 launch.
201226
// this is the ultimate safeguard in the routing subgraph pool cron job.
@@ -228,6 +253,9 @@ export const HOOKS_ADDRESSES_ALLOWLIST: { [chain in ChainId]: Array<string> } =
228253
MEME_STRATEGY_HOOK_ON_MAINNET,
229254
TOKEN_FLOW_TAX_HOOK_ON_MAINNET,
230255
ARRAKIS_PRIVATE_HOOK_ON_MAINNET,
256+
CUSTOM_FEE_MEV_PROTECTION_HOOK_ON_MAINNET,
257+
BVCC_DYNAMIC_FEE_HOOK_ON_MAINNET,
258+
AZTEC_HOOK_ADDRESS_ON_MAINNET,
231259
],
232260
[ChainId.GOERLI]: [ADDRESS_ZERO],
233261
[ChainId.SEPOLIA]: [ADDRESS_ZERO, extraHooksAddressesOnSepolia, FEY_ON_SEPOLIA],
@@ -241,6 +269,8 @@ export const HOOKS_ADDRESSES_ALLOWLIST: { [chain in ChainId]: Array<string> } =
241269
CLANKER_STATIC_FEE_HOOKS_ADDRESS_ON_ARBITRUM,
242270
WETH_HOOKS_ADDRESS_ON_ARBITRUM,
243271
LIMIT_ORDER_HOOKS_ADDRESS_ON_ARBITRUM,
272+
DORY_BURN_AND_MINT_POWER_HOOK_ON_ARBITRUM,
273+
BVCC_DYNAMIC_FEE_HOOK_ON_ARBITRUM,
244274
],
245275
[ChainId.ARBITRUM_GOERLI]: [ADDRESS_ZERO],
246276
[ChainId.ARBITRUM_SEPOLIA]: [ADDRESS_ZERO],
@@ -252,7 +282,7 @@ export const HOOKS_ADDRESSES_ALLOWLIST: { [chain in ChainId]: Array<string> } =
252282
[ChainId.MOONBEAM]: [ADDRESS_ZERO],
253283
[ChainId.BNB]: [
254284
ADDRESS_ZERO,
255-
WHITELIST_BUY_HOOK_ADDRESS_ON_BSC,
285+
WHITELIST_BUY_HOOK_ADDRESS_ON_BSC,BVCC_DYNAMIC_FEE_HOOK_ON_BSC
256286
],
257287
[ChainId.AVALANCHE]: [ADDRESS_ZERO, AVAXSTRATEGIES_STATIC_FEE_HOOKS_ADDRESS_ON_AVAX],
258288
[ChainId.BASE_GOERLI]: [ADDRESS_ZERO],
@@ -275,6 +305,7 @@ export const HOOKS_ADDRESSES_ALLOWLIST: { [chain in ChainId]: Array<string> } =
275305
CLANKER_STATIC_FEE_HOOKS_ADDRESS_ON_BASE_v2,
276306
WETH_HOOKS_ADDRESS_ON_BASE,
277307
DOPPLER_HOOKS_ADDRESS_ON_BASE,
308+
DOPPLER_HOOKS_ADDRESS_ON_BASE_V2,
278309
LIMIT_ORDER_HOOKS_ADDRESS_ON_BASE,
279310
ZORA_CREATOR_HOOK_ON_BASE_v1,
280311
ZORA_CREATOR_HOOK_ON_BASE_v1_0_0_1,
@@ -292,6 +323,7 @@ export const HOOKS_ADDRESSES_ALLOWLIST: { [chain in ChainId]: Array<string> } =
292323
ZORA_POST_HOOK_ON_BASE_v2_2,
293324
ZORA_POST_HOOK_ON_BASE_v2_2_1,
294325
ZORA_POST_HOOK_ON_BASE_v2_3_0,
326+
ZORA_POST_HOOK_ON_BASE_v2_4_0,
295327
FEY_ON_BASE,
296328
PUBHOUSE_HOOK_ON_BASE,
297329
DELI_HOOK_ADDRESS_ON_BASE,
@@ -300,12 +332,18 @@ export const HOOKS_ADDRESSES_ALLOWLIST: { [chain in ChainId]: Array<string> } =
300332
SUPERSTRATEGY_HOOK_ON_BASE,
301333
SIMPLE_SELL_TAX_HOOK_ON_BASE,
302334
WASSBLASTER_HOOK_ON_BASE,
335+
BVCC_DYNAMIC_FEE_HOOK_ON_BASE,
303336
AEGIS_V3,
304337
FARSTR_HOOKS_ADDRESS_ON_BASE,
305338
ARTACLE_INDEX_TOKEN_HOOK_ON_BASE,
306339
GPO_HOOKS,
307340
GPX_HOOKS,
308341
ARRAKIS_PRIVATE_HOOK_ON_BASE,
342+
BASEMEME_HOOK_ADDRESS_ON_BASE,
343+
AI_PROTOCOL_SWAP_FEE_HOOK_V1_ON_BASE,
344+
LIQUID_LAUNCH_HOOK_ON_BASE,
345+
BVCC_DYNAMIC_FEE_HOOK_ON_BASE,
346+
CLAUNCH_HOOK_ON_BASE,
309347
],
310348
[ChainId.ZORA]: [ADDRESS_ZERO],
311349
[ChainId.ZORA_SEPOLIA]: [ADDRESS_ZERO],

lib/util/v4HooksPoolsFiltering.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
ZORA_POST_HOOK_ON_BASE_v2_2,
2626
ZORA_POST_HOOK_ON_BASE_v2_2_1,
2727
ZORA_POST_HOOK_ON_BASE_v2_3_0,
28+
ZORA_POST_HOOK_ON_BASE_v2_4_0,
2829
} from './hooksAddressesAllowlist'
2930
import { ChainId, Currency, Token } from '@uniswap/sdk-core'
3031
import { PriorityQueue } from '@datastructures-js/priority-queue'
@@ -188,7 +189,8 @@ export function v4HooksPoolsFiltering(chainId: ChainId, pools: Array<V4SubgraphP
188189
pool.hooks.toLowerCase() === ZORA_POST_HOOK_ON_BASE_v1_1_2 ||
189190
pool.hooks.toLowerCase() === ZORA_POST_HOOK_ON_BASE_v2_2 ||
190191
pool.hooks.toLowerCase() === ZORA_POST_HOOK_ON_BASE_v2_2_1 ||
191-
pool.hooks.toLowerCase() === ZORA_POST_HOOK_ON_BASE_v2_3_0) &&
192+
pool.hooks.toLowerCase() === ZORA_POST_HOOK_ON_BASE_v2_3_0 ||
193+
pool.hooks.toLowerCase() === ZORA_POST_HOOK_ON_BASE_v2_4_0) &&
192194
chainId === ChainId.BASE
193195
if (isZoraPool) {
194196
if (pool.tvlETH <= 0.001) {

0 commit comments

Comments
 (0)