Skip to content

Create a New Vault

When you create a new vault, you need to set the configuration of the vault. Most parameters are straight-forward.

For more details on the various configuration options, see Setup and Configure Your Vault

import { LifeCycle } from "@enzymefinance/sdk";
 
const create = LifeCycle.createVault({
    fundDeployer,
    owner,
    name,
    symbol,
    denominationAsset,
    sharesActionTimelockInSeconds,
    feeManagerConfigData,
    policyManagerConfigData,
});
 
await walletClient.sendTransaction(create.params);
ParameterDescription
fundDeployerAddress of the current FundDeployer contract (see Contract Addresses)
ownerAddress of the vault owner. This usually is the same address as the sender of the transaction, however, it can also be different.
nameThe name of the vault
symbolThe symbol of the vault
denominationAssetAddress of the denomination asset
sharesActionTimelockInSecondsTimelock for redemptions (in seconds)
feeManagerConfigDataFee configuration of the vault (see below)
policyManagerConfigDataPolicy configuration of the vault (see below)

Policy configuration

A vault can use policies if desired. Policies typically have configuration parameters. For the addresses of the individual policies, see Contract Addresses.

import { Policy, Policies } from "@enzymefinance/sdk";
 
const policy1Config = Policies.MinMaxInvestment.encodeSettings({
    minInvestmentAmount,
    maxInvestmentAmount
});
 
const policy2Config =
    Policies.CumulativeSlippageTolerance.encodeSettings({
        slippageTolerance
    }
);
 
const feeManagerConfigData = Policy.encodeSettings([
    {
        address: minMaxInvestmentPolicyAddress,
        settings: policy1Config
    },
    {
        address: cumulativeSlippageTolerancePolicyAddress,
        settings: policy2Config
    },
]);

Fee configuration

A vault can use fees if desired. Fees typically have configuration parameters. For the addresses of the individual fees, see Contract Addresses.

import { Fee, Fees } from "@enzymefinance/sdk";
 
const fee1Config = Fees.Management.encodeSettings({
    perAnnumRate,
});
 
const fee2Config = Fees.Performance.encodeSettings({
    rateInBps
});
 
const feeManagerConfigData = Fee.encodeSettings([
    {
        address: managementFeeAddress,
        settings: fee1Config
    },
    {
        address: performanceFeeAddress,
        settings: fee2Config
    },
]);