Skip to content

Commit

Permalink
fix all time fees for gTrade (#2067)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xCrumb authored Nov 2, 2024
1 parent 0ca588a commit cff2255
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions fees/gains-network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ interface IStats {
all_fees: number;
borrowing_fee: number;
rollover_fee: number;
cumul_fees: number; // all time chain fees

// gTokens
dai_stakers: number;
Expand All @@ -25,7 +26,7 @@ interface IStats {
// GNS staking
gns_stakers: number;
}
const requests: any = {}
const requests: any = {};

export async function fetchURLWithRetry(url: string, options: FetchOptions) {
const start = options.startTimestamp;
Expand All @@ -35,8 +36,8 @@ export async function fetchURLWithRetry(url: string, options: FetchOptions) {
requests[key] = queryDune("4192496", {
start: start,
end: end,
})
return requests[key]
});
return requests[key];
}

const fetch = async (timestamp: number, _: ChainBlocks, options: FetchOptions): Promise<FetchResultFees> => {
Expand All @@ -48,7 +49,7 @@ const fetch = async (timestamp: number, _: ChainBlocks, options: FetchOptions):
chainStat.dev_fund + chainStat.project_fund + chainStat.gns_stakers,
chainStat.gns_stakers,
chainStat.dai_stakers + chainStat.usdc_stakers + chainStat.weth_stakers,
chainStat.all_fees + chainStat.rollover_fee + chainStat.borrowing_fee,
chainStat.cumul_fees,
]
: [0, 0, 0, 0, 0];

Expand All @@ -58,7 +59,7 @@ const fetch = async (timestamp: number, _: ChainBlocks, options: FetchOptions):
dailyRevenue,
dailyHoldersRevenue,
dailySupplySideRevenue,
// totalFees, // seem to be wrong
totalFees,
};
};

Expand Down

0 comments on commit cff2255

Please sign in to comment.