These are all you need to get user balances, calculate Apr, pool info, etc. We also use this Lens contract for our frontend.
ABI file :
Copy struct BribeData {
Token[] tokens;
uint256 [] rates;
uint256 [] userClaimable;
uint256 [] userRates;
}
struct GaugeData {
address gauge;
PoolData poolData;
bool killed;
uint256 totalVotes;
uint256 userVotes;
uint256 userClaimable;
uint256 emissionRate;
uint256 userEmissionRate;
uint256 stakedValueInHubToken;
uint256 userStakedValueInHubToken;
uint256 averageInterestRatePerSecond;
uint256 userInterestRatePerSecond;
Token[] stakeableTokens;
uint256 [] stakedAmounts;
uint256 [] userStakedAmounts;
Token[] underlyingTokens;
uint256 [] stakedUnderlying;
uint256 [] userUnderlying;
BribeData[] bribes;
}
struct PoolData {
address pool;
string poolType;
// lp tokens
Token[] lpTokens;
uint256 [] mintedLPTokens;
// tokens constituting the lp token
Token[] listedTokens;
uint256 [] reserves;
int256 logYield;
bytes poolParams;
}
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.
Copy function spotPrice ( ISwap swap , Token base , Token quote , uint256 baseAmount) public returns ( uint256 )
function spotPrice ( Token base , Token quote , uint256 amount ) public returns ( uint256 )
function spotPrice ( Token quote , Token [] memory tok , uint256 [] memory amount ) public returns ( uint256 )
function userBalances ( address user , Token [] calldata ts ) public view returns ( uint256 [] memory balances)
function wombatGauges ( address user ) external returns ( GaugeData [] memory gaugeDataArray)
function canonicalPools ( address user , uint256 begin , uint256 maxLength )
external returns ( GaugeData [] memory gaugeDataArray)
// use canonicalPools2 , canonicalPoolLength2 function to fetch pools from v1 factory
function canonicalPoolLength () external returns ( uint256 )
function queryGauge ( address gauge , address user ) external returns ( GaugeData memory poolData)
function getPoolBalance ( address pool , Token t ) external view returns ( uint256 )
function queryPool ( address pool ) external returns ( PoolData memory ret)
function emissionRate ( IGauge gauge ) external returns ( uint256 )
userAddress )