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.

After creating your vault, strategy setup is a two-step process:
  1. add the adaptor to the vault
  2. initialize each strategy you want to deploy to
Vault creation does not initialize any strategies. Until this step is complete, deposits remain idle.

Concepts

  • Adaptor: an on-chain program that knows how to talk to a category of protocols
  • Strategy: a specific target inside that adaptor, such as one market, vault, or counterparty

Add The Adaptor

import { getAddAdaptorInstructionAsync } from "@voltr/vault-sdk";

const addAdaptorIx = await getAddAdaptorInstructionAsync({
  payer: adminSigner,
  admin: adminSigner.address,
  vault: vaultAddress,
  adaptorProgram: adaptorProgramAddress,
});

Initialize The Strategy

import { getInitializeStrategyInstructionAsync } from "@voltr/vault-sdk";

const initStrategyIx = await getInitializeStrategyInstructionAsync({
  payer: adminSigner,
  manager: managerAddress,
  vault: vaultAddress,
  strategy: strategyAddress,
  adaptorProgram: adaptorProgramAddress,
  instructionDiscriminator,
  additionalArgs: new Uint8Array(),
  remainingAccounts: [
    // protocol-specific accounts
  ],
});

Use The Script Repos As Source Of Truth

The exact strategy, discriminator, and remaining accounts are adaptor-specific. Use the maintained repositories for working examples:
Protocol / AdaptorInitialization Repos
Kaminovoltr-kamino-scripts
Jupiter spot and lendvoltr-spot-scripts
Trustfulvoltr-trustful-scripts
Drift / other adaptorscorresponding maintained script repo