Vault Creation

Voltr Protocol - Vault Creation Guide

This guide walks through the process of creating and initializing a new vault in the Voltr Protocol.

Setup

First, import the required dependencies:

import { BN } from "@coral-xyz/anchor";
import { VaultConfig, VaultParams, VoltrClient } from "@voltr/vault-sdk";
import {
  Connection,
  Keypair,
  PublicKey,
  sendAndConfirmTransaction,
} from "@solana/web3.js";
import { BN } from "@coral-xyz/anchor";

Step-by-Step Guide

1. Prepare Vault Configuations

const vaultConfig: VaultConfig = {
  maxCap: new BN(0),            // Maximum vault capacity
  startAtTs: new BN(0),         // Start timestamp
  managerPerformanceFee: 1000,  // 10% in basis points
  adminPerformanceFee: 500,     // 5% in basis points
  managerManagementFee: 50,     // 0.5% in basis points
  adminManagementFee: 25,       // 0.25% in basis points
};

const vaultParams: VaultParams = {
  config: vaultConfig,
  name: "My Voltr Vault",
  description: "Description of your vault strategy"
};

2. Define Required Variables

3. Create Vault Initialization Instruction

4. Send and Confirm the Instruction

Account Structure

Vault Account

The vault account contains the following data:

Important Considerations

Security Best Practices

  1. Key Management:

    • Keep admin and manager keys separate

    • Use different keypairs for different environments

    • Never commit private keys to version control

  2. Fee Configuration:

    • Management fees: typically 0.25% - 2% (25-200 basis points)

    • Performance fees: typically 5% - 20% (500-2000 basis points)

    • Consider the impact on user returns

  3. Asset Handling:

    • Validate token decimals match between asset and LP tokens

    • Set appropriate maxCap to prevent overflow

    • Account for minimum deposit requirements

Error Handling

Common error scenarios and solutions:

  1. Initialization Failures:

    • Verify account rent exemption

    • Check authority permissions

    • Ensure unique vault name

  2. Strategy Integration:

    • Validate strategy program compatibility

    • Check account ownership

    • Verify remaining account requirements

  3. Transaction Failures:

    • Monitor for insufficient funds

    • Handle RPC timeouts

    • Implement proper retry logic

For additional support or questions, refer to the Voltr SDK documentation or example scripts.

Last updated