Skip to content

Commit

Permalink
Merge pull request #1793 from 0xpeluche/splash
Browse files Browse the repository at this point in the history
feat: Adapter Splash (fees)
  • Loading branch information
dtmkeng committed Aug 21, 2024
2 parents 2c1eefd + b141a02 commit 4c087e7
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions fees/splash/index.ts
Original file line number Diff line number Diff line change
@@ -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<FetchResultV2> => {
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;

0 comments on commit 4c087e7

Please sign in to comment.