# ERC20TvlModule

### Overview

`ERC20TvlModule` contract handles the calculation of TVL for ERC20 tokens within a vault. It provides a standardized mechanism to assess the value of a vault's ERC20 assets.

### Key Features

* **TVL Calculation**: Computes the total value locked for each ERC20 token held in a vault.
* **Direct Balance Access**: Uses the ERC20 `balanceOf` function to assess token balances.
* **Accurate Accounting**: Returns detailed data structures containing token information and their amounts.

### Core Method

1. **TVL Calculation**
   * `tvl(address)`: Computes the total value locked for all ERC20 tokens in a given vault.
     * **vault**: The address of the vault.
     * **Returns**: An array of `Data` structures containing information on each ERC20 token:
       * **token**: Address of the ERC20 token.
       * **underlyingToken**: Same as `token` because it's an ERC20 token.
       * **amount**: The balance of the token held by the vault.
       * **underlyingAmount**: Identical to `amount`.


---

# 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://docs.mellow.finance/resources/mellow-lrt-depreciated/modules/tvlmodules/erc20tvlmodule.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.
