diff --git a/dexs/logx/index.ts b/dexs/logx/index.ts index 2045fdcad9..f3eb4e06ad 100644 --- a/dexs/logx/index.ts +++ b/dexs/logx/index.ts @@ -1,81 +1,31 @@ import fetchURL from "../../utils/fetchURL"; -import { BreakdownAdapter, ChainBlocks, Fetch, FetchOptions, FetchResult, SimpleAdapter } from "../../adapters/types"; -import { CHAIN } from "../../helpers/chains"; -import { adapterAgg } from './logx-aggregator/index' +import { FetchResult, SimpleAdapter } from "../../adapters/types"; -const URL = "https://backend-lp.logx.trade/defillama"; - -const chain_ids: { [chain: string]: string } = { - [CHAIN.MANTLE]: "5000", - [CHAIN.MODE]: "34443", - [CHAIN.BLAST]: "81457", - [CHAIN.LINEA]: "59144", - [CHAIN.KROMA]: "255", - [CHAIN.MANTA]: "169", - [CHAIN.TELOS]: "40", - [CHAIN.FUSE]: "122", -} +const URLEndpoint = "https://apiserver.logx.network/api/v1/stats/defillama?endTime="; +const startTimestamp = 1725580800; // 06.09.2024 interface IAPIResponse { - dailyVolume: string; - totalVolume: string; + last24HourVolume: string; + totalVolume: string; } - -const getFetch = async (timestamp: number, _: ChainBlocks, { createBalances, getLogs, chain, api }: FetchOptions): Promise => { - const { dailyVolume, totalVolume }: IAPIResponse = ( - await fetchURL(`${URL}?chainId=${chain_ids[chain]}×tamp=${timestamp}`) - ); - return { - dailyVolume, - totalVolume, - timestamp, - }; +const fetch = async (timestamp: number): Promise => { + const { last24HourVolume, totalVolume }: IAPIResponse = ( + await fetchURL(`${URLEndpoint}${timestamp}`) + ); + return { + totalVolume: totalVolume, + dailyVolume: last24HourVolume, + timestamp: timestamp }; +}; -const adapter: any = { - adapter: { - [CHAIN.MANTLE]: { - fetch: getFetch, - start: 1701475200, - }, - [CHAIN.MODE]: { - fetch: getFetch, - start: 1707436800, - }, - [CHAIN.BLAST]: { - fetch: getFetch, - start: 1709337600, - }, - [CHAIN.LINEA]: { - fetch: getFetch, - start: 1701475200, - }, - [CHAIN.KROMA]: { - fetch: getFetch, - start: 1703548800, - }, - [CHAIN.MANTA]: { - fetch: getFetch, - start: 1705968000, - }, - [CHAIN.TELOS]: { - fetch: getFetch, - start: 1706522866, - }, - [CHAIN.FUSE]: { - fetch: getFetch, - start: 1706659200, - }, +const adapter: SimpleAdapter = { + adapter: { + "logx network": { + fetch, + start: startTimestamp, }, - }; - - - -const adapterBreakdown: BreakdownAdapter = { - breakdown: { - "derivative": adapter["adapter"], - "logx-aggregator": adapterAgg["adapter"], } -} +}; -export default adapterBreakdown; +export default adapter; \ No newline at end of file diff --git a/dexs/logx/logx-aggregator/index.ts b/dexs/logx/logx-aggregator/index.ts deleted file mode 100644 index ce70a69301..0000000000 --- a/dexs/logx/logx-aggregator/index.ts +++ /dev/null @@ -1,34 +0,0 @@ -import fetchURL from "../../../utils/fetchURL"; -import { FetchResult, SimpleAdapter } from "../../../adapters/types"; -import { CHAIN } from "../../../helpers/chains"; - -const URL = "https://logx-data-analytics-xmxmxbqxaq-uc.a.run.app/"; -const endpoint = "defillama/defillama/"; -const startTimestamp = 1686205277; // 08.06.2023 - -interface IAPIResponse { - dailyVolume: string; - totalVolume: string; -} -const fetch = async (timestamp: number): Promise => { - const { dailyVolume, totalVolume }: IAPIResponse = ( - await fetchURL(`${URL}${endpoint}${timestamp}`) - ); - return { - dailyVolume, - totalVolume, - timestamp, - }; -}; - -const adapterAgg: any = { - adapter: { - [CHAIN.ARBITRUM]: { - fetch, - start: startTimestamp, - }, - }, -}; -export { - adapterAgg -}