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
  • Step1: Pause the deprecated vault and take a snapshot of its shares repartition
  • Step2: Create a Lagoon vault
  • Step3: Deposit all the assets into the Lagoon vault
  • Step4: Distribute the shares to the owners of the previous vault
  • Final notes:
  1. VAULT
  2. How to?

Migrate an existing vault into a new Lagoon vault ?

PreviousActivate and manage a synchronous vaultNextHow to pause a vault

Last updated 29 days ago

This tutorial will explain how to migrate an existing vault or fund into a Lagoon vault without needing an action from your shareholders.

Migrating a vault is a dangerous procedure please procede if you know what you are doing.

Prerequisites:

  • having the capacity to approve and deposit the assets of the deprecated vault into the future Lagoon vault.

  • having all assets funds in underlying. Eg: in a USDC vault you should only have USDC.

  • the vault shares should not be used in DeFi.

It is still possible to do a migration with partial or no assets in the underlying but it might no be adapted for every situation. If you must do it, please reach out .

This tutorial assumes that you have a clear understanding of how To showcase the migration process, we will use a USDC vault as an example.

Step1: Pause the deprecated vault and take a snapshot of its shares repartition

We advice to pause the vault or at least freeze movement of shares to avoid loss of funds from your users.

In our case, here is the result of our snapshot:

address
amount of shares
% of the vault

0x123

4

40%

0x456

6

60%

TOTAL

10

100%

Concretly, the address 0x123 owns 4 shares out of the 10 total shares, which is equivalent to 40%.

Step2: Create a Lagoon vault

Step3: Deposit all the assets into the Lagoon vault

In our case, after claim we received exactly 100 shares.

Step4: Distribute the shares to the owners of the previous vault

The address of the token you want to distribute is the address of shares which is the address of the vault. In our case, 0xabc.

We will now distribute 40 shares to the address 0x123 and 60 shares to the address 0x456. In disperse.app frontend it will be something like this:

Final notes:

  • the Lagoon Vault performance metrics will start from 0, meaning that you will have to reconcile the deprecated vault and the vault historics to have the full picture of your performance.

  • the deprecated vault shares will be worth 0, meaning that you can't do a migration on a vault that is used in DeFi.

. In our case, it will be a USDC vault and its address is 0xabc.

This is a tricky part of the procedure. When you will to accept your own deposit, you must input 0 as the valuation. If you input any other number, your vault shares accounting system will be broken and you will have to start again.

In our case, the total value of the first vault was 100 USDC, so we will do a requestDeposit of 100 USDC and . Then, we claim our shares by calling the deposit function. Go over if you need to know more about the deposit flow.

You can distribute the shares using dedicated tool. Be careful, frontend could be compromised, review the transactions carefully. We are going to use the but If you are more confortable using blockchain explorer you can enter disperse.app in etherscan to find directly the smart contract to interact with.

here
Lagoon's vault valuation works.
Follow this guide
update the valuation of the vault
update the valuation
Async Deposit Flow
disperse.app