Creates a new VoltrClient instance
Solana connection instance
Optional
wallet: KeypairOptional keypair for signing transactions
Creates an instruction to add a strategy to a vault
Parameters for adding strategy to vault
Promise resolving to a TransactionInstruction
Calculates the amount of assets that would be received for a given LP token amount
Public key of the vault
Amount of LP tokens to calculate for
Promise resolving to the amount of assets that would be received
Calculates the amount of LP tokens that would be received for a given asset deposit
Amount of assets to deposit
Public key of the vault
Promise resolving to the amount of LP tokens that would be received
Creates a deposit instruction
Amount of tokens to deposit
Deposit parameters
Promise resolving to a TransactionInstruction
Creates an instruction to deposit assets into a strategy
Amount of assets to deposit
Strategy deposit parameters
Promise resolving to a TransactionInstruction
Creates an instruction to initialize a new vault
Parameters for initializing the vault
Promise resolving to a TransactionInstruction
const ix = await client.createInitializeVaultIx({
vault: vaultKeypair,
vaultAssetMint: new PublicKey('...'),
admin: adminPubkey,
manager: managerPubkey,
payer: payerPubkey,
vaultParams: {
config: {
managementFee: 50, // 0.5%
performanceFee: 1000, // 10%
maxCap: new BN('1000000000')
},
name: "My Vault",
description: "Example vault"
}
});
Creates an instruction to remove a strategy from a vault
Parameters for removing strategy
Promise resolving to a TransactionInstruction
Creates an instruction to initialize a new strategy
Type of strategy to create (marginfi or kamino or drift or solend)
Strategy initialization parameters
Promise resolving to a TransactionInstruction
Creates a withdraw instruction
Amount of LP tokens to withdraw
Withdraw parameters
Promise resolving to a TransactionInstruction
Creates an instruction to withdraw assets from a strategy
Amount of assets to withdraw
Strategy withdrawal parameters
Promise resolving to a TransactionInstruction
Fetches an adaptor strategy account's data
Public key of the adaptor strategy account
Promise resolving to the adaptor strategy account data
Fetches all strategy accounts
Promise resolving to an array of strategy accounts
Fetches a strategy account's data
Public key of the strategy
Promise resolving to the strategy account data
Fetches a vault account's data
Public key of the vault
Promise resolving to the vault account data
Fetches a vault strategy account's data
Public key of the vault strategy account
Promise resolving to the vault strategy account data
Fetches all vault strategy accounts
Public key of the vault asset idle auth
Promise resolving to an array of vault strategy accounts
Finds all strategy-related addresses
Public key of the vault
Public key of the vault's asset idle authority
Public key of the counterparty asset token account
Object containing all strategy-related PDAs
Finds all vault-related addresses
Public key of the vault
Object containing all vault-related PDAs
Finds the vault strategy PDA for a given vault and strategy
Public key of the vault's asset idle authority
Public key of the strategy
The PDA for the vault strategy account
Main client for interacting with the Voltr protocol
Remarks
The VoltrClient provides methods for initializing and managing vaults, handling strategies, and performing deposits/withdrawals. It requires a Solana connection and optionally accepts a wallet for signing transactions.
Example