Skip to main content
This guide explains how to use the Ranger Earn SDK to deposit and withdraw funds between the vault’s idle account and strategies. The generic Voltr side uses:
  • getDepositStrategyInstructionAsync
  • getWithdrawStrategyInstructionAsync
The protocol side determines:
  • strategy address derivation
  • required ATAs and protocol accounts
  • any remaining accounts needed by the adaptor

Deposit To A Strategy

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

const depositIx = await getDepositStrategyInstructionAsync({
  manager: managerSigner,
  vault: vaultAddress,
  vaultAssetMint: assetMintAddress,
  assetTokenProgram,
  strategy: strategyAddress,
  depositAmount: 1_000_000n,
  adaptorProgram,
  remainingAccounts: [
    // protocol-specific accounts
  ],
});

Withdraw From A Strategy

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

const withdrawIx = await getWithdrawStrategyInstructionAsync({
  manager: managerSigner,
  vault: vaultAddress,
  vaultAssetMint: assetMintAddress,
  assetTokenProgram,
  strategy: strategyAddress,
  withdrawAmount: 500_000n,
  adaptorProgram,
  remainingAccounts: [
    // protocol-specific accounts
  ],
});

Operational Notes

  • ATAs created for strategy operations are usually a one-time manager-paid rent cost.
  • The manager should keep some idle vault liquidity for withdrawals.
  • Batch ATA setup and allocation instructions when possible.
  • Use the maintained adaptor repos for the exact account wiring.

Protocol Repositories

Protocol / AdaptorExample Repos
Kamino AdaptorKamino Vault, Kamino Lending Market
Drift AdaptorDrift Lend, Drift Perps
Jupiter AdaptorSpot via Jupiter Swap, Jupiter Lend
Trustful AdaptorCentralised Exchanges