For the complete documentation index, see llms.txt. This page is also available as Markdown.

Fluid Vaults

One immutable meta-adapter that reports an account's collateral and debt across any Fluid T1 vault.

One immutable meta-adapter that reports an account's collateral and debt across any Fluid T1 vault. Per vault it emits a Collateral leg (supply) and a Borrowed leg (debt), aggregated over the account's Fluid NFT positions in that vault.

  • Type: Meta-adapter

  • protocolSubId: keccak256("fluid-vaults")

  • Instance key: the Fluid T1 vault address, widened to bytes32.

  • Source: FluidVaultsMetaBalanceAdapter.sol


Positions returned

Up to two legs per vault:

Leg
PositionKind
isDebt
Description

Collateral

Collateral

false

Total supplied collateral, in the vault's supply token

Borrow

Borrowed

true

Total outstanding debt, in the vault's borrow token

A leg is dropped when its amount is zero, when the token is not registered in NAVCalculator, or when filtered out by assetFilter. If the account has debt in the vault and the borrow token is unregistered, the vault reports nothing at all — the collateral leg included — rather than emitting collateral with no offsetting debt, which would over-report NAV.

The NFT aggregation is likewise complete or nothing: if a position read runs out of gas mid-loop, the vault raises FluidPositionGasExhausted(vault, nftId, stipend, consumed) rather than returning the partial sum. Each NFT contributes both a supply and a borrow, so silently omitting one moves equity by supply − borrow — which is an over-report for an underwater position, not merely a conservative under-report. Making the truncation visible is the only answer that is safe in both directions. See Never report collateral without its debt.


Balance calculation

Flowchart of the Fluid Vaults balance adapter: read calls derive position legs into PositionBalance entries.
Fluid Vaults adapter — how the underlying balances reported to the NAV Calculator are derived.

The supply/borrow tokens come from the vault's constantsView() (supplyToken, borrowToken). Amounts are aggregated across the account's Fluid NFT positions via the VaultResolver (logic in FluidVaultLib):

collateral is reported in supply-token decimals, debt in borrow-token decimals. Liquidated positions are skipped.


Identity

  • positionId: abi.encode(address vault)

  • positionKind: Collateral (supply leg), Borrowed (debt leg)

There is no labels field on the position. The adapter implements positionLabels(positionId), which returns ["Vault", "<collateral>/<debt> #<vaultId>"] — e.g. ["Vault", "wstETH/USDC #4"] — surfaced only by the verbose reads (getAccountPositionsVerbose / getAccountNavVerbose); the full breadcrumb is [protocolName, ...labels].

A Fluid vault is not an ERC20 — name(), symbol() and version() all revert on it — so the leaf is built from the vault's token pair, exactly as the Morpho markets adapter does. Fluid's own per-vault id is appended because the pair alone is not unique: mainnet carries many more live T1 vaults than distinct pairs, and every configured vault has a live same-pair twin, so labelling by pair alone would reproduce the indistinguishability the leaf exists to remove. Symbols resolve from the NAV's registered-asset record — which maps the ERC-7528 native sentinel to the chain's native symbol, since several T1 vaults use it as one side — falling back to a direct ERC20 read and then to "?", so an unreadable side renders as "?/USDC".


Constructor

Parameter
Description

vaultResolver_

Fluid VaultResolver address (chain-level constant) used for NFT enumeration and per-NFT reads. Must be a contract

navCalculator_

NAVCalculator address, used for the registered-asset registry. Must be a contract


Registration

Register the adapter with addMetaBalanceAdapter(adapter, instances), then add or remove vaults with addMetaInstances(adapter, instances) / removeMetaInstances(adapter, instances). The instance coordinate is the T1 vault address widened to bytes32.

Last updated