๐ŸญVault Factory

The vault factory contract is used to create vaults. Similarly to the pool factory, the vault factory acts as a directory for the vaults that have been created through the factory. Note that the vault factory is permissioned, meaning the messages can only be executed by the owner of the contract.

The code for the vault factory contract can be found here .


The following are the messages that can be executed on the vault factory:

Instantiate

Instantiates the vault factory. Requires storing the vault and token contracts in advance so that the contract code ids can be provided.

{
  "owner": "inj1...",
  "vault_id": 123,
  "token_id": 456,
  "fee_collector_addr": "inj1..."
}

Migrate

Migrates the vault factory.

{}

ExecuteMsg

Create vault (native/ibc)

Creates a vault. Includes token info and vault fees.

{
  "create_vault": {
    "asset_info": {
      "native_token": {
        "denom": "uluna"
      }
    },
    "fees": {
      "protocol_fee": {
        "share": "0.01"
      },
      "flash_loan_fee": {
        "share": "0.02"
      },
      "burn_fee": {
        "share": "0.0"
      }
    },
    "token_factory_lp": true
  }
}

Migrate vaults

Migrates vault contracts to the given vault code id. If vault_addr is provided, the message migrates only that given vault. Otherwise, it migrates all the vaults created by the factory.

{
  "migrate_vaults": {
    "vault_addr": "inj1...",
    "vault_code_id": 666
  }
}

Update config

Updates the configuration of the vault factory.

{
  "update_config": {
    "owner": "inj1...",
    "fee_collector_addr": "inj1...",
    "vault_id": 123,
    "token_id": 456
  }
}

Remove vault

Removes a vault from the factory's registry.

{
  "remove_vault": {
    "asset_info": {
      "native_token": {
        "denom": "uluna"
      }
    }
  }
}

Update vault config

Updates the configuration of the given vault with the provided UpdateConfigParams.

{
  "update_vault_config": {
    "vault_addr": "inj1...",
    "params": {
      "flash_loan_enabled": true,
      "deposit_enabled": true,
      "withdraw_enabled": true,
      "new_owner": "inj1...",
      "new_vault_fees": {
        "protocol_fee": {
          "share": "0.02"
        },
        "flash_loan_fee": {
          "share": "0.03"
        },
        "burn_fee": {
          "share": "0.0"
        }
      },
      "new_fee_collector_addr": "inj1..."
    }
  }
}

Queries

Config

Retrieves the configuration of the contract in a Config response.

{
  "config": {}
}

Vault

Retrieves the vault address given the AssetInfo.

{
  "vault": {
    "asset_info": {
      "native_token": {
        "denom": "uwhale"
      }
    }
  }
}

Vaults

Retrieves the addresses for all the vaults. Returns an Option<Vec<String>>.

{
  "vaults": {
    "start_after": [
      117,
      106,
      117,
      110,
      111
    ],
    "limit": 10
  }
}

Last updated