Activate and manage a synchronous vault
This page will guide you through activating synchronous deposits.
Synchronicity is an advanced feature. Please read this page entirely before activating synchronous deposits on your vaults.
This feature is not available on Mantle.
How do synchronous deposits work?
By giving a lifespan
to your vault valuation, you allow the vault to process deposits.
The amount of shares received is computed using the price per share at the last valuation update. When syncDeposit()
is available, the requestDeposit()
function is disabled. Redemptions continue to be processed asynchronously.
Arbitrage and the danger of synchronous deposits
Most Lagoon Vaults rely on offchain oracles to know their valuation. Since this value is not continuously assessed, it might differ from reality with time.
For example 2 days after a valuation update, the fair valuation might have increase while it's registered value in the vault is still the same, such situation would create an arbitrage opportunity at the expense of shares holders.
We advice vault curator and administrators to be extremely careful with this feature.
How to activate synchronous deposits ?
First give your totalAssets variable a lifespan. This value, expressed in seconds, determines for how long users will be able to call syncDeposits. To update it, call as the safe
role:
function updateTotalAssetsLifespan(uint128 lifespan) onlySafe;
lifespan
Duration in seconds during which the valuation will be considered valid.
The lifespan value can't be too close to uint128.max because it might cause an overflow. If you want to allow sync deposits for an "unlimited" amount of time, you can put: 31536000000
seconds, roughly ~1000 years.
Now update the valuation of your vault as usual. After the call to settleDeposit or settleRedeem, users will be able to do synchronous deposits.
How to update the valuation while totalAssets is valid and how to go back to asynchronous mode ?
It is not possible to propose a new valuation while the current one is considered valid (see point above).
To update the valuation, the safe
role first has to call:
function expireTotalAssets() onlySafe;
After this call, isTotalAssetsValid
will return false and the Valuation Oracle
and the safe
can follow the standard Update the vault valuation & settle requests procedure.
Last updated