From da313c844eeb000cfb04daef76596c5ff271e3b8 Mon Sep 17 00:00:00 2001 From: 0xgnek <0xgnek@gmail.com> Date: Tue, 7 Jan 2025 13:48:10 +0000 Subject: [PATCH] add volboost --- fees/volboost.ts | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 fees/volboost.ts diff --git a/fees/volboost.ts b/fees/volboost.ts new file mode 100644 index 0000000000..8750285b7e --- /dev/null +++ b/fees/volboost.ts @@ -0,0 +1,41 @@ +import { FetchOptions, SimpleAdapter } from "../adapters/types"; +import { CHAIN } from "../helpers/chains" +import { addTokensReceived } from "../helpers/token"; + +const contracts: any = { + [CHAIN.ETHEREUM]: '0x3b18167886fc10dc1FDE2e5dD9d5afD36f40f538', + [CHAIN.BSC]: '0x3b18167886fc10dc1FDE2e5dD9d5afD36f40f538', + [CHAIN.BASE]: '0x3b18167886fc10dc1FDE2e5dD9d5afD36f40f538', +} + +const chains = [ + CHAIN.ETHEREUM, + CHAIN.BASE, + CHAIN.BSC, +]; + +const fetchFees = async (options: FetchOptions) => { + const dailyFees = await addTokensReceived({ + options, + target: contracts[options.chain], + }); + dailyFees.resizeBy(0.5) + return { + dailyFees, + dailyRevenue: dailyFees, + }; +}; + +const adapter: SimpleAdapter = { + version: 2, + adapter: chains.reduce((acc, chain) => { + return { + ...acc, + [chain]: { + fetch: fetchFees, + }, + }; + }, {}), +}; + +export default adapter;