fixing the TVL calculation

This commit is contained in:
2025-12-19 10:40:16 -04:00
parent 0e5921255e
commit d207ef6dca

View File

@@ -567,11 +567,9 @@ export function useGetAllPools(offset: number = 0, limit: number = 100) {
priceStr = `$${finalPrice.toFixed(4)}`; priceStr = `$${finalPrice.toFixed(4)}`;
} }
// Calculate TVL (approximate by getting first token balance and multiplying by 3) // Calculate TVL (approximate by getting first token balance and multiplying by number of tokens)
const tokenBalance = Number(balance) / Math.pow(10, decimals); const tokenBalance = Number(balance) / Math.pow(10, decimals);
const approximateTVL = tokenBalance * tokens.length;
console.log('tokenBalance', tokenBalance);
const approximateTVL = tokenBalance * 3;
tvlStr = formatTVL(approximateTVL); tvlStr = formatTVL(approximateTVL);
} }
} catch (err) { } catch (err) {