From b141a0251eb858ef343360e2998e9b59948e0b4d Mon Sep 17 00:00:00 2001 From: 0xpeluche <0xpeluche@protonmail.com> Date: Tue, 20 Aug 2024 09:10:21 +0200 Subject: [PATCH] feat: Adapter Splash (fees) --- fees/splash/index.ts | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 fees/splash/index.ts diff --git a/fees/splash/index.ts b/fees/splash/index.ts new file mode 100644 index 0000000000..e596c41007 --- /dev/null +++ b/fees/splash/index.ts @@ -0,0 +1,32 @@ +// https://docs.splash.trade/concepts/dao/dao-business-model#dao-fees-from-pools + +import axios from "axios"; +import { Adapter, FetchResultV2 } from "../../adapters/types"; +import { CHAIN } from "../../helpers/chains"; + +const url: string = "https://api2.splash.trade/platform-api/v1/platform/stats"; + +const fetch = async (): Promise => { + const { + data: { lpFeeUsd, volumeUsd }, + } = await axios.get(url); + + return { + dailyFees: lpFeeUsd, + dailyRevenue: lpFeeUsd / 2, + dailyVolume: volumeUsd, + }; +}; + +const adapter: Adapter = { + version: 2, + adapter: { + [CHAIN.CARDANO]: { + fetch, + start: 1717452000, + }, + }, + timetravel: false, +}; + +export default adapter;