Lagoon
  • Back to App
  • Overview
    • What is Lagoon?
    • Lagoon Vault Architecture
    • FAQ
    • Terminology
  • VAULT
    • Overview
    • Deposit and Withdraw flows
    • Vault valuation
    • Fees
    • Roles and capacities
      • Vault admin
      • Valuation Oracle
      • Curator
      • Whitelist Manager
    • Create your vault
      • Vault post-deployment operations
      • Access your vault on Lagoon
    • How to?
      • Update the vault valuation & settle requests
      • Activate and manage a synchronous vault
      • Migrate an existing vault into a new Lagoon vault ?
      • How to pause a vault
  • Curation solutions
    • Safe & Zodiac Roles Modifier
    • MPC (Multi-Party Computation) wallet
    • How to?
      • Renounce Safe & Zodiac role modifier ownership
  • Developer hub
    • Key Data Structures and Epoch mechanism
    • Integration
      • Get a user position
      • Async deposit flow
      • Synchronous deposit flow
      • Vaults Frontend Integration
  • RESOURCES
    • Addresses
    • Audits
    • Brand Kit
    • Github
    • X
    • Blog
    • LinkedIn
Powered by GitBook
On this page
  • How do synchronous deposits work?
  • Arbitrage and the danger of synchronous deposits
  • How to activate synchronous deposits ?
  • How to update the valuation while totalAssets is valid and how to go back to asynchronous mode ?
  1. VAULT
  2. How to?

Activate and manage a synchronous vault

This page will guide you through activating synchronous deposits.

PreviousUpdate the vault valuation & settle requestsNextMigrate an existing vault into a new Lagoon vault ?

Last updated 5 days ago

Synchronicity is an advanced feature. Please read this page entirely before activating synchronous deposits on your vaults.

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;
Variable
Definition

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 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.

update the valuation of your vault