From 81bf2c88a3bff1033f362fc827ad5c10aba937d9 Mon Sep 17 00:00:00 2001 From: g1ntoki <99907941+g1nt0ki@users.noreply.github.com> Date: Thu, 19 Sep 2024 14:49:15 +0200 Subject: [PATCH] remove unused code --- dexs/Omnidrome/index.ts | 54 +---------------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) diff --git a/dexs/Omnidrome/index.ts b/dexs/Omnidrome/index.ts index 1492b86bd2..622c264c26 100644 --- a/dexs/Omnidrome/index.ts +++ b/dexs/Omnidrome/index.ts @@ -1,60 +1,8 @@ -import { DISABLED_ADAPTER_KEY, FetchOptions, FetchResultVolume, SimpleAdapter } from "../../adapters/types" +import { DISABLED_ADAPTER_KEY, SimpleAdapter } from "../../adapters/types" import { CHAIN } from "../../helpers/chains" import disabledAdapter from "../../helpers/disabledAdapter"; -const lphelper = '0x1f176AABA9c6e2014455E5C199afD15A70f9e34e'; -const abis: any = { - "forSwaps": "function forSwaps(uint256 _limit, uint256 _offset) view returns ((address lp, bool stable, address token0, address token1, address factory, uint256 poolFee)[])" -} - -interface IForSwap { - lp: string; - token0: string; - token1: string; -} - -interface ILog { - address: string; - data: string; - transactionHash: string; - topics: string[]; -} -const event_swap = 'event Swap(address indexed sender,address indexed to,uint256 amount0In,uint256 amount1In,uint256 amount0Out,uint256 amount1Out)' - -const fetch = async (timestamp: number, _: any, { api, getLogs, createBalances, }: FetchOptions): Promise => { - const dailyVolume = createBalances() - const forSwaps: IForSwap[] = (await api.call({ - target: lphelper, - params: [1000, 0], - abi: abis.forSwaps, - chain: CHAIN.ZETA, - })).map((e: any) => { - return { - lp: e.lp, - token0: e.token0, - token1: e.token1, - } - }) - - const targets = [...new Set(forSwaps.map((forSwap: IForSwap) => forSwap.lp))] - - const logs: ILog[][] = await getLogs({ - targets, - eventAbi: event_swap, - flatten: false, - }) - - logs.forEach((logs: ILog[], idx: number) => { - const { token0, token1 } = forSwaps[idx] - logs.forEach((log: any) => { - dailyVolume.add(token0, log.amount0Out) - dailyVolume.add(token1, log.amount1Out) - }) - }) - - return { dailyVolume, timestamp } -} const adapters: SimpleAdapter = { adapter: { [DISABLED_ADAPTER_KEY]: disabledAdapter,