Skip to content

Commit

Permalink
add holding tvl usd.
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-zklink committed Oct 9, 2024
1 parent 78a5be1 commit 8b21a8b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/tvl/tvl.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import projectCategoryConfig from "src/config/projectCategory.config";
import { CategoryTvl } from "src/type/points";
import BigNumber from "bignumber.js";
import { TxDataOfPointsRepository } from "src/repositories/txDataOfPoints.repository";
import { CacheRepository } from "src/repositories/cache.repository";

const HOLDING_TVL_USD = "holdingTvlUsd";

@Injectable()
export class TvlService {
Expand All @@ -12,6 +15,7 @@ export class TvlService {
public constructor(
private readonly projectRepository: ProjectRepository,
private readonly txDataOfPointsRepository: TxDataOfPointsRepository,
private readonly cacheRepository: CacheRepository,
) {
this.logger = new Logger(TvlService.name);
}
Expand All @@ -37,6 +41,13 @@ export class TvlService {
name,
tvl,
}));
const holdingTvlUsd = await this.cacheRepository.getValue(HOLDING_TVL_USD);
if (holdingTvlUsd) {
categoryTvl.push({
name: "holding",
tvl: new BigNumber(holdingTvlUsd),
});
}
return categoryTvl;
}

Expand Down

0 comments on commit 8b21a8b

Please sign in to comment.