Skip to content

ROUTE-475 Adding WstETHHook and WETHHook to the new hook allowlist #1106

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
14 changes: 12 additions & 2 deletions lib/util/hooksAddressesAllowlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ export const GRADUATION_HOOKS_ADDRESS_ON_BASE = '0xc5a48b447f01e9ce3ede71e4c1c20
export const COINBASE_VERIFIED_HOOKS_ADDRESS_ON_BASE = '0x5cd525c621AFCa515Bf58631D4733fbA7B72Aae4'
export const BTC_ACC_ON_BASE = '0x704268ac7043aeef50f47b6a03ae68ccf808e044'
export const MEV_TAX_TEST_IN_PROD_ON_UNICHAIN = '0xb9a17e66db950e00822c2b833d6bb304c9b86080'
export const WETH_HOOKS_ADDRESS_ON_MAINNET = '0x57991106cb7aa27e2771beda0d6522f68524a888'
export const WSTETH_HOOKS_ADDRESS_ON_MAINNET = '0xa88aacf73df2bccfabcfd1e7b597185cac9f2888'
export const WETH_HOOKS_ADDRESS_ON_OP_MAINNET = '0x480dafdb4d6092ef3217595b75784ec54b52e888'
export const WETH_HOOKS_ADDRESS_ON_UNICHAIN = '0x730b109bad65152c67ecc94eb8b0968603dba888'
export const WETH_HOOKS_ADDRESS_ON_ARBITRUM = '0x2a4adf825bd96598487dbb6b2d8d882a4eb86888'
export const WETH_HOOKS_ADDRESS_ON_BASE = '0xb08211d57032dd10b1974d4b876851a7f7596888'

// we do not allow v4 pools with non-zero hook address to be routed through in the initial v4 launch.
// this is the ultimate safeguard in the routing subgraph pool cron job.
Expand All @@ -27,17 +33,20 @@ export const HOOKS_ADDRESSES_ALLOWLIST: { [chain in ChainId]: Array<string> } =
BUNNI_HOOKS_ADDRESS_v1_0_ON_L1,
BUNNI_HOOKS_ADDRESS_V1_1_ON_L1,
BUNNI_HOOKS_ADDRESS_V1_1_1_ON_L1,
WETH_HOOKS_ADDRESS_ON_MAINNET,
WSTETH_HOOKS_ADDRESS_ON_MAINNET,
],
[ChainId.GOERLI]: [ADDRESS_ZERO],
[ChainId.SEPOLIA]: [ADDRESS_ZERO, extraHooksAddressesOnSepolia],
[ChainId.OPTIMISM]: [ADDRESS_ZERO],
[ChainId.OPTIMISM]: [ADDRESS_ZERO, WETH_HOOKS_ADDRESS_ON_OP_MAINNET],
[ChainId.OPTIMISM_GOERLI]: [ADDRESS_ZERO],
[ChainId.OPTIMISM_SEPOLIA]: [ADDRESS_ZERO],
[ChainId.ARBITRUM_ONE]: [
ADDRESS_ZERO,
BUNNI_HOOKS_ADDRESS_v1_0_ON_ARBITRUM,
BUNNI_HOOKS_ADDRESS_V1_1_ON_BASE,
BUNNI_HOOKS_ADDRESS_V1_1_1_ON_ARBITRUM,
WETH_HOOKS_ADDRESS_ON_ARBITRUM,
],
[ChainId.ARBITRUM_GOERLI]: [ADDRESS_ZERO],
[ChainId.ARBITRUM_SEPOLIA]: [ADDRESS_ZERO],
Expand All @@ -61,6 +70,7 @@ export const HOOKS_ADDRESSES_ALLOWLIST: { [chain in ChainId]: Array<string> } =
GRADUATION_HOOKS_ADDRESS_ON_BASE,
COINBASE_VERIFIED_HOOKS_ADDRESS_ON_BASE,
BTC_ACC_ON_BASE,
WETH_HOOKS_ADDRESS_ON_BASE,
],
[ChainId.ZORA]: [ADDRESS_ZERO],
[ChainId.ZORA_SEPOLIA]: [ADDRESS_ZERO],
Expand All @@ -69,7 +79,7 @@ export const HOOKS_ADDRESSES_ALLOWLIST: { [chain in ChainId]: Array<string> } =
[ChainId.ZKSYNC]: [ADDRESS_ZERO],
[ChainId.WORLDCHAIN]: [ADDRESS_ZERO],
[ChainId.UNICHAIN_SEPOLIA]: [ADDRESS_ZERO],
[ChainId.UNICHAIN]: [ADDRESS_ZERO, MEV_TAX_TEST_IN_PROD_ON_UNICHAIN],
[ChainId.UNICHAIN]: [ADDRESS_ZERO, MEV_TAX_TEST_IN_PROD_ON_UNICHAIN, WETH_HOOKS_ADDRESS_ON_UNICHAIN],
[ChainId.MONAD_TESTNET]: [ADDRESS_ZERO],
[ChainId.SONEIUM]: [ADDRESS_ZERO],
}
66 changes: 66 additions & 0 deletions lib/util/v4HooksPoolsFiltering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,72 @@ export function v4HooksPoolsFiltering(chainId: ChainId, pools: Array<V4SubgraphP
additionalAllowedPool += 1
}

