> For the complete documentation index, see [llms.txt](https://docs.kpk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kpk.io/funds/infrastructure/architecture/onchain-accounting/meta-balance-adapters/euler-vaults.md). Agents can also search and read this documentation through its [MCP server](https://docs.kpk.io/~gitbook/mcp).

# Euler Vaults

One immutable meta-adapter that reports an account's position in any Euler V2 ERC-4626 vault, both the EulerEarn aggregator vaults and the core eVaults (EVK, the lend/borrow product).

One immutable meta-adapter that reports an account's position in *any* Euler V2 ERC-4626 vault, both the EulerEarn aggregator vaults and the core eVaults (EVK, the lend/borrow product). Which vaults it queries is a governed instance set on the NAV Calculator; the adapter holds no per-vault state.

* **Type:** Meta-adapter
* **protocolSubId:** `keccak256("euler-vaults")`
* **Instance key:** the vault address, widened to `bytes32`
* **Source:** `EulerVaultsMetaBalanceAdapter.sol`

## Positions returned

Up to two legs per vault, both denominated in the vault's underlying asset:

| Leg    | PositionKind                 | isDebt  | Description                                                                              |
| ------ | ---------------------------- | ------- | ---------------------------------------------------------------------------------------- |
| Supply | `Supplied` *or* `Collateral` | `false` | `convertToAssets(balanceOf)`; `Collateral` if enabled as EVC collateral, else `Supplied` |
| Borrow | `Borrowed`                   | `true`  | `debtOf(account)`, core eVaults only                                                     |

A vault returns an empty result when its asset is unregistered, excluded by `assetFilter`, or the account has neither supply nor debt. Debt and supply share one asset, so an unregistered asset suppresses both legs together; the [collateral-without-debt](https://docs.kpk.io/funds/infrastructure/architecture/onchain-accounting/balance-adapters.md#how-an-adapter-is-built) suppression is not needed.

`debtOf` and the EVC lookups are read through **bounded, ABI-validated staticcalls** rather than `try/catch`, so EulerEarn aggregators (which lack them) and non-Euler ERC-4626 tokens degrade gracefully: no debt leg, supply classified as `Supplied`. `try/catch` does not catch a call to a code-less address or a return-data decode failure, and either would drop the whole instance, hiding a real debt.

A `debtOf` that **reverts** and one that **runs out of gas** are treated differently. A revert is an answer (an EulerEarn aggregator has no `debtOf`, so `0` is correct). Starvation is not, so the read **fails closed** rather than recording zero debt. An account borrows from a **controller** vault while its collateral sits in others, so a suppressed debt leg would leave sibling vaults reporting collateral without it, over-reporting NAV. See [a starved read is not an empty read](https://docs.kpk.io/funds/infrastructure/architecture/onchain-accounting/balance-adapters.md#how-an-adapter-is-built).

## Balance calculation

<figure><picture><source srcset="https://1699303810-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUsQM4bzcmOPSgkWddkeN%2Fuploads%2FBgrfNbSXhY79hvI9qoca%2Fmeta-euler-vaults_D.png?alt=media&amp;token=04a93b38-bd3a-405c-828f-c138459fe78a" media="(prefers-color-scheme: dark)"><img src="https://1699303810-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUsQM4bzcmOPSgkWddkeN%2Fuploads%2FBF95E4Qsrdy4fut4wHs3%2Fmeta-euler-vaults.png?alt=media&amp;token=8268ce81-f831-4bbe-a5ef-c076ebf133dc" alt="Flowchart of the Euler Vaults balance adapter: read calls derive position legs into PositionBalance entries."></picture><figcaption><p>Euler Vaults adapter: how the underlying balances reported to the NAV Calculator are derived.</p></figcaption></figure>

```
supplied = vault.convertToAssets(vault.balanceOf(account))   // isDebt = false
debt     = IEulerEVault(vault).debtOf(account)               // guarded read; isDebt = true, core eVaults only
```

Supply classification: `Collateral` if `vault` appears in `IEVC(vault.EVC()).getCollaterals(account)`, otherwise `Supplied`.

## Identity

* **positionId:** `abi.encode(address vault)`; the vault address (both legs share it)
* **positionKind:** `Supplied` · `Collateral` · `Borrowed`

The position has no `labels` field. `positionLabels(positionId)` returns `["Vault", "<ERC4626 name()>"]` from the vault's onchain name, surfaced only by the verbose reads (`getAccountPositionsVerbose` / `getAccountNavVerbose`); the full breadcrumb is `[protocolName, ...labels]`.

## Constructor

```solidity
constructor(address navCalculator_)
```

| Parameter        | Description                                             |
| ---------------- | ------------------------------------------------------- |
| `navCalculator_` | NAV Calculator contract (asset registry + instance set) |

## Registration

Register once and seed vaults with `addMetaBalanceAdapter(adapter, instances)`, then adjust with `addMetaInstances(adapter, instances)` / `removeMetaInstances(adapter, instances)` (MANAGER-gated). Each instance coordinate is a **vault address widened to `bytes32`** (decoded via `_toAddress`). Adding a vault is a config call, not a new deploy.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.kpk.io/funds/infrastructure/architecture/onchain-accounting/meta-balance-adapters/euler-vaults.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
