From 107bc526fe1a18b2dcfa3c18eb7bac9881cea5ad Mon Sep 17 00:00:00 2001 From: 0xgnek <0xgnek@gmail.com> Date: Fri, 21 Jul 2023 14:52:08 +0000 Subject: [PATCH] add agni-fi --- dexs/agni-fi/index.ts | 45 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 dexs/agni-fi/index.ts diff --git a/dexs/agni-fi/index.ts b/dexs/agni-fi/index.ts new file mode 100644 index 0000000000..d5ae41cedb --- /dev/null +++ b/dexs/agni-fi/index.ts @@ -0,0 +1,45 @@ +import { SimpleAdapter } from "../../adapters/types"; +import { CHAIN } from "../../helpers/chains"; +import { DEFAULT_TOTAL_VOLUME_FIELD, getGraphDimensions } from "../../helpers/getUniSubgraph"; + +const v3Endpoints = { + [CHAIN.MANTLE]: "https://agni.finance/graph/subgraphs/name/agni/exchange-v3" +} + +const VOLUME_USD = "volumeUSD"; + +const v3Graphs = getGraphDimensions({ + graphUrls: v3Endpoints, + totalVolume: { + factory: "factories", + field: DEFAULT_TOTAL_VOLUME_FIELD, + }, + dailyVolume: { + factory: "pancakeDayData", + field: VOLUME_USD, + }, + dailyFees: { + factory: "pancakeDayData", + field: "feesUSD", + }, + feesPercent: { + type: "fees", + ProtocolRevenue: 0, + HoldersRevenue: 0, + Fees: 0, + UserFees: 100, // User fees are 100% of collected fees + SupplySideRevenue: 100, // 100% of fees are going to LPs + Revenue: 0 // Revenue is 100% of collected fees + } +}); + +const adapter: SimpleAdapter = { + adapter: { + [CHAIN.MANTLE]: { + fetch: v3Graphs(CHAIN.MANTLE), + start: async () => 1689724800, + }, + }, +}; + +export default adapter;