Skip to main content

getUserStats

Description:

Getting the user stats collection for current vault. With the help of this data it is possible to build a chart.

Arguments:

NameTypeRequiredDescription
daysCountnumberYesThe limit in days
userAddressstringYesThe user address
vaultAddressstringYesThe address of the vault

Returns:

type Stat = {
time: number
value: number
}

type Output = {
apy: Stat[]
balance: Stat[]
rewards: Stat[]
}
NameDescription
timeDate and time for each data point
apyCurrent APY based on time, rewards and balance.
rewardsNumber of assets earned by the user in current vault during the interval in ETH
balanceTotal assets by the user in current vault at the moment of time in ETH

Example:

await sdk.vault.getUserStats({
daysCount: 30,
userAddress: '0x...',
vaultAddress: '0x...',
})