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

Asset classification

How a registered asset is classified on two orthogonal axes, what its price tracks, and how its value accrues.

Every registered asset is classified on two orthogonal axes, kept separate because no single category answers both questions:

  • PegKind: what the price tracks. Pegged or Floating.

  • AccrualKind: how value accrues. None, Rebasing, or Appreciating.

Source: AssetKindRegistry.sol · AssetKind.sol

The two axes

PegKind means pegged to the quote asset, USD for the default quoteAsset == address(0) read, not "pegged to something in general". So USDC, USDT, DAI and GHO are Pegged, while wstETH is Floating even though it is rigidly related to stETH: it does not track USD.

AccrualKind

What grows

Examples

None

Neither balance nor rate

WETH, USDC, AAVE, WBTC

Rebasing

The balance grows; unit price stays put

stETH, eETH, aTokens

Appreciating

The rate grows; balance stays static

wstETH, sDAI, sGHO, sUSDe, ERC-4626 shares

Every registered asset carries an accrual classification, across the eight chains that configure assets. The live breakdown is not reproduced here. Read it from the chain (getAssetKinds(assets) on the registry).

A copied figure is true only of the commit it was copied from, and this one was wrong across four consecutive merges before anyone noticed: every asset registered moves it, and nothing fails when it goes stale.

Why two axes rather than one category

A single flat enum forces a wrong answer on assets already registered here, because the two properties genuinely cross:

None

Rebasing

Appreciating

Pegged

USDC

(an aToken; none registered; see below)

(cannot be asserted; see below)

Floating

WETH

stETH

wstETH, sDAI, sGHO, sUSDe, sUSDS

stETH and wstETH differ on the accrual axis only; both are Floating. Collapse the axes and that distinction is unexpressible.

sDAI is Floating, not Pegged; a yield-bearing wrapper has no peg. Its USD price is not $1 and rises with accrued yield, for the same reason wstETH is Floating. Appreciating is in fact the mechanism that makes an asset unpeggable: a growing redemption rate on a static balance moves the price off $1.

The peg axis is derived, not stored

PegKind is not stored anywhere. It is computed on read from the NAV's per-asset pegToleranceBps, the switch that enables the $1 peg guard:

There is exactly one authority for whether an asset is pegged, so there is no second copy to fall out of step and no cross-check needed to police one. Whether any given asset reads Pegged follows from its own pegToleranceBps; read that per asset rather than from a count here.

Because the value is read live rather than snapshotted at classification time, retuning a tolerance is immediately reflected.

The two empty cells are empty for different reasons

  • Pegged + Rebasing is real and reachable. An aToken for USDC has a growing balance at a $1 price. No registered asset occupies the cell, which makes it a forward-compatibility slot rather than a contradiction.

  • Pegged + Appreciating cannot be asserted. Nothing writes a peg kind, so it cannot be declared for an asset. It remains reachable as a read: set a non-zero peg tolerance on an asset stored as Appreciating and the pair reads back Pegged + Appreciating, because the peg is computed from that tolerance. That is a true report of the configuration, not an inconsistency to be caught.

Do not use PegKind as a staleness or safety oracle. It reports what an asset's price is supposed to track. It says nothing about whether the current price is fresh, or whether the asset is holding its peg right now; those are stalePriceAssets and the irregular signal.

Reading an asset's description

One call on the NAV Calculator returns everything public about an asset, both classification axes and its display labels. A consumer needs only the NAV address it already holds, and never has to learn that a registry exists:

It returns the enums rather than raw uint8s, so callers get a typed ABI rather than two integers to interpret.

getAssetInfo is declared on NAVCalculator itself, not on INAVCalculator. Bindings generated from the interface alone will not carry it. Generate against the concrete contract, or add the one signature by hand.

The narrower reads, the batch form and the probe live on the registry, which the NAV names via assetKindRegistry():

What a caller actually receives

