Read Functions
Last updated
Last updated
Instead of collecting and calculating addresses here and there to get the data you need, you can look up everything in one place : Lens.
Source code : github repo
ABI file :
There are 3 return struct types : Bribe / Gauge / Pool
These are all you need to get user balances, calculate Apr, pool info, etc. We also use this Lens contract for our frontend.
As you can see, except for 2 functions marked as 'view', all of them are not view functions.
So you should call them as staticCall to get the result returned.
!Even though we're not using "wombat style stable pools" but instead utilizing Curve's stable pair, we've retained the original function name for maintenance reasons! In this context, here "Canonical pool" refers to volatile pools, and "Wombat pool" refers to stable pools.
LogYield data on PoolData struct refers to LP's apr of growing due to accumulated swap fees. You could calculate the APR like this : APR(%) = 2^(logYield * 86400 * 365 / 1e18) * 100
For example you could query,
Total votes, APR(Average interest Rate per second), staked TVL, Emission rate from 'GaugeData'. Use various functions above to get gauge data. *There are too many variable pools and can cause errors depending on the RPC limit when querying at once, so we have prepared a canonicalPools function with pagenation. Wombat pools are usually few, so querying with wombatGauges() shouldn't cause errors.
Pool's TVL, coverage ratio of wombat pools (difference between minted LPTokens and reserves), TokenA/B in specific pool from 'PoolData'
Stake position of specific user (using functions like queryGauge(), userBalances())
Get relevant Token struct in bytes32 to build parameters for other functions.
Since Yield-Gold Maxi pool isn't directly deployed from a factory, you should query directly using queryGauge :