Skip to content

Commit

Permalink
Merge pull request #10 from near-daos/feature/remove_avg_tvl
Browse files Browse the repository at this point in the history
#6 - Remove Average TVL
  • Loading branch information
okalenyk authored Jan 19, 2022
2 parents 8d577c8 + c0e8dec commit 2be7109
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 37 deletions.
3 changes: 0 additions & 3 deletions apps/api/src/tvl/dto/tvl-total.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ export class TvlTotalResponse {
@ApiProperty()
tvl: TotalMetric;

@ApiProperty()
avgTvl: TotalMetric;

@ApiProperty()
bountiesAndGrantsVl: TotalMetric;

Expand Down
15 changes: 0 additions & 15 deletions apps/api/src/tvl/tvl.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<MetricResponse> {
return this.tvlService.avgTvl(context, metricQuery);
}

@ApiResponse({
status: 200,
type: MetricResponse,
Expand Down
20 changes: 1 addition & 19 deletions apps/api/src/tvl/tvl.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,8 @@ export class TvlService {
async totals(
context: DaoContractContext | ContractContext,
): Promise<TvlTotalResponse> {
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,
Expand All @@ -42,7 +37,6 @@ export class TvlService {

return {
tvl,
avgTvl,
bountiesAndGrantsVl,
ftsVl,
};
Expand Down Expand Up @@ -97,18 +91,6 @@ export class TvlService {
);
}

async avgTvl(
context: ContractContext | DaoContractContext,
metricQuery: MetricQuery,
): Promise<MetricResponse> {
return this.metricService.history(
context,
metricQuery,
DaoStatsMetricGroup.TotalValueLocked,
true,
);
}

async bountiesAndGrantsValueLocked(
context: ContractContext | DaoContractContext,
metricQuery: MetricQuery,
Expand Down

0 comments on commit 2be7109

Please sign in to comment.