ERC-4626 Tokenized Vaults Explained: The Standard Behind DeFi Yield Vaults

— By Tony Rabbit in Tutorials

ERC-4626 Tokenized Vaults Explained: The Standard Behind DeFi Yield Vaults

ERC-4626 is the token standard that powers nearly every modern DeFi yield vault. Learn how shares accrue yield, how deposits and withdrawals work, why composability matters, and the first-depositor inflation attack to watch for.

An ERC-4626 tokenized vault is a smart contract standard that defines a single, predictable interface for yield-bearing vaults on Ethereum and EVM chains. When you ask "what is ERC-4626 tokenized vault," the short answer is this: it is a contract that takes a deposit of one underlying asset, mints you transferable shares that represent your proportional claim on everything inside, and lets that claim grow in value as the vault earns yield. Built on top of ERC-20, it was finalized in 2022 and has since become the default plumbing behind aggregators, lending markets, liquid staking wrappers, and structured products. If you have deposited into a modern yield vault in the last two years, you almost certainly touched a 4626 contract without realizing it.

Key Takeaways

  • ERC-4626 standardizes deposit, withdraw, and accounting functions so every vault behaves the same way.
  • You hold transferable shares, and yield shows up as a rising assets-per-share ratio, not as new tokens in your wallet.
  • Because the interface is uniform, vaults plug into other protocols as composable money-legos.
  • Empty vaults can be vulnerable to a donation or inflation attack on the first depositor, now mitigated by virtual shares.

What ERC-4626 standardizes and why nearly every modern yield vault uses it

Before ERC-4626, every yield protocol invented its own deposit and withdraw logic. A wallet, a dashboard, or another contract that wanted to integrate ten vaults had to write ten different adapters. The standard fixed that by mandating a common set of functions: deposit and mint to enter, withdraw and redeem to exit, plus read-only views like totalAssets, convertToShares, and convertToAssets so anyone can price a share without guessing. There are also preview functions that simulate the exact result of an action before you sign it.

The payoff is integration speed. A single piece of code can read any compliant vault, which is why aggregators and infrastructure layers adopted it almost universally. Projects covered in our guides to Yearn, Beefy, and Sommelier and to Yearn Finance V3 vaults lean on the standard precisely because it removes integration friction for both developers and the strategies they route capital into.

The share model and how assets-per-share accrues yield over time

The mechanic that confuses newcomers most is that your share balance usually never changes. When you deposit, the vault mints a fixed number of shares. As the underlying strategy earns, the vault's totalAssets climbs while the total share supply stays constant, so each share becomes redeemable for more of the underlying asset. This ratio, often called the price-per-share or exchange rate, is the whole game.

Concretely: if a vault holds 1,000 USDC backing 1,000 shares, one share equals 1 USDC. After the strategy earns 100 USDC, the vault holds 1,100 USDC against the same 1,000 shares, so each share is now worth 1.1 USDC. You did nothing and your share count is unchanged, but your claim grew. This is why a 4626 share token can quietly trade above its initial value, and why you should always value a position by shares multiplied by the current exchange rate rather than by the raw share number.

FunctionWhat it doesYou specify
depositAdd assets, receive sharesAmount of assets in
mintReceive an exact share amountShares you want
withdrawPull an exact asset amount, burn sharesAssets you want out
redeemBurn an exact share amount for assetsShares to burn
previewDepositSimulate shares from a depositNothing, read-only

Deposit and withdraw mechanics, how shares are minted and burned

Entering and exiting a vault is symmetrical. On deposit, the contract transfers your assets in, calculates how many shares that buys at the current exchange rate, and mints them to you. The dual function mint flips the input: you ask for a precise number of shares and the contract pulls the corresponding assets. Both routes converge on the same internal ratio.

On the way out, withdraw lets you name an exact asset amount and burns just enough shares to cover it, while redeem burns a set number of shares and pays out whatever assets they are worth at that moment. The preview functions matter here because some vaults charge fees or apply rounding, and previewing shows the real number before you commit. Note that not all vaults offer instant liquidity; strategies with lockups or unwinding delays may queue your withdrawal, which is a key thing to check on the kind of products described in our overview of DeFi yield strategies.

Why composability matters and how vaults plug into other protocols

Because every 4626 vault speaks the same language, its shares behave like a standard ERC-20 that other protocols can accept, lend against, or wrap. A share token can be used as collateral in a money market, deposited into a second vault, paired in a liquidity pool, or bundled into a structured product, all without custom integration code. This is the money-lego property that makes DeFi composable rather than siloed.

Infrastructure projects build entire businesses on this. Yield routers and vault frameworks, including the kind explained in our guide to Veda and BoringVault yield infrastructure, expose a 4626-style interface so that strategies underneath can be swapped or stacked while the share token stays a clean, predictable building block for everyone downstream.

The inflation and donation attack and why first-depositor risk exists

The most famous weakness of the standard targets brand-new, empty vaults. The classic version works like this: an attacker becomes the very first depositor with a tiny amount, mints a single share, then directly transfers, or donates, a large sum of the underlying asset straight into the vault contract. Now one share is backed by an enormous balance. When an honest user deposits next, integer rounding can mint them zero shares while their assets are absorbed into the inflated share price, and the attacker redeems their single share to capture the difference.

The widely adopted fix is virtual shares and virtual assets, where the contract internally pretends a small amount of phantom shares and assets always exist. This makes the rounding math too expensive to exploit and neutralizes the donation. Many vaults also seed an initial deposit themselves or burn a portion of the first shares. Still, first-depositor risk is real on freshly deployed, unaudited contracts, which is the same caution we stress when covering how to earn yield on stablecoins safely.

What users should check before depositing into an ERC-4626 vault

Treat the standard as a guarantee of interface, not of safety. The 4626 spec makes a vault easy to read and integrate, but it says nothing about whether the underlying strategy is sound, the code is audited, or the team is trustworthy. Before you deposit, confirm the vault is not freshly deployed and empty, check whether it uses virtual shares or an initial seed, and read the preview functions on-chain to see the real exchange rate and any fees.

Also verify the underlying asset is exactly what you expect, look for an audit and a track record of total assets over time, and understand withdrawal terms in case liquidity is queued rather than instant. A vault that lets you exit cleanly today may behave differently under stress if its strategy is illiquid. The standard gives you the tools to inspect all of this transparently, so use them before you commit capital.

This article is for educational purposes only and is not financial advice.

Originally published by DEXTools News. © 2026 DEXTools News (STRADEXT DEFI SOLUTIONS, S.L.). Reproduction or republication without written permission is prohibited.