Skip to content
Y News

Crypto markets, protocols and regulation

ERC-4626 Vault Shares: How Assets Become Tokens

What is the ERC-4626 tokenized vault standard? It defines how a vault turns one asset into ERC-20 shares, with standard deposit, withdrawal and conversion functions.

The Y News Editors4 min read

ERC-4626 Vault Shares: How Assets Become Tokens

ERC-4626 is an Ethereum standard that adds deposit and withdrawal functions to an ERC-20 share token. A compliant vault holds one underlying asset and issues shares that represent a claim on its holdings.

That shared interface lets wallets, apps and other protocols interact with different vaults using familiar functions instead of custom integrations.

How ERC-4626 converts assets into shares

On deposit, a user supplies assets; the vault calculates and mints shares. On withdrawal, the user specifies either the assets to receive or the shares to exchange, and the vault burns shares and returns assets. EIP-4626, finalized in 2022, standardizes this interface while leaving each vault’s investment strategy to its implementation.

That asset-in, share-out pattern also applies to Morpho vaults, which allocate one underlying asset across lending markets and other supported yield sources. In either case, the ERC-4626 interface describes how users enter and exit, not where the vault deploys its assets.

The key functions divide by what the user fixes: deposit and withdraw take asset amounts, while mint and redeem take share amounts. The vault also exposes totalAssets, convertToShares and convertToAssets, plus preview and max variants for estimating an operation and checking its limits.

  • deposit(assets) fixes how much of the underlying token goes in; the returned share count can vary with the vault’s current exchange rate.
  • mint(shares) fixes how many shares the user wants; the returned asset amount shows what the vault will take.
  • withdraw(assets) fixes the assets coming out; the vault calculates how many shares to burn.
  • redeem(shares) fixes how many shares to burn; the returned asset amount can vary with the exchange rate.

For a simple vault, the estimate is shares = assets × totalSupply ÷ totalAssets. The protocol rounds in the vault’s favor: a deposit’s share output rounds down, while minting a fixed number of shares rounds the required assets up. The matching preview functions account for the operation’s conditions and fees; convertTo functions are simpler estimates and round down.

Suppose a vault holds 1,050,000 USDC and has 1,000,000 shares outstanding. A deposit of 1,000 USDC earns about 952.38 shares: 1,000 × 1,000,000 ÷ 1,050,000, rounded down to the token’s share precision. The depositor fixes the asset amount, so the shares received reflect the vault’s current assets-to-supply ratio.

ERC-4626 standardizes a vault’s interface; a regular ERC-20 only standardizes token balances and transfers. Vault shares are still ERC-20 tokens, but their balances represent proportional claims on the vault’s underlying asset. Treating the two as equivalent would miss the deposit, withdrawal and conversion behavior apps need to handle.

What is the difference between ERC-4626 and a regular ERC-20 token?

ERC-20 supplies the common token functions. ERC-4626 extends that interface with vault accounting and asset-to-share operations, so an app can work with a vault through standardized calls.

Deposit vs mint in ERC-4626: which should you call?

Use deposit when the asset amount is fixed and the share output can vary. Use mint when the share amount is fixed and the assets required can vary.

Before using a new vault, inspect its underlying asset, totalAssets, conversion estimates and available limits. Empty or tiny vaults can face a donation inflation attack: an attacker deposits first, donates assets to the vault to inflate the apparent share price, then causes a later depositor’s share calculation to round down sharply—potentially to zero. OpenZeppelin’s virtual-share offset adds virtual assets and shares to the calculation, blunting this attack; confirm what protection the vault actually uses before depositing.

Morpho vaults implement ERC-4626, illustrating how a vault strategy can vary while the user-facing interface remains familiar. Reading the functions and checking the vault’s initial-supply protections gives you a practical way to assess what a deposit should return.

Related questions

How does the share price of an ERC-4626 vault grow over time?

It can change as the vault’s managed assets change relative to its share supply. The strategy and accounting determine that change; ERC-4626 standardizes how the vault reports and converts assets and shares.

What is ERC-7540 and how do asynchronous vaults differ?

ERC-7540 extends ERC-4626 for asynchronous deposit or withdrawal flows. A request may need to be submitted and fulfilled before assets or shares are exchanged, rather than completing in one immediate operation.

How do I integrate an ERC-4626 vault into my app's frontend?

Read the asset and vault totals, use the relevant preview and max functions for the intended operation, then show the user the estimated assets or shares and any applicable limits before they submit.