From 491c7759b112551ebfb72bf83af6fd57cbd6b8e5 Mon Sep 17 00:00:00 2001 From: 0xgnek <0xgnek@gmail.com> Date: Fri, 22 Mar 2024 16:28:36 +0000 Subject: [PATCH] add warpgate --- dexs/warpgate/index.ts | 31 +++++++++++++++++++++++++++++++ helpers/chains.ts | 3 ++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 dexs/warpgate/index.ts diff --git a/dexs/warpgate/index.ts b/dexs/warpgate/index.ts new file mode 100644 index 0000000000..2921bff72a --- /dev/null +++ b/dexs/warpgate/index.ts @@ -0,0 +1,31 @@ +import { SimpleAdapter } from "../../adapters/types"; +import { getChainVolume } from "../../helpers/getUniSubgraphVolume"; +import { CHAIN } from "../../helpers/chains"; + +const endpoints = { + [CHAIN.IMX]: "https://subgraph.warpgate.pro/subgraphs/name/warpgate/subgraph-v3", +}; + +const graphs = getChainVolume({ + graphUrls: endpoints, + totalVolume: { + factory: "factories", + field: "totalVolumeUSD", + }, + dailyVolume: { + factory: "uniswapDayData", + field: "volumeUSD", + }, +}); + +const adapter: SimpleAdapter = { + version: 2, + adapter: { + [CHAIN.IMX]: { + fetch: graphs(CHAIN.IMX), + start: 1708041600 + }, + }, +}; + +export default adapter; diff --git a/helpers/chains.ts b/helpers/chains.ts index 0cf2d50f1b..d9a9a987c6 100644 --- a/helpers/chains.ts +++ b/helpers/chains.ts @@ -139,7 +139,8 @@ export enum CHAIN { ZETA = "zeta", ASTAR_ZKEVM = "astrzk", FILECOIN = "filecoin", - FRAXTAL = "fraxtal" + FRAXTAL = "fraxtal", + IMX = "imx", } // DonĀ“t use