From a8d63d9e2099e87862d77afb413c938af2461eaf Mon Sep 17 00:00:00 2001 From: Beralis Dex Date: Fri, 7 Feb 2025 19:31:33 +0200 Subject: [PATCH] add beralis-v3 --- protocols/beralis-v3/index.ts | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 protocols/beralis-v3/index.ts diff --git a/protocols/beralis-v3/index.ts b/protocols/beralis-v3/index.ts new file mode 100644 index 0000000000..f9399b5fa8 --- /dev/null +++ b/protocols/beralis-v3/index.ts @@ -0,0 +1,37 @@ +import { FetchOptions, SimpleAdapter } from "../../adapters/types"; +import { CHAIN } from "../../helpers/chains"; +import { DEFAULT_TOTAL_VOLUME_FIELD, getGraphDimensions2 } from "../../helpers/getUniSubgraph"; + +const v3Endpoints: { [key: string]: string } = { + [CHAIN.BERACHAIN]: "https://api.studio.thegraph.com/query/92670/berav3/version/latest" +} +const v3Graphs = getGraphDimensions2({ + graphUrls: v3Endpoints, + totalVolume: { + factory: "factories", + field: DEFAULT_TOTAL_VOLUME_FIELD, + }, + feesPercent: { + type: "fees", + ProtocolRevenue: 0, + HoldersRevenue: 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 adapters: SimpleAdapter = { + version: 2, + adapter: { + [CHAIN.BERACHAIN]: { + fetch: (options: FetchOptions) => { + return v3Graphs(options.chain)(options) + } + }, + } +} + + +export default adapters; \ No newline at end of file