Tracking balance and yield

Fetch aggregated yield accrual info

Use this method to retrieve aggregated yield data for specified vaults, pools, and users within a given timeframe:

const aggregatedYieldData = await sdk.yields.getYields([vaults], [poolIds], [users], timeframe);

Where:

  • vaults – Array of vault addresses to filter results.

  • poolIds – Array of pool IDs to filter results.

  • users – Array of user addresses to filter results.

  • timeframe – Timeframe to limit results within a specific period.

Retrieving TVL of a Client's Pool

To fetch the Total Value Locked (TVL) of a specific pool within a Yelay vault:

const poolsTvl = await sdk.pools.getPoolsTvl(vault, [pool]);

Where:

  • vault – Address of the Yelay vault.

  • pool – Array of pool IDs to calculate the total TVL.

Fetching a User's Balance

To fetch a user's balance within a specific pool:

const userPoolBalance = await sdk.vaults.balanceOf(vault, pool, await signer.getAddress());

Where:

  • vault – Address of the Yelay vault.

  • pool – ID of the requested pool.

Last updated