From 796b68680e0d5d29d5fc0eeabd3bf0034f828aaa Mon Sep 17 00:00:00 2001 From: 0xgnek <0xgnek@gmail.com> Date: Wed, 28 Feb 2024 11:28:40 +0000 Subject: [PATCH] fix increment-swap --- dexs/increment-swap/index.ts | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/dexs/increment-swap/index.ts b/dexs/increment-swap/index.ts index 9a62c7438e..45aa7355f7 100644 --- a/dexs/increment-swap/index.ts +++ b/dexs/increment-swap/index.ts @@ -1,8 +1,6 @@ -import fetchURL from "../../utils/fetchURL" -import { Chain } from "@defillama/sdk/build/general"; -import { SimpleAdapter } from "../../adapters/types"; +import fetchURL from "../../utils/fetchURL"; +import { ChainBlocks, FetchOptions, FetchResultVolume, SimpleAdapter } from "../../adapters/types"; import { CHAIN } from "../../helpers/chains"; -import customBackfill from "../../helpers/customBackfill"; import { getUniqStartOfTodayTimestamp } from "../../helpers/getUniSubgraphVolume"; const historicalVolumeEndpoint = "https://app.increment.fi/info/totalinfos" @@ -13,7 +11,7 @@ interface IVolumeall { } -const fetch = async (timestamp: number) => { +const fetch = async (timestamp: number, _: ChainBlocks, options: FetchOptions): Promise => { const dayTimestamp = getUniqStartOfTodayTimestamp(new Date(timestamp * 1000)) const callhistoricalVolume = (await fetchURL(historicalVolumeEndpoint)).vol; const historicalVolume: IVolumeall[] = callhistoricalVolume.map((e: string[] | number[]) => { @@ -38,24 +36,12 @@ const fetch = async (timestamp: number) => { }; }; -const getStartTimestamp = async () => { - const callhistoricalVolume = (await fetchURL(historicalVolumeEndpoint)).vol; - const historicalVolume: IVolumeall[] = callhistoricalVolume.map((e: string[] | number[]) => { - const [time, volume] = e; - return { - time, - volume - }; - }); - return (new Date(historicalVolume[0].time).getTime()) / 1000 -} const adapter: SimpleAdapter = { adapter: { [CHAIN.FLOW]: { fetch, - start: getStartTimestamp, - // customBackfill: customBackfill(CHAIN.FLOW as Chain, (_chian: string) => fetch) + start: 1650844800, }, }, };