From a8e15f81f0dc247a3240b38820a53b4bc15ae227 Mon Sep 17 00:00:00 2001 From: jejolare Date: Fri, 1 Aug 2025 17:19:21 +0700 Subject: [PATCH] update involvedPairs calculation --- src/controllers/stats.controller.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/controllers/stats.controller.ts b/src/controllers/stats.controller.ts index b0d4f01..2de2cbf 100644 --- a/src/controllers/stats.controller.ts +++ b/src/controllers/stats.controller.ts @@ -250,8 +250,14 @@ class StatsController { {} as Record, ); + const daysInPeriod = Math.ceil( + (to_timestamp_parsed - from_timestamp_parsed) / (24 * 60 * 60 * 1000), + ); + + const requiredVolumePerDay = MIN_VOLUME_THRESHOLD / 30; + const involvedPairs = Object.keys(pairVolumes).filter( - (pairId) => pairVolumes[Number(pairId)] > MIN_VOLUME_THRESHOLD, + (pairId) => pairVolumes[Number(pairId)] >= requiredVolumePerDay * daysInPeriod, ); const entries = Object.entries(pairVolumes);