# getContractValue

This method calculates the current total value locked (in `token` terms).

{% hint style="info" %}
**Note 1**: `unclaimedFees`are not included in the contract value.

**Note 2**: fees that *will* be taken (in the next `_updateAccounting` call) are counted
{% endhint %}

### Function

```solidity
function getContractValue(
) external view returns (uint256)
```

### Return values

<table><thead><tr><th width="270">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>_val</code></td><td>TVL (is the sum of unlent balance in the contract + the balance in lending - the reduction for harvested rewards - unclaimedFee)</td></tr></tbody></table>

{% hint style="info" %}
Unlent balance (`unlentPerc`) is currently set at 2% of the total funds.&#x20;
{% endhint %}


---

# 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.idle.finance/developers/yield-tranches/methods/getcontractvalue.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.
