User Balances
Swap fees are increasing reserves, without modifying user LBToken balances. There are few ways to fetch user's reserves, based on their holdings.
To calculate user's reserves, user's LBToken balance, total supply of LBToken and reserves in given bin are needed.
This needs to be calculated separately for every bin.
Liquidity helper contract
Easiest and most straightforward way includes calling getBinsReserveOf
function of liquidity helper contract.
When called with id = 0
argument, it will fetch X bins around active bin (200 in example below).
This method has disadvantage: if it isn't known, where liquidity was added, and bin id moved a lot since, not all bins might be covered.
Using public API
Last updated