Skip to content

Commit aec795c

Browse files
committed
chore: code improvement
1 parent 76accd9 commit aec795c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/fasset-indexer-api/src/analytics/dashboard.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,9 +553,9 @@ export class DashboardAnalytics extends SharedAnalytics {
553553
protected async aggregateTimeSeries(timeseries: FAssetTimeSeries<bigint>): Promise<TimeSeries<bigint>> {
554554
const em = this.orm.em.fork()
555555
const acc = {} as { [index: number]: { start: number, end: number, value: bigint } }
556-
for (const fasset in timeseries) {
556+
for (const [fasset, ts] of Object.entries(timeseries)) {
557557
const [priceMul, priceDiv] = await fassetToUsdPrice(em, FAssetType[fasset as FAsset])
558-
for (const point of timeseries[fasset as FAsset]) {
558+
for (const point of ts) {
559559
const value = PRICE_FACTOR * point.value * priceMul / priceDiv
560560
if (acc[point.index] === undefined) {
561561
acc[point.index] = { start: point.start, end: point.end, value }

packages/fasset-indexer-api/src/controllers/dashboard.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import type { RedemptionDefault } from 'fasset-indexer-core/entities'
1515
import type {
1616
AmountResult, TimeSeries, Timespan, TokenPortfolio,
1717
FAssetCollateralPoolScore, FAssetValueResult,
18-
FAssetAmountResult, FAssetTimespan, FAssetTimeSeries
18+
FAssetAmountResult, FAssetTimespan
1919
} from '../analytics/interface'
2020

2121

0 commit comments

Comments
 (0)