Tracking balance and TVL
Fetching User's Balance
const userPoolBalance = await sdk.vaults.balanceOf(vault, pool, await signer.getAddress());Retrieving TVL of a Client's Pool
const poolsTvl = await sdk.pools.getPoolsTvl(vault, [pool]);Getting historical TVL data for a vault and pool
const historicalTVL = await sdk.pools.historicalTVL({
vaultAddress: '0x1234...5678', // Required: The vault address to get TVL for
poolId: 1, // Required: The specific pool ID to query
fromTimestamp: 1641034800, // Optional: Start time in seconds (Jan 1, 2022)
toTimestamp: 1672570800, // Optional: End time in seconds (Jan 1, 2023)
page: 1, // Optional: Page number for pagination (starts at 1)
pageSize: 30, // Optional: Number of records per page (max 100)
});Last updated