fixing the TVL calculation
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user