From 6d1fe44e09a8da4f33c7d2cd9d67eb640e99e836 Mon Sep 17 00:00:00 2001 From: abdurrwansui <139126561+abdurrwansui@users.noreply.github.com> Date: Mon, 27 Oct 2025 20:13:32 +0700 Subject: [PATCH] Fix pool asset iteration and ensure all multi-asset pools are included in TAPP Exchange TVL calculation (#16837) Co-authored-by: sehren Co-authored-by: sehren Co-authored-by: Abdurrahman Ramadhan --- projects/tapp-exchange/index.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/projects/tapp-exchange/index.js b/projects/tapp-exchange/index.js index efd6045de..2b802b494 100644 --- a/projects/tapp-exchange/index.js +++ b/projects/tapp-exchange/index.js @@ -66,10 +66,14 @@ module.exports = { ); for (const pool of filteredPools) { - const coinA = (await getPairedCoin(pool.assets[0])) || pool.assets[0]; - const coinB = (await getPairedCoin(pool.assets[1])) || pool.assets[1]; - api.add(coinA, pool.reserves[0]); - api.add(coinB, pool.reserves[1]); + // loop coins + for (let i = 0; i < pool.assets.length; i++) { + const coin = pool.assets[i]; + const pairedCoin = await getPairedCoin(coin) || coin; + if (pairedCoin) { + api.add(pairedCoin, pool.reserves[i]); + } + } } }, },