Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.voltr.xyz/llms.txt

Use this file to discover all available pages before exploring further.

You can also create a vault without code at vaults.ranger.finance/create. See Quick Start (UI).
The current SDK flow is based on @solana/kit plus direct instruction builders.

Setup

import fs from "fs";
import {
  createKeyPairSignerFromBytes,
  generateKeyPairSigner,
} from "@solana/kit";
import { findAssociatedTokenPda } from "@solana-program/token";
import {
  findVaultAssetIdleAuthPda,
  getInitializeVaultInstructionAsync,
} from "@voltr/vault-sdk";

1. Define Vault Parameters

const vaultParams = {
  maxCap: 18_446_744_073_709_551_615n,
  startAtTs: 0n,
  lockedProfitDegradationDuration: 86_400n,
  managerPerformanceFee: 1_000,
  adminPerformanceFee: 500,
  managerManagementFee: 50,
  adminManagementFee: 25,
  redemptionFee: 10,
  issuanceFee: 10,
  withdrawalWaitingPeriod: 0n,
  name: "My Voltr Vault",
  description: "Short vault strategy description",
};
maxCap: 0n means zero capacity, not unlimited capacity. For an uncapped vault, use the full u64 max value.
Keep the description within the on-chain limit. Oversized metadata will cause the transaction to fail.

2. Load Signers And Derive Vault Accounts

const adminSigner = await createKeyPairSignerFromBytes(
  Uint8Array.from(JSON.parse(fs.readFileSync("/path/to/admin.json", "utf-8")))
);
const managerSigner = await createKeyPairSignerFromBytes(
  Uint8Array.from(JSON.parse(fs.readFileSync("/path/to/manager.json", "utf-8")))
);

const vaultSigner = await generateKeyPairSigner();
const assetMint = "ASSET_MINT_ADDRESS" as const;
const assetTokenProgram = "TOKEN_PROGRAM_ADDRESS" as const;

const [vaultAssetIdleAuth] = await findVaultAssetIdleAuthPda({
  vault: vaultSigner.address,
});
const [vaultAssetIdleAta] = await findAssociatedTokenPda({
  owner: vaultAssetIdleAuth,
  mint: assetMint,
  tokenProgram: assetTokenProgram,
});

3. Build The Initialize Instruction

const initializeVaultIx = await getInitializeVaultInstructionAsync({
  payer: adminSigner,
  admin: adminSigner.address,
  manager: managerSigner.address,
  vault: vaultSigner,
  vaultAssetMint: assetMint,
  vaultAssetIdleAta,
  assetTokenProgram,
  ...vaultParams,
});

4. Send The Transaction

Send the returned instruction with your standard @solana/kit transaction flow. The admin signs as payer and the generated vault keypair signs as the new account. Save the resulting vault address. You will use it for:
  1. LP metadata
  2. Strategy setup
  3. Allocation
For the full account schema and helper exports, see SDK Reference.