Summary
Vault name changes made in the CMS are reflected in the vault snapshot endpoint by GET /api/rest/snapshot/:chainId/:address, but they are not reflected in the vaults list endpoint by GET /api/rest/list/vaults. As a result, yearn.fi can use the updated metadata name on a vault detail page, while the same vault continues to show an older name in the vault list.
The list response does not expose meta.name or meta.displayName, so the frontend cannot apply the same name priority without making an additional snapshot request for every vault.
Current behavior
The vault list query in packages/web/app/api/rest/list/db.ts currently resolves name as:
COALESCE(
thing.defaults->>'name',
snapshot.snapshot->>'name',
snapshot.hook->'meta'->>'displayName'
) AS name
This has two consequences:
thing.defaults.name and snapshot.snapshot.name take precedence over newer metadata.
snapshot.hook.meta.name is not read at all.
The list schema then returns only the resolved top-level name; it does not include the underlying metadata name fields.
Live example
For Ethereum vault 0x6E9455D109202b426169F0B9B830B3d67623122E270:
GET /api/rest/list/vaults
name: "LP Yearn CRV Vault v2"
GET /api/rest/snapshot/1/0x6E9455D109202b426169F0B9B830B3d67623122E270
meta.name: "yCRV Factory yVault"
meta.displayName: ""
name: "LP Yearn CRV Vault v2"
yearn.fi's vault-detail flow has access to the snapshot and can prefer meta.name. Its vault-list flow consumes /list/vaults, where that field is unavailable, so the two surfaces show different names.
Proposed API change
Prefer an additive change that exposes the source metadata in each vault-list item while preserving the existing top-level name for compatibility:
{
"name": "LP Yearn CRV Vault v2",
"meta": {
"name": "yCRV Factory yVault",
"displayName": ""
}
}
The fields can be selected from the snapshot hook already joined by the list query:
snapshot.hook->'meta'->>'name'
snapshot.hook->'meta'->>'displayName'
This lets yearn.fi apply one consistent frontend priority on both list and detail pages:
meta.name -> meta.displayName -> snapshot/list name
It also preserves the distinction between source fields instead of collapsing them in Kong, and avoids N+1 snapshot requests from list consumers.
Acceptance criteria
Related context
Issue #300 expanded the vault-list API to avoid per-vault requests. This issue is specifically about preserving metadata-driven name updates in that expanded list contract.
Summary
Vault name changes made in the CMS are reflected in the vault snapshot endpoint by
GET /api/rest/snapshot/:chainId/:address, but they are not reflected in the vaults list endpoint byGET /api/rest/list/vaults. As a result, yearn.fi can use the updated metadata name on a vault detail page, while the same vault continues to show an older name in the vault list.The list response does not expose
meta.nameormeta.displayName, so the frontend cannot apply the same name priority without making an additional snapshot request for every vault.Current behavior
The vault list query in
packages/web/app/api/rest/list/db.tscurrently resolvesnameas:This has two consequences:
thing.defaults.nameandsnapshot.snapshot.nametake precedence over newer metadata.snapshot.hook.meta.nameis not read at all.The list schema then returns only the resolved top-level
name; it does not include the underlying metadata name fields.Live example
For Ethereum vault
0x6E9455D109202b426169F0B9B830B3d67623122E270:yearn.fi's vault-detail flow has access to the snapshot and can prefer
meta.name. Its vault-list flow consumes/list/vaults, where that field is unavailable, so the two surfaces show different names.Proposed API change
Prefer an additive change that exposes the source metadata in each vault-list item while preserving the existing top-level
namefor compatibility:{ "name": "LP Yearn CRV Vault v2", "meta": { "name": "yCRV Factory yVault", "displayName": "" } }The fields can be selected from the snapshot hook already joined by the list query:
This lets yearn.fi apply one consistent frontend priority on both list and detail pages:
It also preserves the distinction between source fields instead of collapsing them in Kong, and avoids N+1 snapshot requests from list consumers.
Acceptance criteria
/api/rest/list/vaultsexposes enough information for consumers to prefermeta.name, thenmeta.displayName, without fetching each vault snapshot./api/rest/list/vaults/:chainIdreturns the same naming fields/semantics.nameconsumers remain compatible.meta.name,meta.displayName, snapshot name, and defaults/list-name fallbacks.Related context
Issue #300 expanded the vault-list API to avoid per-vault requests. This issue is specifically about preserving metadata-driven name updates in that expanded list contract.