Skip to main content
Change page

ERC-4626 Tokenized Vault Standard

Introduction

ERC-4626 is a standard to optimize and unify the technical parameters of yield-bearing vaults. It provides a standard API for tokenized yield-bearing vaults that represent shares of a single underlying ERC-20 token. ERC-4626 also outlines an optional extension for tokenized vaults utilizing ERC-20, offering basic functionality for depositing, withdrawing tokens and reading balances.

The role of ERC-4626 in yield-bearing vaults

Lending markets, aggregators, and intrinsically interest-bearing tokens help users find the best yield on their crypto tokens by executing different strategies. These strategies are done with slight variation, which might be error-prone or waste development resources.

ERC-4626 in yield-bearing vaults will lower the integration effort and unlock access to yield in various applications with little specialized effort from developers by creating more consistent and robust implementation patterns.

The ERC-4626 token is described fully in EIP-4626opens in a new tab.

Asynchronous vault extension (ERC-7540)

ERC-4626 is optimized for atomic deposits and redemptions up to a limit. If the limit is reached, no new deposits or redemptions can be submitted. This limitation does not work well for any smart contract system with asynchronous actions or delays as a prerequisite for interfacing with the Vault (e.g., real-world asset protocols, undercollateralized lending protocols, cross-chain lending protocols, liquid staking tokens, or insurance safety modules).

ERC-7540 expands the utility of ERC-4626 Vaults for asynchronous use cases. The existing Vault interface (deposit/withdraw/mint/redeem) is fully utilized to claim asynchronous Requests.

The ERC-7540 extension is described fully in ERC-7540opens in a new tab.

Multi-asset vault extension (ERC-7575)

One missing use case that is not supported by ERC-4626 is Vaults which have multiple assets or entry points such as liquidity provider (LP) Tokens. These are generally unwieldy or non-compliant due to the requirement of ERC-4626 to itself be an ERC-20.

ERC-7575 adds support for Vaults with multiple assets by externalizing the ERC-20 token implementation from the ERC-4626 implementation.

The ERC-7575 extension is described fully in ERC-7575opens in a new tab.

Prerequisites

To better understand this page, we recommend you first read about token standards and ERC-20.

ERC-4626 Functions and Features:

Methods

asset

1functionasset()publicviewreturns(address assetTokenAddress)

This function returns the address of the underlying token used for the vault for accounting, depositing, withdrawing.

totalAssets

1functiontotalAssets()publicviewreturns(uint256)

This function returns the total amount of underlying assets held by the vault.

convertToShares

1functionconvertToShares(uint256 assets)publicviewreturns(uint256 shares)

This function returns the amount of shares that would be exchanged by the vault for the amount of assets provided.

convertToAssets

1functionconvertToAssets(uint256 shares)publicviewreturns(uint256 assets)

This function returns the amount of assets that would be exchanged by the vault for the amount of shares provided.

maxDeposit

1functionmaxDeposit(address receiver)publicviewreturns(uint256 maxAssets)

This function returns the maximum amount of underlying assets that can be deposited in a single deposit call, with the shares minted for the receiver.

previewDeposit

1functionpreviewDeposit(uint256 assets)publicviewreturns(uint256 shares)

This function allows users to simulate the effects of their deposit at the current block.

deposit

1functiondeposit(uint256 assets,address receiver)publicreturns(uint256 shares)

This function deposits assets of underlying tokens into the vault and grants ownership of shares to receiver.

maxMint

1functionmaxMint(address receiver)publicviewreturns(uint256 maxShares)

This function returns the maximum amount of shares that can be minted in a single mint call, with the shares minted for the receiver.

previewMint

1functionpreviewMint(uint256 shares)publicviewreturns(uint256 assets)

This function allows users to simulate the effects of their mint at the current block.

mint

1functionmint(uint256 shares,address receiver)publicreturns(uint256 assets)

This function mints exactly shares vault shares to receiver by depositing assets of underlying tokens.

maxWithdraw

1functionmaxWithdraw(address owner)publicviewreturns(uint256 maxAssets)

This function returns the maximum amount of underlying assets that can be withdrawn from the owner balance with a single withdraw call.

previewWithdraw

1functionpreviewWithdraw(uint256 assets)publicviewreturns(uint256 shares)

This function allows users to simulate the effects of their withdrawal at the current block.

withdraw

1functionwithdraw(uint256 assets,address receiver,address owner)publicreturns(uint256 shares)

This function burns shares from owner and send exactly assets token from the vault to receiver.

maxRedeem

1functionmaxRedeem(address owner)publicviewreturns(uint256 maxShares)

This function returns the maximum amount of shares that can be redeemed from the owner balance through a redeem call.

previewRedeem

1functionpreviewRedeem(uint256 shares)publicviewreturns(uint256 assets)

This function allows users to simulate the effects of their redemption at the current block.

redeem

1functionredeem(uint256 shares,address receiver,address owner)publicreturns(uint256 assets)

This function redeems a specific number of shares from owner and sends assets of underlying token from the vault to receiver.

totalSupply

1functiontotalSupply()publicviewreturns(uint256)

Returns the total number of unredeemed vault shares in circulation.

balanceOf

1functionbalanceOf(address owner)publicviewreturns(uint256)

Returns the total amount of vault shares the owner currently has.

Map of the interface

Map of the ERC-4626 interface

Events

Deposit Event

MUST be emitted when tokens are deposited into the vault via the mint and deposit methods.

1eventDeposit(
2addressindexed sender,
3addressindexed owner,
4uint256 assets,
5uint256 shares
6)

Where sender is the user who exchanged assets for shares, and transferred those shares to owner.

Withdraw Event

MUST be emitted when shares are withdrawn from the vault by a depositor in the redeem or withdraw methods.

1eventWithdraw(
2addressindexed sender,
3addressindexed receiver,
4addressindexed owner,
5uint256 assets,
6uint256 shares
7)

Where sender is the user who triggered the withdrawal and exchanged shares, owned by owner, for assets. receiver is the user who received the withdrawn assets.

Further reading

Was this article helpful?

AltStyle によって変換されたページ (->オリジナル) /