# Read Function

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.\
\
ABI file :

{% file src="/files/3XfAqwYTZDO02t88Jk2w" %}

```solidity
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.

* logYield data on PoolData struct refers to LP's APR of growing due to accumulated swap fees. You could calculate the APR like this :\
  \
  &#x20;`APR(%) = 2^(logYield * 86400 * 365 / 1e18) * 100`

Functions you could use to get details about Gauge and Pools

```solidity
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)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://vedex.gitbook.io/docs/technical-docs/concept/read-function.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
