Skip to content
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
218 changes: 13 additions & 205 deletions lib/cron/cache-pools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { metricScope } from 'aws-embedded-metrics'
import * as zlib from 'zlib'
import dotenv from 'dotenv'
import { v4HooksPoolsFiltering } from '../util/v4HooksPoolsFiltering'
import { BUNNI_POOLS_CONFIG } from '../util/bunni-pools'
import { HOOK_POOLS_DATA } from '../util/hooksAddressesAllowlist'

// Needed for local stack dev, not needed for staging or prod
// But it still doesn't work on the local cdk stack update,
Expand Down Expand Up @@ -230,71 +230,18 @@ const handler: ScheduledHandler = metricScope((metrics) => async (event: EventBr
}

if (protocol === Protocol.V4) {
const manuallyIncludedV4Pools: V4SubgraphPool[] = [
{
id: '0xe9eeab9794c33dff3dd8d0951cbe2d36619294af5a3a329f38f91f54be0b6d34',
feeTier: '10000',
tickSpacing: '200',
hooks: '0xc5a48b447f01e9ce3ede71e4c1c2038c38bd9000',
liquidity: '274563705100803912362733',
token0: {
symbol: 'fid:385955',
id: '0x112cf1cc540eadf234158c0e4044c3b5f2a33e5e',
name: 'degenfans',
decimals: '18',
},
token1: {
symbol: 'MOXIE',
id: '0x8c9037d1ef5c6d1f6816278c7aaf5491d24cd527',
name: 'Moxie',
decimals: '18',
},
tvlETH: 25.33120577965346308313185954009482,
tvlUSD: 56627.5525783346590219799350683533,
} as V4SubgraphPool,
{
id: '0x6bac01f0a8fb96eeb56e37506f210628714561113c748d43c6de50dc339edfe9',
feeTier: '10000',
tickSpacing: '200',
hooks: '0xc5a48b447f01e9ce3ede71e4c1c2038c38bd9000',
liquidity: '621568112474979678301274',
token0: {
symbol: 'base-economy',
id: '0x125490489a27d541e39813c08d260debac071bb7',
name: 'Base Economy',
decimals: '18',
},
token1: {
symbol: 'MOXIE',
id: '0x8c9037d1ef5c6d1f6816278c7aaf5491d24cd527',
name: 'Moxie',
decimals: '18',
},
tvlETH: 142.7576163222032969740638595951846,
tvlUSD: 316322.6881520965844428159264274397,
} as V4SubgraphPool,
{
id: '0x31781e65a4bd9ff0161e660f7930beee16026f819cd4d0bc7e17f6c78c29fc27',
feeTier: '10000',
tickSpacing: '200',
hooks: '0xc5a48b447f01e9ce3ede71e4c1c2038c38bd9000',
liquidity: '482843960670027606548690',
token0: {
symbol: 'fid:444067',
id: '0x15148da22518e40e0d2fabf5d5e6a22269ebcb30',
name: 'macster',
decimals: '18',
},
token1: {
symbol: 'MOXIE',
id: '0x8c9037d1ef5c6d1f6816278c7aaf5491d24cd527',
name: 'Moxie',
decimals: '18',
},
tvlETH: 44.1795925485023741879813651641809,
tvlUSD: 95050.95363442908526427214106054717,
} as V4SubgraphPool,
]
// Add all pools which are included in HookLists and have all required V4SubgraphPool fields
const manuallyIncludedV4Pools: V4SubgraphPool[] = HOOK_POOLS_DATA.filter(
(poolData) =>
poolData.feeTier &&
poolData.tickSpacing &&
poolData.hooks &&
poolData.liquidity &&
poolData.token0 &&
poolData.token1 &&
poolData.tvlETH !== undefined &&
poolData.tvlUSD !== undefined
) as V4SubgraphPool[]

if (eulerHooksProvider) {
const eulerHooks = await eulerHooksProvider?.getHooks()
Expand Down Expand Up @@ -322,145 +269,6 @@ const handler: ScheduledHandler = metricScope((metrics) => async (event: EventBr
}
}

for (const bunniPool of BUNNI_POOLS_CONFIG) {
if (bunniPool.chainId === chainId) {
manuallyIncludedV4Pools.push({
id: bunniPool.id,
feeTier: bunniPool.feeTier,
tickSpacing: bunniPool.tickSpacing,
hooks: bunniPool.hooks,
liquidity: bunniPool.liquidity,
token0: {
...bunniPool.token0,
},
token1: {
...bunniPool.token1,
},
tvlETH: bunniPool.tvlETH,
tvlUSD: bunniPool.tvlUSD,
} as V4SubgraphPool)
}
}

if (chainId === ChainId.UNICHAIN) {
// UNICHAIN ETH/WETH: https://uniscan.xyz/tx/0x935979a7e4a1e3ea92b180009c46242b89a787fb4f2f5799bd53c675d5e0f9fd#eventlog
manuallyIncludedV4Pools.push({
id: '0xba246b8420b5aeb13e586cd7cbd32279fa7584d7f4cbc9bd356a6bb6200d16a6',
feeTier: '0',
tickSpacing: '1',
hooks: '0x730b109bad65152c67ecc94eb8b0968603dba888',
liquidity: '173747248900',
token0: {
symbol: 'ETH',
id: '0x0000000000000000000000000000000000000000',
name: 'Ethereum',
decimals: '18',
},
token1: {
symbol: 'WETH',
id: '0x4200000000000000000000000000000000000006',
name: 'Wrapped Ether',
decimals: '18',
},
tvlETH: 33482,
tvlUSD: 60342168,
} as V4SubgraphPool)
}

if (chainId === ChainId.OPTIMISM) {
// OPTIMISM ETH/WETH: https://optimistic.etherscan.io/tx/0x5f81f2aa19a50a76a94a30d3d2a9540cb3cd8597c94499a50330e4b6acbef5c1#eventlog
manuallyIncludedV4Pools.push({
id: '0xbf3d38951e485c811bb1fc7025fcd1ef60c15fda4c4163458facb9bedfe26f83',
feeTier: '0',
tickSpacing: '1',
hooks: '0x480dafdb4d6092ef3217595b75784ec54b52e888',
liquidity: '173747248900',
token0: {
symbol: 'ETH',
id: '0x0000000000000000000000000000000000000000',
name: 'Ethereum',
decimals: '18',
},
token1: {
symbol: 'WETH',
id: '0x4200000000000000000000000000000000000006',
name: 'Wrapped Ether',
decimals: '18',
},
tvlETH: 826,
tvlUSD: 1482475,
} as V4SubgraphPool)
}

if (chainId === ChainId.BASE) {
// BASE ETH/WETH: https://basescan.org/tx/0x221b6521ee4a19a25a424ecfb36b58b0b68fce7cda106bf4551d1424b0867bcc#eventlog
manuallyIncludedV4Pools.push({
id: '0xbb2aefc6c55a0464b944c0478869527ba1a537f05f90a1bb82e1196c6e9403e2',
feeTier: '0',
tickSpacing: '1',
hooks: '0xb08211d57032dd10b1974d4b876851a7f7596888',
liquidity: '173747248900',
token0: {
symbol: 'ETH',
id: '0x0000000000000000000000000000000000000000',
name: 'Ethereum',
decimals: '18',
},
token1: {
symbol: 'WETH',
id: '0x4200000000000000000000000000000000000006',
name: 'Wrapped Ether',
decimals: '18',
},
tvlETH: 6992,
tvlUSD: 12580000,
} as V4SubgraphPool)
}

if (chainId === ChainId.ARBITRUM_ONE) {
// ARBITRUM ETH/WETH: https://arbiscan.io/tx/0x0b393d141a3770292ae8508626a4443307403b0b958b7d0eff70fca2fb85c106#eventlog
manuallyIncludedV4Pools.push({
id: '0xc1c777843809a8e77a398fd79ecddcefbdad6a5676003ae2eedf3a33a56589e9',
feeTier: '0',
tickSpacing: '1',
hooks: '0x2a4adf825bd96598487dbb6b2d8d882a4eb86888',
liquidity: '173747248900',
token0: {
id: '0x0000000000000000000000000000000000000000',
},
token1: {
id: '0x82af49447d8a07e3bd95bd0d56f35241523fbab1',
},
tvlETH: 23183,
tvlUSD: 41820637,
} as V4SubgraphPool)
}

if (chainId === ChainId.MAINNET) {
// Mainnet ETH/WETH: https://app.uniswap.org/explore/pools/ethereum/0xf6f2314ac16a878e2bf8ef01ef0a3487e714d397d87f702b9a08603eb3252e92
manuallyIncludedV4Pools.push({
id: '0xf6f2314ac16a878e2bf8ef01ef0a3487e714d397d87f702b9a08603eb3252e92',
feeTier: '0',
tickSpacing: '1',
hooks: '0x57991106cb7aa27e2771beda0d6522f68524a888',
liquidity: '482843960670027606548690',
token0: {
symbol: 'ETH',
id: '0x0000000000000000000000000000000000000000',
name: 'ETH',
decimals: '18',
},
token1: {
symbol: 'WETH',
id: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
name: 'WETH',
decimals: '18',
},
tvlETH: 44000.1795925485023741879813651641809,
tvlUSD: 95050000.95363442908526427214106054717,
} as V4SubgraphPool)
}

manuallyIncludedV4Pools.forEach((pool) => pools.push(pool))

pools = v4HooksPoolsFiltering(chainId, pools as Array<V4SubgraphPool>)
Expand Down
Loading
Loading