Functionality
Deposit
The deposit() function allows users to restake a supported asset on EigenLayer.
Users are allowed to deposit a supported asset to the corresponding vault in any amount that is greater than minAmount.
Copy
Before sending a deposit transaction, ensure that the vault has sufficient allowances for spending your assets (utilizing the transferFrom() function). A successful deposit transaction results in minting an appropriate amount of the corresponding LRT and a Deposit event:
Copy
To determine the minted amount of LRT, use the following formula (amount
– deposited amount of LST):
Copy
Code Sample
Let’s say the user wants to restake and decided on a specific amount of the LST and receiverAddress that will be issued the mintedAmount of LRT.
Copy
Workflow
User deposits into InceptionVault.
Vault deposits the user amount directly to EigenLayer via
strategyManager::delegateIntoStrategy()
.InceptionVault mints a corresponding amount of the LRT (instETH or inrETH respectively) for the user’s wallet.
See the example transaction on Ethereum Mainnet.
Withdraw
The withdraw() function allows users to unstake from the corresponding vault on EigenLayer, burning the user LRTs to get back the original asset.
During the withdrawal process, the corresponding vault instance stores the pending withdrawal amounts. Let us make the withdrawal process grandma-clear. It may be divided into the following steps:
The vault burns the input amount of an appropriate LRT at the user’s address (no approval needed).
The vault updates the global pending withdrawal state and the user’s pending withdrawal state with the corresponding receiverAddress and asset amount. The amount will be received to the receiverAddress upon the redeeming process.
The vault emits a withdrawal event with the pending amount:
Copy
In order to get the pending withdraw amount use the following function in
iVault
:Copy
See the example transaction on Ethereum Mainnet.
Redeem
The redeem() functions is applied at the final step, in which the user receives the pending asset amount that becomes available after the next rebalancing procedure.
Workflow
The user (anyone) calls
iVault::redeem()
with a properreceiverAddress
(that persists in the global state).The Inception vault calls
iVault::isAbleToRedeem()
to ensure that the user is able to claim at least one pending withdrawal.Copy
If able to redeem, the vault adds up all the available corresponding withdrawals, transfers the resulting amount to receiverAddress, and updates the global withdrawal state.
See the example transaction on Ethereum Mainnet.
Flash Unstake
FlashWithdrawal feature.
It generally allows users to withdraw their underlying assets from a vault immediately by paying an extra fee.
The following functions facilitate the process:
flashWithdraw()
calculateFlashWithdrawFee()
flashWithdrawCapacity()
The FlashWithdrawal feature is available only when the flashPool capacity is sufficient. In particular, if a user wants to withdraw sharesToWithdraw shares of a corresponding Inception token, they should ensure that the flashWithdrawCapacity() is greater than or equal to the amount. Then, they should calculate the flash withdrawal fee that will be charged for processing the flash withdrawal. The resulting amount that the user will receive can be calculated as:
expectAmount = vault.convertToAssets(sharesToWithdraw)
receiveAmount = expectAmount - vault.calculateFlashWithdrawFee(expectAmount)
Known Issues
On each transfer, stEth loses 1–2 wei.
Last updated