Skip to main content
Vault owners can attach lending, spot, Kamino, Drift, and trustful-style strategies through adaptor programs.
Managers: the sdk-scripts CLI does this with vault:add-adaptor followed by a per-integration *:init command (e.g. kamino:market:init, spot:earn:init) — it derives the strategy, discriminator, and accounts for you. This page shows the programmatic SDK path for embedding strategy setup in your own code.

Setup

The v2 SDK uses direct instruction builders:
import fs from "fs";
import { createKeyPairSignerFromBytes } from "@solana/kit";
import {
  getAddAdaptorInstructionAsync,
  getInitializeStrategyInstructionAsync,
} from "@voltr/vault-sdk";

1. Add The Adaptor

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

const addAdaptorIx = await getAddAdaptorInstructionAsync({
  payer: adminSigner,
  admin: adminSigner.address,
  vault: vaultAddress,
  adaptorProgram: adaptorProgramAddress,
});
This is a one-time operation per adaptor program.

2. Initialize The Strategy

Strategy initialization is protocol-specific. You need:
  • the target strategy PDA or address
  • the adaptor program address
  • the protocol-specific instructionDiscriminator
  • any extra serialized arguments
  • the required remaining accounts
const initializeStrategyIx = await getInitializeStrategyInstructionAsync({
  payer: adminSigner,
  manager: managerAddress,
  vault: vaultAddress,
  strategy: strategyAddress,
  adaptorProgram: adaptorProgramAddress,
  instructionDiscriminator,
  additionalArgs: new Uint8Array(),
  remainingAccounts: [
    // protocol-specific accounts
  ],
});

What Is Protocol-Specific

The Voltr side is stable. The following pieces vary by adaptor and target protocol:
  • how the strategy address is derived
  • the instruction discriminator
  • the remaining accounts list
  • any extra arguments required by the adaptor
Use the maintained adaptor repos as the source of truth for those details.