Deposit and Withdraw flows
Lagoon vaults' deposit and withdrawal flows are based on an asynchronous mechanism.
Last updated
Lagoon vaults' deposit and withdrawal flows are based on an asynchronous mechanism.
Last updated
Users manifest their desire to enter a vault by calling requestDeposit
. During this operation, users' assets are transferred to the pending silo.
For more security, it is a two-steps procedure:
First, the valuation oracle will propose the valuation by storing it in the vault.
Then, the curator can accept this valuation by calling settleDeposit
.
If there are pending deposit requests, they will be settled and the corresponding shares are minted.
3) Claim the shares
The redemption flow is the same as deposit one with some little differences:
Users can't cancel their withdraw requests. This is to prevent users from making curator unwind positions for nothing.
Curator can't claim on behalf of users and distribute back the assets. The user must claim them.
To settle the requests, the vault need the fair valuation of its various positions. In Lagoon, this information is injected into the smart contract by the .
After the settlement, users start earning directly. Their ownership of of the vault is represented by an ERC20 token, named the share. Shares are waiting inside the vault and can be claimed anytime. To get the exact position of a user you can follow this tutorial .
It is possible for the curator to claim the shares on behalf of the users. In this case, the shares will be transferred to the address of the user. You can find how .