The most comprehensive analysis of the Ethereum ERC4626 protocol on the entire network - ERC4626 - yield-bearing vaults

ERC-4626 protocol

income deposits

The ERC4626 protocol is a standard for tokenized vaults that optimizes and unifies the technical parameters of yield vaults. Yield vaults are contracts that use different strategies to provide users with the best yield, such as lending markets, aggregators, or tokens that have interest themselves. The ERC4626 protocol provides a standard API for representing revenue vault shares of a single underlying ERC-20 token.

In this article, we will introduce the usage, advantages and disadvantages of the ERC4626 protocol, and its application scenarios in the DeFi field.

1. What is an income deposit?

Users can obtain a certain proportion of vToken by depositing erc20 Token. During the deposit process of erc20 Token, income will be generated within a certain period of time. After the income expires, users can obtain a certain proportion of the income report based on the number of vTokens they hold.
Insert image description here

The above diagram can be broken down into the following process:
First, vault participants must deposit tokens. Vaults group similar ERC tokens into a pool. Participants in the vault are allocated vault tokens, which reflect their claim on the tokens in the pool.

To optimize returns, the vault utilizes pre-programmed strategies. This strategy looks for the highest yielding opportunities and reallocates a percentage of tokens to optimize the pool’s profits, while retaining some tokens as reserves.

When a user withdraws a token, it is first withdrawn from the vault reserve and then from the yield pool. When a participant withdraws, a withdrawal fee is calculated, which is the sum of gas fees, strategy fees, and finance fees.

2. Application scenarios of income-based vaults

Now that you understand how income vaults work, you may be wondering how to use them. Here are some examples of revenue vault applications:

Fundraising: DAOs and governments use yield-based vaults to raise funds without crowdfunding
Cryptocurrency lending: Companies like Yearn Finance offer protocols that allow users to borrow and Sell ​​crypto assets to maximize their profits
DCA Vault: DCA Vault utilizes income-based strategies to optimize profits

3. What is the ERC4626 protocol?

The Tokenized Vault Standard, also known as ERC-4626, is a standard protocol for tokenized vaults that represent revenue-producing shares of tokens and is built on the ERC-20 token standard.

In other words, ERC-4626 is an extension of ERC-20 that adds new features that allow users to profit from their stakes. Previously using the ERC-20 standard, users could only withdraw no more than the number of tokens they had deposited in their account. ERC-4626 allows users to withdraw amounts in excess of their initial payment over a period of time based on the amount of profit generated by the vault.

As an extension of ERC-20, ERC-4626 implements the following functions:

  • Deposits and withdrawals
  • Vault balance
  • interface
  • event

4. Usage of ERC4626 protocol

Insert image description here

4.1 Method

The ERC4626 protocol is an extension of the ERC-20 token standard that adds some basic functionality to the yield vault, such as depositing, withdrawing tokens, and reading balances. The ERC4626 protocol defines the following methods:

  • asset(): Returns the address of the underlying token used by the vault, which must be an ERC-20 contract.
  • totalAssets(): Returns the total amount of underlying assets held by the vault, which should include any compound interest generated by returns.
  • convertToShares(): Returns the number of shares the vault has converted for a given amount of the underlying asset.
  • convertToAssets(): Returns the number of underlying assets converted by the vault for the given number of shares.
  • maxDeposit(): Returns the maximum amount of underlying assets that the recipient can deposit in a single deposit call.
  • previewDeposit(): Allows users to simulate the effect of their deposit on the current block.
  • deposit(): Deposit the underlying asset into the vault and grant the share to the recipient.
  • maxMint(): Returns the maximum number of shares that the receiver can mint in a single casting call.
  • previewMint(): Allows the user to simulate their minting effects in the current block.
  • mint(): mints shares to the recipient and removes the corresponding amount of underlying assets from the vault.
  • maxWithdraw(): Returns the maximum amount of underlying assets that the recipient can withdraw in a single withdrawal call.
  • previewWithdraw(): allows users to simulate the effects of their withdrawals in the current block.
  • withdraw(): Destroy the shares from the recipient and remove the corresponding number of underlying assets from the vault.
  • maxRedeem(): Returns the maximum number of shares that the recipient can redeem in a single redemption call.
  • previewRedeem(): Allows users to simulate the effects of their redemption in the current block.
  • redeem(): Destroy the shares from the recipient and remove the corresponding amount of underlying assets from the vault.

4.2 Events

The ERC4626 protocol also defines the following events:

  • Deposit: Triggered when a user deposits underlying assets, including the depositor, recipient, deposit amount and number of shares obtained.
  • Mint: Triggered when the user mints shares, including the minter, recipient, minting amount and the number of assets withdrawn.
  • Withdraw: Triggered when the user withdraws the underlying asset, including the withdrawr, receiver, withdrawal amount and number of shares destroyed.
  • Redeem: Triggered when a user redeems a share, including the redeemer, recipient, redemption amount and number of assets withdrawn.

5. Advantages and disadvantages of ERC4626 protocol

5.1 The advantages of the ERC4626 protocol are:

  • It can reduce the difficulty of integrating revenue vaults and provide a unified interface and implementation model for various applications.
  • It improves Yield Vault’s interoperability, allowing it to work seamlessly with other DeFi protocols and tools.
  • It improves the security of your earnings vault and reduces the risk of errors and vulnerabilities.
  • It increases the transparency of earnings vaults, giving users a clearer picture of their assets and earnings.

5.2 The disadvantages of the ERC4626 protocol are:

  • It may not be suitable for some special or complex revenue vaults that require customization or expansion.
  • It may take some time and resources to promote and popularize it so that more developers and users can recognize and use it.

6. Application scenarios of ERC4626 protocol in DeFi field

The ERC4626 protocol has many potential application scenarios in the DeFi field, such as:

  • Lending Market: Users can deposit their tokens into an ERC4626 vault, obtain share tokens, and then lend or borrow other tokens using the share tokens as collateral, allowing for leverage or arbitrage.
  • Aggregators: Users can deposit their tokens into ERC4626 vaults and let the aggregator find the best yield strategy for them, whether across different lending markets, liquidity pools, mining protocols, etc.
  • Tokens that have interest on their own: Users can deposit their tokens into an ERC4626 vault and receive share tokens that have interest on their own, without having to do anything further.

7. Summary

The ERC4626 protocol is a standard for tokenized vaults that optimizes and unifies the technical parameters of yield vaults. It provides a standard API for yield vaulting of a single underlying ERC-20 token and provides basic functionality for deposits, withdrawals, minting, redemption, and more. It has many potential application scenarios in the DeFi field and can provide users with more choices and convenience. It also helps drive the development and innovation of yield vaults, adding more value to the DeFi ecosystem.
Insert image description here

material

ERC-4626 Tokenized Vault Standard | ethereum.org

Guess you like

Origin blog.csdn.net/YSS_33521/article/details/131274251