Sum Balances

Functions for adding up the balances or their USD conversions.

sumBalancesUSD

It calculates the USD prices of given tokens and can then converts the balances of given tokens into USD and returns their total sum.

tokenBalanceUSD

Works similarly to sumBalanceUSD, and can be used when you have to convert a single token balance into USD.

sumSingleBalance

Used for adding balances of tokens one by one in TVL calculation.

sumMultipleBalance

Adding up multiple token balances returned from the abi.erc20MultiBalanceOf method in TVL calculation.

Last updated