Skip to main content
@voltr/vault-sdk 2.1.1 is a generated client built around instruction builders, PDA helpers, account fetchers, and extension helpers. The default Solana client stack is now @solana/kit.

Installation

Use @solana/web3.js only when an external dependency still requires it.

Core Model

The v2 SDK does not revolve around a VoltrClient class. Instead you compose:
  • get*InstructionAsync(...) builders for writes
  • find*Pda(...) helpers for PDAs
  • fetch* loaders for on-chain accounts
  • extension helpers for fees, LP economics, positions, and withdrawals

Minimal Setup

Common Instruction Builders

Vault lifecycle

  • getInitializeVaultInstructionAsync
  • getUpdateVaultConfigInstructionAsync
  • getCreateLpMetadataInstructionAsync

User flows

  • getDepositVaultInstructionAsync
  • getRequestWithdrawVaultInstructionAsync
  • getCancelRequestWithdrawVaultInstructionAsync
  • getWithdrawVaultInstructionAsync
  • getInstantWithdrawVaultInstructionAsync

Manager and admin flows

  • getAddAdaptorInstructionAsync
  • getInitializeStrategyInstructionAsync
  • getDepositStrategyInstructionAsync
  • getWithdrawStrategyInstructionAsync
  • getDirectWithdrawStrategyInstructionAsync
  • getHarvestFeeInstructionAsync
  • getCalibrateHighWaterMarkInstructionAsync

PDA Helpers

Most integrations need some combination of:
  • findVaultLpMintPda({ vault })
  • findVaultAssetIdleAuthPda({ vault })
  • findVaultStrategyAuthPda({ vault, strategy })
  • findStrategyInitReceiptPda({ vault, strategy })
  • findRequestWithdrawVaultReceiptPda({ vault, userTransferAuthority })
  • findLpMetadataPda({ vault })
  • findAdaptorAddReceiptPda({ vault, adaptorProgram })

Reads And Extensions

Use a kit RPC client plus explicit helpers:
Useful read helpers:
  • fetchVault
  • fetchRequestWithdrawVaultReceipt
  • fetchAllStrategyInitReceiptAccountsOfVault
  • getPositionAndTotalValuesForVault
  • getAccumulatedAdminFeesForVault
  • getAccumulatedManagerFeesForVault
  • getHighWaterMarkForVault
  • getCurrentAssetPerLpForVault
  • getVaultLpSupplyBreakdown
  • getPendingWithdrawalForUser

Updating Vault Config

getUpdateVaultConfigInstructionAsync updates one field at a time, and the payload must already be serialized.
For management-fee fields, append the vault LP mint account to the final instruction accounts:
VaultConfigField includes:
  • MaxCap
  • StartAtTs
  • LockedProfitDegradationDuration
  • WithdrawalWaitingPeriod
  • ManagerPerformanceFee
  • AdminPerformanceFee
  • ManagerManagementFee
  • AdminManagementFee
  • RedemptionFee
  • IssuanceFee
  • Manager
  • PendingAdmin
  • DisabledOperations

Migration From VoltrClient

When upgrading older scripts:
  • replace new VoltrClient(connection) with createSolanaRpc(...) plus direct imports
  • replace client.create*Ix(...) with get*InstructionAsync(...)
  • replace client.find*... with find*Pda(...)
  • replace convenience query methods with fetchVault(...) and extension helpers
  • replace BN arguments with bigint

Reference Implementations

For maintained end-to-end examples that build on top of this SDK, use the unified sdk-scripts repository:
  • the CLI (apps/cli) — every vault and strategy operation as a <group>:<action> command
  • the programmatic examples (examples/) — one runnable file per action (vault, Kamino, Spot, Trustful) showing the operation builders in use
See CLI & Scripts for an overview.