diff --git a/dexs/fluid-dex/index.ts b/dexs/fluid-dex/index.ts index 826aa56eee..67ba3de993 100644 --- a/dexs/fluid-dex/index.ts +++ b/dexs/fluid-dex/index.ts @@ -19,7 +19,17 @@ interface SwapEventArgs { fee: bigint; } -const dexReservesResolver = "0xE8a07a32489BD9d5a00f01A55749Cf5cB854Fd13"; +const dexReservesResolver = (chain: string) => { + switch (chain) { + case CHAIN.ETHEREUM: + return "0xE8a07a32489BD9d5a00f01A55749Cf5cB854Fd13"; + case CHAIN.ARBITRUM: + return "0xb8f526718FF58758E256D9aD86bC194a9ff5986D"; + default: + throw new Error("DexReservesResolver not defined"); + } +} + const abi = { getAllPools: "function getAllPools() view returns (tuple(address pool, address token0, address token1, uint256 fee)[])", @@ -29,7 +39,7 @@ const abi = { const fetch = async ({ api, createBalances, getLogs }: FetchOptions): Promise => { const dailyVolume = createBalances(); const dailyFees = createBalances() - const rawPools: PoolInfo[] = await api.call({ target: dexReservesResolver, abi: abi.getAllPools }); + const rawPools: PoolInfo[] = await api.call({ target: dexReservesResolver(api.chain), abi: abi.getAllPools }); const pools = rawPools.map(({ pool, token0, token1, fee }) => ({ pool, token0, token1, fee: BigInt(fee) })); const logsByPool: SwapEventArgs[][]= await Promise.all( @@ -77,6 +87,7 @@ const adapter: Adapter = { version: 2, adapter: { [CHAIN.ETHEREUM]: { fetch, start: '2024-10-26' }, + [CHAIN.ARBITRUM]: { fetch, start: '2024-12-23' }, }, };