From c0e8dec4bacf066ed881784dd5912803c0977ca5 Mon Sep 17 00:00:00 2001 From: Oleg Kalenik Date: Tue, 18 Jan 2022 15:51:21 +0200 Subject: [PATCH] #6 - Remove Average TVL - removed both endpoint and service references --- apps/api/src/tvl/dto/tvl-total.dto.ts | 3 --- apps/api/src/tvl/tvl.controller.ts | 15 --------------- apps/api/src/tvl/tvl.service.ts | 20 +------------------- 3 files changed, 1 insertion(+), 37 deletions(-) diff --git a/apps/api/src/tvl/dto/tvl-total.dto.ts b/apps/api/src/tvl/dto/tvl-total.dto.ts index 7508c43..5f76247 100644 --- a/apps/api/src/tvl/dto/tvl-total.dto.ts +++ b/apps/api/src/tvl/dto/tvl-total.dto.ts @@ -5,9 +5,6 @@ export class TvlTotalResponse { @ApiProperty() tvl: TotalMetric; - @ApiProperty() - avgTvl: TotalMetric; - @ApiProperty() bountiesAndGrantsVl: TotalMetric; diff --git a/apps/api/src/tvl/tvl.controller.ts b/apps/api/src/tvl/tvl.controller.ts index f29142a..361c4bf 100644 --- a/apps/api/src/tvl/tvl.controller.ts +++ b/apps/api/src/tvl/tvl.controller.ts @@ -62,21 +62,6 @@ export class TvlController { return this.tvlService.tvlLeaderboard(context); } - @ApiResponse({ - status: 200, - type: MetricResponse, - }) - @ApiBadRequestResponse({ - description: 'Bad Request Response based on the query params set', - }) - @Get('/avg-tvl') - async avgTvl( - @Param(ContractContextPipe) context: ContractContext, - @Query(MetricQueryPipe) metricQuery: MetricQuery, - ): Promise { - return this.tvlService.avgTvl(context, metricQuery); - } - @ApiResponse({ status: 200, type: MetricResponse, diff --git a/apps/api/src/tvl/tvl.service.ts b/apps/api/src/tvl/tvl.service.ts index 95772d3..5de37e9 100644 --- a/apps/api/src/tvl/tvl.service.ts +++ b/apps/api/src/tvl/tvl.service.ts @@ -26,13 +26,8 @@ export class TvlService { async totals( context: DaoContractContext | ContractContext, ): Promise { - const [tvl, avgTvl, bountiesAndGrantsVl, ftsVl] = await Promise.all([ + const [tvl, bountiesAndGrantsVl, ftsVl] = await Promise.all([ this.metricService.total(context, DaoStatsMetricGroup.TotalValueLocked), - this.metricService.total( - context, - DaoStatsMetricGroup.TotalValueLocked, - true, - ), this.metricService.total( context, DaoStatsMetricGroup.BountiesAndGrantsValueLocked, @@ -42,7 +37,6 @@ export class TvlService { return { tvl, - avgTvl, bountiesAndGrantsVl, ftsVl, }; @@ -97,18 +91,6 @@ export class TvlService { ); } - async avgTvl( - context: ContractContext | DaoContractContext, - metricQuery: MetricQuery, - ): Promise { - return this.metricService.history( - context, - metricQuery, - DaoStatsMetricGroup.TotalValueLocked, - true, - ); - } - async bountiesAndGrantsValueLocked( context: ContractContext | DaoContractContext, metricQuery: MetricQuery,