Skip to content

Commit

Permalink
re-add totalFees
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Lucky committed Jan 17, 2025
1 parent e4cd04b commit 311803c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion fees/goplus.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
import { FetchOptions, SimpleAdapter } from "../adapters/types";
import { CHAIN } from "../helpers/chains";
import { queryDune } from "../helpers/dune";
import { addTokensReceived } from "../helpers/token";
import moment from "moment";

const GOPLUS_FOUNDATION = "0x34ebddd30ccbd3f1e385b41bdadb30412323e34f";
const GOPLUS_REVENUE_POOL = "0x648d7f4ad39186949e37e9223a152435ab97706c";

const fetch = async (options: FetchOptions) => {
const dailyFees = options.createBalances();
const totalFees = options.createBalances();

await addTokensReceived({ balances: dailyFees, target: GOPLUS_FOUNDATION, options, })
await addTokensReceived({ balances: dailyFees, target: GOPLUS_REVENUE_POOL, options, })

return { dailyFees, dailyRevenue: dailyFees, dailyProtocolRevenue: dailyFees };
let startDate = new Date();
startDate.setTime(options.startTimestamp * 1000);
let start = moment(startDate).format("YYYY-MM-DD hh:mm:ss");
const values = await queryDune("4581834", {
end: start
})
values.forEach((e: { contract_address: string; amount_raw: string; }) => {
totalFees.add(e.contract_address, e.amount_raw);
});

return { dailyFees, totalFees, dailyRevenue: dailyFees, dailyProtocolRevenue: dailyFees, totalProtocolRevenue: totalFees };
};

const adapter: SimpleAdapter = {
Expand Down

0 comments on commit 311803c

Please sign in to comment.