> 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/morpho-vault.md). Agents can also search and read this documentation through its [MCP server](https://docs.kpk.io/~gitbook/mcp).

# Morpho Vaults

One immutable meta-adapter that reports an account's underlying-asset balance in any Morpho ERC-4626 vault (MetaMorpho V1 and V2).

One immutable meta-adapter that reports an account's underlying-asset balance in *any* Morpho ERC-4626 vault (MetaMorpho V1 and V2). 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("morpho-vaults")`
* **Instance key:** the vault address, widened to `bytes32`
* **Source:** `MorphoVaultsMetaBalanceAdapter.sol`

## Positions returned

One position per vault the account holds shares in.

| Leg          | PositionKind | isDebt  | Description                              |
| ------------ | ------------ | ------- | ---------------------------------------- |
| Vault supply | `Supplied`   | `false` | Vault shares converted to the underlying |

A vault returns an empty result (rather than reverting) when its asset is unregistered, excluded by `assetFilter`, or the converted balance is zero, so one bad vault never zeroes out the rest. Rewards (Merkl, Universal Rewards Distributor) are not included.

## Balance calculation

<figure><picture><source srcset="https://1699303810-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUsQM4bzcmOPSgkWddkeN%2Fuploads%2FxhOPiwjBfV18rOckYf0r%2Fmeta-morpho-vault_D.png?alt=media&amp;token=e307ef48-7f9e-4c3f-9a94-1254005f192a" media="(prefers-color-scheme: dark)"><img src="https://1699303810-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUsQM4bzcmOPSgkWddkeN%2Fuploads%2FkGP0lDQ7HCj5j4o1mhKe%2Fmeta-morpho-vault.png?alt=media&amp;token=5a173a7a-2f95-487f-98aa-c4b71fbcbc42" alt="Flowchart of the Morpho Vaults balance adapter: read calls derive position legs into PositionBalance entries."></picture><figcaption><p>Morpho Vaults adapter: how the underlying balances reported to the NAV Calculator are derived.</p></figcaption></figure>

```
amount = vault.previewRedeem(vault.balanceOf(account))   // 0 if unreadable; no convertToAssets fallback
```

`previewRedeem` nets out any ERC-4626 **exit fee** (EIP-4626 §4.3) that `convertToAssets` ignores. The result is denominated in `vault.asset()`; the two agree for fee-less vaults.

If `previewRedeem` cannot be read, the leg reports **`0`**, with no `convertToAssets` fallback: since `convertToAssets ≥ previewRedeem`, a fallback could only report more than a redemption would pay. If it runs out of gas, the read **fails closed** with `RedeemValueGasExhausted(vault, stipend, consumed)` rather than reporting `0`; 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).

## Identity

* **positionId:** `abi.encode(address vault)`, the vault address
* **positionKind:** `Supplied`

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`, which reverts on a non-address coordinate). 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/morpho-vault.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.