The two halves of getAssetInfo fail differently, and the difference is deliberate:

  • The classification half fails closed. An unclassified asset reverts AssetNotClassified rather than reporting a default. The zero value of AccrualKind is None, which is a real classification and the one most registered assets hold, so a defaulting reply would be indistinguishable from a configured one. Probe with isClassified when an unclassified asset is an expected state.

  • The labels half never fails. getAssetLabels does not revert; an unlabelled asset returns an empty array, which is a real answer rather than a gap.

That asymmetry is the whole rule: there is no defensible default classification, but "no labels" is the honest answer.

Display labels

Alongside the two axes, an asset carries an ordered list of display labels; free text for presentation, which nothing onchain parses.

Order is significant, and the list is not a set. Index 0 is the protocol or issuer; later indices narrow to the product or kind:

That broad-to-narrow order is the same one protocolName() and positionLabels() compose in: but the content differs, and the difference matters when you are writing the array. Asset labels carry the protocol at index 0. Position labels never do: there, protocolName() supplies the protocol separately and positionLabels() starts at the product (["Market", "wstETH/USDC"], ["Withdrawal Queue", "stETH"]).

So the two are alike in ordering and opposite in what index 0 holds. Reading either array as an unordered set discards the only structure it has.

At most 4 labels, each at most 32 bytes, none empty, TooManyAssetLabels, AssetLabelTooLong and EmptyAssetLabel reject the rest at write time. Zero labels is legitimate, not a misconfiguration.

A wrong label can be corrected in place, without touching the asset's registration or its price feeds:

It replaces the whole array rather than editing an element, and it can revert six ways. An integrator decoding errors needs to handle all six, the role gate, two of its own, and three content bounds it shares with registerAsset:

revert
when

NotAuthorized

the caller does not hold the NAV's MANAGER role; checked first, so the likeliest one in practice

AssetNotRegisteredForLabels

the asset is not registered on the NAV

EmptyAssetLabelSet

the array is empty

TooManyAssetLabels

more than 4 labels

AssetLabelTooLong

an element exceeds 32 bytes

EmptyAssetLabel

an element is the empty string

setAssetLabels replaces the whole list; it cannot empty one. It rejects an empty array, so through this call the transitions are none → some and some → other only. Labels do still go from some → none, unregisterAsset clears them, but that ends the registration, which is not a label operation.

The per-element bounds are identical on both write paths, at most 4 labels, 32 bytes each, no empty element, so a label list that could not be registered cannot be set either. They differ in two places: the empty array, which registerAsset accepts (meaning "leave labels alone") and setAssetLabels rejects; and their preconditions, which are opposites; registerAsset requires the asset to be absent from the NAV, setAssetLabels requires it to be present. They are not interchangeable.

An asset can also be unlabelled because it never went through registerAsset: the chain's native asset is registered during initialisation rather than by that call, so in practice setAssetLabels is how it gains labels.

Adapter label overrides

Adapter labels are produced by adapter code, protocolName() for the protocol, positionLabels(positionId) for the breadcrumb beneath it, so a wrong one is wrong for every position that adapter serves, not for one row. Redeploying the adapter is one way to fix that. It is no longer the only way.

Two per-adapter overrides are stored on the registry and applied at read time. All four calls are gated on the NAV's MANAGER role; the two setters additionally require the adapter to be registered, while the two clearers deliberately do not, so an override can still be removed after its adapter has been deregistered:

An override that is unset falls through to whatever the adapter itself returns, so this changes presentation without touching the adapter. Setting one on an unregistered adapter reverts AdapterNotRegistered; an empty string reverts EmptyAdapterOverride, use the matching clear… call to remove one, and an over-long value reverts AdapterOverrideTooLong. The clearers are not idempotent: clearing an override that was never set reverts AdapterOverrideNotSet, so a cleanup batch run over several adapters fails on the first one that carried nothing.

What the two overrides do not reach is any segment beneath index 0. The category override replaces index 0 and nothing else; the computed leaf below it, which many adapters derive live from onchain state, per position, is left untouched and still read live on every call. Correcting a leaf still means changing whatever produces it, the adapter code or its constructor argument, and redeploying that adapter. That is a current limitation of the override surface, stated as such: it is not a claim about what the surface was intended to be.

