From 11a9aeb790a4bc69d06f7b5a71d0c71f2c284d1a Mon Sep 17 00:00:00 2001 From: 0xgnek <0xgnek@gmail.com> Date: Wed, 12 Jul 2023 11:16:34 +0000 Subject: [PATCH] fix add daily bribes --- adapters/types.ts | 3 ++- fees/velodrome/index.ts | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/adapters/types.ts b/adapters/types.ts index 3ea616747e..2e3f5c43d1 100644 --- a/adapters/types.ts +++ b/adapters/types.ts @@ -82,6 +82,7 @@ export type FetchResultFees = FetchResultBase & { totalProtocolRevenue?: string | IJSON; totalSupplySideRevenue?: string | IJSON; totalUserFees?: string | IJSON; + dailyBribesRevenue?: string | IJSON; }; // INCENTIVES @@ -121,4 +122,4 @@ export type FetchResult = FetchResultVolume & FetchResultFees & FetchResultAggre export interface IJSON { [key: string]: T -} \ No newline at end of file +} diff --git a/fees/velodrome/index.ts b/fees/velodrome/index.ts index 6efc56f9d2..6eae7e5211 100644 --- a/fees/velodrome/index.ts +++ b/fees/velodrome/index.ts @@ -1,4 +1,4 @@ -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'; @@ -6,7 +6,7 @@ import { fees_bribes } from './bribes'; import { getBlock } from '../../helpers/getBlock'; -const getFees = async (timestamp: number) => { +const getFees = async (timestamp: number): Promise => { const fromTimestamp = timestamp - 60 * 60 * 24 const toTimestamp = timestamp const fromBlock = (await getBlock(fromTimestamp, CHAIN.OPTIMISM, {})); @@ -19,6 +19,7 @@ const getFees = async (timestamp: number) => { dailyFees: `${dailyFees}`, dailyRevenue: `${dailyRevenue}`, dailyHoldersRevenue: `${dailyHoldersRevenue}`, + dailyBribesRevenue: `${bribes}`, timestamp } }