// MAINNET WETH/ETH
else if (
pool.id.toLowerCase() === '0xf6f2314ac16a878e2bf8ef01ef0a3487e714d397d87f702b9a08603eb3252e92'.toLowerCase() &&
Copy link
Contributor Author

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chainId === ChainId.MAINNET
) {
pool.tvlETH = 57736 // https://app.uniswap.org/explore/pools/ethereum/0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640
pool.tvlUSD = 104153666 // https://app.uniswap.org/explore/pools/ethereum/0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640
log.debug(`Setting tvl for flETH/FLNCH pool ${JSON.stringify(pool)}`)
additionalAllowedPool += 1
}

// MAINNET WSTETH/STETH
else if (
pool.id.toLowerCase() === '0xa9dede2d033cefac744ff7b0cf8c82bbe9cf144c5897f874697a82164c4469d4'.toLowerCase() &&
chainId === ChainId.MAINNET
) {
pool.tvlETH = 57736 // same as MAINNET WETH/ETH https://app.uniswap.org/explore/pools/ethereum/0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640
pool.tvlUSD = 104153666 // same as MAINNET WETH/ETH https://app.uniswap.org/explore/pools/ethereum/0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640
log.debug(`Setting tvl for MAINNET WSTETH/STETH pool ${JSON.stringify(pool)}`)
additionalAllowedPool += 1
}

// OPTIMISM ETH/WETH
else if (
pool.id.toLowerCase() === '0xbf3d38951e485c811bb1fc7025fcd1ef60c15fda4c4163458facb9bedfe26f83'.toLowerCase() &&
chainId === ChainId.OPTIMISM
) {
pool.tvlETH = 826 // https://app.uniswap.org/explore/pools/optimism/0x1fb3cf6e48F1E7B10213E7b6d87D4c073C7Fdb7b
pool.tvlUSD = 1482475 // https://app.uniswap.org/explore/pools/optimism/0x1fb3cf6e48F1E7B10213E7b6d87D4c073C7Fdb7b
log.debug(`Setting tvl for OPTIMISM ETH/WETH pool ${JSON.stringify(pool)}`)
additionalAllowedPool += 1
}

// BASE ETH/WETH
else if (
pool.id.toLowerCase() === '0xbb2aefc6c55a0464b944c0478869527ba1a537f05f90a1bb82e1196c6e9403e2'.toLowerCase() &&
chainId === ChainId.BASE
) {
pool.tvlETH = 6992 // https://app.uniswap.org/explore/pools/base/0xd0b53D9277642d899DF5C87A3966A349A798F224
pool.tvlUSD = 12580000 // https://app.uniswap.org/explore/pools/base/0xd0b53D9277642d899DF5C87A3966A349A798F224
log.debug(`Setting tvl for BASE ETH/WETH pool ${JSON.stringify(pool)}`)
additionalAllowedPool += 1
}

// UNICHAIN ETH/WETH
else if (
pool.id.toLowerCase() === '0xba246b8420b5aeb13e586cd7cbd32279fa7584d7f4cbc9bd356a6bb6200d16a6'.toLowerCase() &&
chainId === ChainId.UNICHAIN
) {
pool.tvlETH = 33482 // https://app.uniswap.org/explore/pools/unichain/0x3258f413c7a88cda2fa8709a589d221a80f6574f63df5a5b6774485d8acc39d9
pool.tvlUSD = 60342168 // https://app.uniswap.org/explore/pools/unichain/0x3258f413c7a88cda2fa8709a589d221a80f6574f63df5a5b6774485d8acc39d9
log.debug(`Setting tvl for UNICHAIN ETH/WETH pool ${JSON.stringify(pool)}`)
additionalAllowedPool += 1
}

// ARBITRUM ETH/WETH
else if (
pool.id.toLowerCase() === '0xc1c777843809a8e77a398fd79ecddcefbdad6a5676003ae2eedf3a33a56589e9'.toLowerCase() &&
chainId === ChainId.ARBITRUM_ONE
) {
pool.tvlETH = 23183 // https://app.uniswap.org/explore/pools/arbitrum/0xC6962004f452bE9203591991D15f6b388e09E8D0
pool.tvlUSD = 41820637 // https://app.uniswap.org/explore/pools/arbitrum/0xC6962004f452bE9203591991D15f6b388e09E8D0
log.debug(`Setting tvl for ARBITRUM ETH/WETH pool ${JSON.stringify(pool)}`)
additionalAllowedPool += 1
}

// USDT/USDC
if (
pool.id.toLowerCase() === '0xfcb95f2277ef9524fb6a2e2c38209a7a3b955c34c933d2cdb570c1e9240fc475'.toLowerCase() &&
Expand Down