indexVaults, Yield & Tokenized Positions#vaults#erc-4626#accounting

Vaults, Yield and Tokenized Positions

Introduction

Vaults transform assets into transferable claims over managed accounting. The branch begins with ERC-4626 conversions and previews, then adds adversarial donations, strategies, profit/loss, queues, and migrations.

Why It Matters

Share prices compose silently into routers, lending markets, and interfaces. Wrong rounding, stale valuations, hidden losses, or unavailable strategy liquidity can break both protocol math and user expectations.

Mental Model

Shares are liabilities against controlled or strategy-accounted assets. Conversions state a price under defined rounding; previews predict a specific operation; strategy adapters introduce external trust, liquidity, and valuation boundaries.

Questions This Branch Answers

  • Which party benefits from each rounding direction?
  • How are donations, profit, loss, fees, and illiquidity reflected?
  • What remains withdrawable during strategy failure or migration?

Scope

ERC-4626 assets/shares/previews, rounding/fees, donation attacks, adapters/accounting, profit/loss, withdrawal queues, migrations/limits/emergency exits, and restaking/slashing contrasts.

Out of Scope

Yield recommendations, production strategies, APY marketing, assuming tokenized claims are liquid, and legal claims about ownership of off-chain assets.

Dependencies

token standards, fixed-point math, economic invariants, and external-call boundaries.

Candidate Note Roadmap

  • erc-4626-shares-assets-and-previews — Implement and test conversion versus preview semantics.
  • rounding-direction-and-fees — Allocate rounding and fee effects intentionally by operation.
  • donation-and-inflation-attacks — Reproduce first-depositor and exchange-rate manipulation.
  • strategy-adapters-and-accounting — Bound external strategy assets, debt, and reporting trust.
  • profit-loss-and-locked-profit — Surface gains and losses without unfair instantaneous extraction.
  • withdrawal-queues-and-liquidity-mismatch — Model claims when assets cannot return synchronously.
  • migrations-limits-and-emergency-exits — Preserve accounting and user escape during change or failure.
  • tokenized-positions-restaking-and-slashing — Contrast nested claims, exit delays, and penalty risk.

Future Project

An ERC-4626 Vault with a simulated strategy, declared fees/rounding, locked-profit or loss visibility, withdrawal constraints, migration path, and donation/inflation exploit tests.

Initial Invariants

Redeemable claims never exceed accounted assets; preview/execution differences obey the specification and declared fees; loss is never hidden as profit; migration conserves shares and attributable assets.

Initial Threat Model

Donation/inflation, first-depositor capture, rounding extraction, dishonest strategy reports, strategy insolvency, withdrawal starvation, approval/callback risk, unsafe migration, and nested-token/slashing contagion.

Primary Sources

ERC-4626, OpenZeppelin vault implementations, maintained vault protocol documentation, and sources in SOURCES.md.

Connects to: lending, oracles, and tokenized assets.