mirror of
https://github.com/alexgo-io/DefiLlama-Adapters.git
synced 2026-01-12 16:53:02 +08:00
Fix pool asset iteration and ensure all multi-asset pools are included in TAPP Exchange TVL calculation (#16837)
Co-authored-by: sehren <sehren.singh@youtap.id> Co-authored-by: sehren <sehrenjit@undercurrent.tech> Co-authored-by: Abdurrahman Ramadhan <abdmandhan@gmail.com>
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user