Skip to content

Commit

Permalink
fix add daily bribes
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Jul 12, 2023
1 parent 931919d commit 11a9aeb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion adapters/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export type FetchResultFees = FetchResultBase & {
totalProtocolRevenue?: string | IJSON<string>;
totalSupplySideRevenue?: string | IJSON<string>;
totalUserFees?: string | IJSON<string>;
dailyBribesRevenue?: string | IJSON<string>;
};

// INCENTIVES
Expand Down Expand Up @@ -121,4 +122,4 @@ export type FetchResult = FetchResultVolume & FetchResultFees & FetchResultAggre

export interface IJSON<T> {
[key: string]: T
}
}
5 changes: 3 additions & 2 deletions fees/velodrome/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Adapter } from '../../adapters/types';
import { Adapter, Fetch, FetchResultFees } from '../../adapters/types';
import { CHAIN, OPTIMISM } from '../../helpers/chains';
import { fetchV1 } from './velodrome';
import { fetchV2 } from './velodrome-v2';
import { fees_bribes } from './bribes';
import { getBlock } from '../../helpers/getBlock';


const getFees = async (timestamp: number) => {
const getFees = async (timestamp: number): Promise<FetchResultFees> => {
const fromTimestamp = timestamp - 60 * 60 * 24
const toTimestamp = timestamp
const fromBlock = (await getBlock(fromTimestamp, CHAIN.OPTIMISM, {}));
Expand All @@ -19,6 +19,7 @@ const getFees = async (timestamp: number) => {
dailyFees: `${dailyFees}`,
dailyRevenue: `${dailyRevenue}`,
dailyHoldersRevenue: `${dailyHoldersRevenue}`,
dailyBribesRevenue: `${bribes}`,
timestamp
}
}
Expand Down

0 comments on commit 11a9aeb

Please sign in to comment.