Both read paths agree. The overrides apply on the position path, the verbose reads that render a position's breadcrumb, and on the configuration path, NAVCalculator.getAdapterDisplayInfo(adapters), which returns each adapter's effective name and its positionId-independent breadcrumb. Pair that with getAllAdapters() to group configured adapters by exactly the string the position path will report.

Read through the NAV Calculator, not the adapter. A consumer that staticcalls protocolName() on an adapter directly reads the compiled-in value and never learns an override exists.

Reading through the NAV is necessary but not sufficient. The registry lookup is fail-open: if the registry is unwired, is an EOA, reverts, or answers with something unreadable, the read degrades silently to the adapter's own compiled-in name rather than failing. Replacing the registry drops every override the same way. So a correct consumer can still be served a stale name; the override surface is a presentation layer, not a guarantee.

What the override lookup costs on a verbose read.

The gas figure below comes from KPK's test suite, which measures this surcharge warm and cold. It changes as the read paths are revised, so treat it as indicative rather than as a budget. What that suite enforces is stated below, and each of these is an assertion: a change that breaks one breaks the build rather than silently ageing this page.

  • A miss is dearer than a hit, and every adapter is a miss today. A hit skips the adapter's protocolName() staticcall; a miss pays the registry lookup and still makes the adapter call, so it is strictly the larger piece of work. No override has been set on any adapter, so the miss is what the system pays now. That saving is specific to the protocol-name override; it comes from skipping the adapter call. The category lookup is read on every verbose call whether or not one is set, so setting a category override does not make the read cheaper.

  • The surcharge scales with distinct adapters, never with positions. Two adapters across three positions cost the same as two across two; the third position adds nothing. Budget by the number of distinct adapters a read touches, never by row count. Each bound defending this was set from a mutant that breaks it, not from taste.

  • Cold exceeds warm, and warm is a floor. A warm measurement touches the slot before reading it; a real portfolio reads each adapter's slot cold the first time it touches it.

For an order-of-magnitude at operator scale, the cold account path over mainnet's registered adapter set costs roughly 9.5k gas per emitting adapter; the shape a real portfolio has, rather than a single-adapter microbenchmark. Two caveats travel with that number and must not be separated from it: vm.cool restores cold slots but not the cold-account premium, so even the cold figures are a floor on what a fresh call pays; and the configuration surface's per-entry figure is measured with repeated addresses that are warm after the first touch, so it is a warm floor and must never be quoted as a per-distinct-adapter cost.

The facade's unregisterAsset drops an asset's labels; clearAssetKind keeps them. The two look interchangeable and are not:

  • clearAssetKind ends the classification while the asset stays registered on the NAV; its labels still describe a live asset, so they are kept.

  • AssetKindRegistry.unregisterAsset ends the registration, so it deletes the labels outright, after this call, and only this one, a later re-registration starts from none.

Governance

Registering an asset, classifying it and labelling it are one operation:

AssetKindRegistry.registerAsset stores the accrual kind and the labels, then forwards to the NAV's own registerAsset in the same transaction, so if either half reverts the whole transaction reverts and neither takes effect. An asset therefore cannot become registered-but-unclassified through a partly-applied change. Unregistration works the same way, and additionally drops the labels.

Mutations, registerAsset, unregisterAsset, setAssetKind, setAssetKinds, clearAssetKind, setAssetLabels, are gated on the NAV's MANAGER role:

The registry holds no roles of its own and has no separate admin. Authority is exactly the NAV's MANAGER set, one set of humans for the whole system, rather than a second contract with its own governance to keep in step. The NAV address is set in the registry's constructor and immutable.

The pointer in the other direction is not immutable: a MANAGER aims the NAV at a registry with setAssetKindRegistry, which rejects address(0). It is re-settable on purpose; the registry is a plain contract rather than a proxy, so replacing it means deploying a new one and re-pointing the NAV.

The stored axis is written from per-asset configuration, where the accepted values are None, Rebasing and Appreciating, case-exact. A pre-deploy check rejects an absent, empty, mis-cased or unrecognised value, but it validates the value, not the field set: a misspelled key (accrualkind, accrual_kind) is silently ignored and reaches the deploy as if the field were absent.

Last updated