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.
Vault owners can attach lending, spot, Kamino, Drift, and trustful-style strategies through adaptor programs.
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.