Skip to content

feat: multi-index refactor (shared AssetRegistry, per-vault curated constituents)#5

Merged
jayeshy14 merged 1 commit into
mainfrom
feat/multi-index-refactor
Jun 17, 2026
Merged

feat: multi-index refactor (shared AssetRegistry, per-vault curated constituents)#5
jayeshy14 merged 1 commit into
mainfrom
feat/multi-index-refactor

Conversation

@jayeshy14

Copy link
Copy Markdown
Owner

What

Turns the protocol from a single index into a multi-index platform. The registry was conflating two jobs, the global asset catalog and one index's membership, which for a single index collapse into each other and made the separation look like ceremony. This splits them.

AssetRegistry (was ComponentRegistry)

Re-scoped to a shared global catalog of registerable assets, not an index. It is the eligible universe any index draws from: a token is registered once and any index vault may then include it.

  • Renamed surface: registerAsset / removeAsset / getAsset / getAssets / assetCount, MAX_ASSETS = 250 as a catalog cap (distinct from a per-index size cap), and AssetRegistry_* errors.
  • Price reads and the health-checked staleness behavior are unchanged.

IndexVault now owns its curated constituents

  • Holds its own _constituents set with setConstituents, which validates each token is registered in the catalog, rejects duplicates, caps at MAX_CONSTITUENTS = 100, and caches decimals so the NAV loop makes no external decimals call.
  • NAV loops over the vault's own constituents, not the whole registry.
  • New public reads: getConstituents, constituentCount, isConstituent, and getHoldings, which returns each constituent's balance, USD value, and weight in bps plus the idle USD and total NAV. This is the transparency surface for "what is in the index and in what proportion."
  • Membership is admin-curated, because category membership (L1, DEX, AI, and so on) is definitional rather than rank-derived. Weighting over the curated set stays autonomous.

MarketCapMethodology points at AssetRegistry; it already took constituents as arguments, so no other change.

Scope note

setConstituents is intentionally a simple owner-gated wholesale setter here. The timelock, forced-versus-discretionary removal, rate-limit, and minimum-count guardrails (spec Section 16) are a later stage, as is the deposit cap.

Testing

Adds 7 tests, including two index vaults sharing one registry with fully independent NAV (the multi-index property), getHoldings value and weight checks, idle-in-weights accounting, and setConstituents validation (unregistered asset, duplicate, set replacement). 83 tests pass; no ComponentRegistry reference remains anywhere.

…onstituents)

Make the protocol a multi-index platform rather than a single index. The
registry was doing two jobs at once: the global asset catalog and one index's
membership. For a single index those collapse, which is why the separation
read as ceremony. Split them.

AssetRegistry (was ComponentRegistry):
- Re-scoped to a shared global catalog of registerable assets, not an index.
  It is the eligible universe any index draws from; a token is registered once
  and any index may include it.
- Renamed surface: registerAsset/removeAsset/getAsset/getAssets/assetCount,
  MAX_ASSETS=250 as a catalog cap (distinct from a per-index size cap), and
  AssetRegistry_* errors. Price reads and health checks unchanged.

IndexVault now owns its curated constituents:
- Holds its own _constituents set with setConstituents, validating each token
  is registered in the catalog, rejecting duplicates, capping at
  MAX_CONSTITUENTS=100, and caching decimals so the NAV loop makes no external
  decimals call.
- NAV loops over the vault's own constituents, not the whole registry.
- New public reads: getConstituents, constituentCount, isConstituent, and
  getHoldings (per-constituent balance, USD value, weight in bps, plus idle
  USD and total NAV) for transparency.
- Membership is admin-curated because category membership (L1, DEX, AI, ...)
  is definitional, not rank-derived; weighting over the set stays autonomous.
  The timelock/forced-removal/rate-limit guardrails are a later stage.

MarketCapMethodology points at AssetRegistry; it already took constituents as
arguments.

Adds 7 tests including two index vaults sharing one registry with independent
NAV (the multi-index property), getHoldings value/weight checks, and
setConstituents validation. 83 tests pass.
@jayeshy14 jayeshy14 merged commit d3efb10 into main Jun 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant