Skip to content

Commit

Permalink
Merge pull request #2089 from stabbleorg/master
Browse files Browse the repository at this point in the history
Add fees for stabble.org
  • Loading branch information
dtmkeng authored Nov 13, 2024
2 parents e419a70 + 999d5dd commit bde3f72
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions fees/stabble/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { CHAIN } from "../../helpers/chains";
import { Adapter, FetchOptions, FetchV2 } from "../../adapters/types";
import fetchURL from "../../utils/fetchURL";

const feesURL = "https://api.stabble.org/stats/fees";

interface DailyStats {
revenue: number;
fees: number;
}

const fetch: FetchV2 = async (options: FetchOptions) => {
const url = `${feesURL}?startTimestamp=${options.startTimestamp}&endTimestamp=${options.endTimestamp}`;
const stats: DailyStats = await fetchURL(url);

return {
dailyFees: stats.fees,
dailyRevenue: stats.revenue,
};
};

const adapter: Adapter = {
version: 2,
adapter: {
[CHAIN.SOLANA]: {
fetch: fetch,
runAtCurrTime: true,
start: 1717563162,
},
},
};

export default adapter;

0 comments on commit bde3f72

Please sign in to comment.