Skip to content

Commit

Permalink
fix query
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed May 3, 2024
1 parent d87d6ea commit b040917
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions fees/banana-gun-trading.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ const fethcFeesSolana = async (timestamp: number, _: ChainBlocks, options: Fetch
const todaysTimestamp = getTimestampAtStartOfDayUTC(timestamp);
try {
const dateStr = new Date(todaysTimestamp * 1000).toISOString().split('T')[0];
const value: IFees[] = (await queryDune("3662383"));
const dayItem = value.find((item: any) => item.block_date.split(' ')[0] === dateStr);
const dailyFees = options.createBalances();
const dailyRevenue = options.createBalances();
const fees = (dayItem?.feesSOL || 0) * 1e9;
dailyFees.add('So11111111111111111111111111111111111111112', fees);
dailyRevenue.add('So11111111111111111111111111111111111111112', fees) ;
const value = (await queryDune("3521814", {
start: options.startTimestamp,
end: options.endTimestamp,
receiver: '47hEzz83VFR23rLTEeVm9A7eFzjJwjvdupPPmX3cePqF'
}));
dailyFees.add('So11111111111111111111111111111111111111112', value[0].fee_token_amount);
dailyRevenue.add('So11111111111111111111111111111111111111112', value[0].fee_token_amount);
return {
dailyFees: dailyFees,
dailyRevenue: dailyRevenue,
Expand Down

0 comments on commit b040917

Please sign in to comment.