fix total stats volume filter

This commit is contained in:
jejolare 2025-07-28 17:40:00 +07:00
parent f46d21d831
commit 33c7f389cb

View file

@ -139,7 +139,7 @@ class StatsController {
const allRates = (
(await Pair.findAll({
attributes: ['id', 'rate'],
attributes: ['id', 'rate', 'volume'],
include: [
{
model: Currency,
@ -174,6 +174,8 @@ class StatsController {
.filter((pair) => pair.volume > MIN_VOLUME_THRESHOLD)
.sort((a, b) => new Decimal(b.tvl).minus(new Decimal(a.tvl)).toNumber());
console.log('allTvls', allTvls);
const totalTVL = allTvls.reduce(
(acc, pair) => acc.add(new Decimal(pair.tvl)),
new Decimal(0),