Deposit and Withdraw flows
Lagoon vaults' deposit and withdrawal flows are based on an asynchronous mechanism.
Deposit flow

1) Request Deposit
Users manifest their desire to enter a vault by calling requestDeposit
. During this operation, users' assets are transferred to the pending silo.
2) Valuation update and settlement
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 Valuation Oracle.
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
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 Get a user position.
Redemption flow
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.

Last updated