Creates a new VoltrClient instance
Solana connection instance
Optionalwallet: KeypairOptional keypair for signing transactions
Optionalopts: ConfirmOptionsCalculates 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
Public key of the vault
Amount of assets to deposit
Promise resolving to the amount of LP tokens that would be received
Calculates the amount of LP tokens that would be burned for a given asset amount
Public key of the vault
Amount of assets to calculate for
Promise resolving to the amount of LP tokens that would be burned
Creates an instruction to accept a protocol admin transfer (2-step admin transfer)
Parameters for accepting protocol admin
Public key of the pending admin (must be signer)
Transaction instruction for accepting protocol admin
Creates an instruction for the pending admin to accept the vault admin role
Parameters for accepting vault admin
Public key of the pending admin (must be signer)
Public key of the vault
Transaction instruction for accepting vault admin
Creates an instruction to add an adaptor to a vault
Parameters for adding adaptor to vault
Public key of the adaptor program
Public key of the admin
Public key of the payer
Public key of the vault
Transaction instruction for adding adaptor to vault
Creates an instruction to calibrate the high water mark
Parameters for calibrating the high water mark
Public key of the admin
Public key of the vault
Transaction instruction for calibrating the high water mark
Creates an instruction to calibrate the high water mark without fee clawback (unsafe)
Parameters for calibrating the high water mark
Public key of the admin
Public key of the vault (must be whitelisted)
Transaction instruction for unsafe calibration
Creates a cancel withdraw instruction for a vault
Cancel withdraw request parameters
Public key of the user authority
Public key of the vault
Transaction instruction for withdrawal
Creates an instruction to close a strategy
Parameters for closing strategy
Public key of the manager
Public key of the payer
Public key of the strategy
Public key of the vault
Transaction instruction for closing strategy
Creates an instruction to create LP metadata
Parameters for creating LP metadata
Name of the LP
Symbol of the LP
URI of the LP metadata
Parameters for creating LP metadata
Public key of the admin
Public key of the payer
Public key of the vault
Transaction instruction for creating LP metadata
Creates an instruction to deposit assets into a strategy
Deposit arguments
OptionaladditionalArgs?: null | Buffer<ArrayBufferLike>OptionalinstructionDiscriminator?: null | Buffer<ArrayBufferLike>Strategy deposit parameters
Public key of the adaptor program
Public key of the asset token program
Public key of the manager
Remaining accounts for the instruction
Public key of the strategy
Public key of the vault
Public key of the vault asset mint
Transaction instruction for depositing assets into strategy
const ix = await client.createDepositStrategyIx(
{
depositAmount: new BN('1000000000'),
instructionDiscriminator: Buffer.from('...'),
additionalArgs: Buffer.from('...')
},
{
manager: managerPubkey,
vault: vaultPubkey,
vaultAssetMint: mintPubkey,
strategy: strategyPubkey,
assetTokenProgram: tokenProgramPubkey,
adaptorProgram: adaptorProgramPubkey,
remainingAccounts: []
}
);
Creates a deposit instruction for a vault
Amount of tokens to deposit
Deposit parameters
Public key of the asset token program
Public key of the user's transfer authority
Public key of the vault
Public key of the vault asset mint
Transaction instruction for depositing tokens
Creates an instruction to withdraw assets from a direct withdraw strategy
Withdrawal arguments
OptionaluserArgs?: null | Buffer<ArrayBufferLike>Optional user arguments for the instruction
Parameters for withdrawing assets from direct withdraw strategy
Public key of the adaptor program
Public key of the asset token program
Remaining accounts for the instruction
Public key of the strategy
Public key of the user
Public key of the vault
Public key of the vault asset mint
Transaction instruction for withdrawing assets from direct withdraw strategy
Creates an instruction to withdraw assets from a direct withdraw strategy with slippage tolerance
Withdrawal arguments
Slippage tolerance in asset amount (max difference between requested and actual)
OptionaluserArgs?: null | Buffer<ArrayBufferLike>Optional user arguments for the instruction
Parameters for withdrawing assets from direct withdraw strategy
Public key of the adaptor program (defaults to lending adaptor)
Public key of the asset token program
Remaining accounts for the instruction
Public key of the strategy
Public key of the user
Public key of the vault
Public key of the vault asset mint
Transaction instruction for direct withdraw with tolerance
Creates an instruction to harvest fees from a vault
Parameters for harvesting fees
Public key of the harvester
Public key of the protocol admin
Public key of the vault
Public key of the vault admin
Public key of the vault manager
Transaction instruction for harvesting fees
Creates an instruction to initialize a direct withdraw strategy
Arguments for initializing direct withdraw strategy
OptionaladditionalArgs?: null | Buffer<ArrayBufferLike>OptionalallowUserArgs?: booleanOptionalinstructionDiscriminator?: null | Buffer<ArrayBufferLike>Parameters for initializing direct withdraw strategy
Public key of the adaptor program
Public key of the admin
Public key of the payer
Public key of the strategy
Public key of the vault
Transaction instruction for initializing direct withdraw strategy
const ix = await client.createInitializeDirectWithdrawStrategyIx(
{
instructionDiscriminator: Buffer.from('...'),
additionalArgs: Buffer.from('...'),
allowUserArgs: true
},
{
payer: payerPubkey,
admin: adminPubkey,
vault: vaultPubkey,
strategy: strategyPubkey,
adaptorProgram: adaptorProgramPubkey
}
);
Creates an instruction to initialize a strategy to a vault
Arguments for strategy initialization
OptionaladditionalArgs?: null | Buffer<ArrayBufferLike>OptionalinstructionDiscriminator?: null | Buffer<ArrayBufferLike>Optionalparams: {Parameters for initializing strategy to vault
Public key of the adaptor program
Public key of the manager
Public key of the payer
Remaining accounts for the instruction
Public key of the strategy
Public key of the vault
Transaction instruction for initializing strategy to vault
const ix = await client.createInitializeStrategyIx(
{
instructionDiscriminator: Buffer.from('...'), // optional
additionalArgs: Buffer.from('...') // optional
},
{
payer: payerPubkey,
vault: vaultPubkey,
manager: managerPubkey,
strategy: strategyPubkey,
adaptorProgram: adaptorProgramPubkey,
remainingAccounts: []
}
);
Creates an instruction to initialize a new vault
Configuration parameters for the vault
Additional parameters for initializing the vault
Public key of the vault admin
Public key of the vault manager
Public key of the fee payer
Keypair for the new vault
Public key of the vault's asset mint
Transaction instruction for initializing the vault
const ix = await client.createInitializeVaultIx(
{
config: {
maxCap: new BN('1000000000'),
startAtTs: new BN(Math.floor(Date.now() / 1000)),
lockedProfitDegradationDuration: new BN(3600), // 1 hour
redemptionFee: 10,
issuanceFee: 10,
withdrawalWaitingPeriod: new BN(3600), // 1 hour
managerManagementFee: 50, // 0.5%
managerPerformanceFee: 1000, // 10%
adminManagementFee: 50, // 0.5%
adminPerformanceFee: 1000, // 10%
},
name: "My Vault",
description: "Example vault"
},
{
vault: vaultKeypair,
vaultAssetMint: new PublicKey('...'),
admin: adminPubkey,
manager: managerPubkey,
payer: payerPubkey
}
);
Creates an instruction to initialize the protocol
Bitflags for allowed operations (e.g., CREATE_VAULT = 1, DEPOSIT_VAULT = 2, etc.)
Parameters for initializing the protocol
Public key of the protocol admin
Public key of the fee payer
Transaction instruction for initializing the protocol
Creates an instant withdraw instruction for a strategy (no waiting period, withdraws directly from strategy)
Instant withdrawal arguments
OptionaluserArgs?: null | Buffer<ArrayBufferLike>Instant withdraw strategy parameters
Public key of the adaptor program (defaults to lending adaptor)
Public key of the asset token program
Remaining accounts for the instruction
Public key of the strategy
Public key of the user's transfer authority
Public key of the vault
Public key of the vault asset mint
Transaction instruction for instant strategy withdrawal
const ix = await client.createInstantWithdrawStrategyIx(
{
amount: new BN('1000000000'),
isAmountInLp: true,
isWithdrawAll: false,
},
{
userTransferAuthority: userPubkey,
vault: vaultPubkey,
strategy: strategyPubkey,
vaultAssetMint: mintPubkey,
assetTokenProgram: tokenProgramPubkey,
remainingAccounts: [],
}
);
Creates an instant withdraw instruction for a strategy with slippage tolerance
Instant withdrawal arguments with tolerance
OptionaluserArgs?: null | Buffer<ArrayBufferLike>Slippage tolerance in asset amount (max difference between requested and actual)
Instant withdraw strategy parameters
Public key of the adaptor program (defaults to lending adaptor)
Public key of the asset token program
Remaining accounts for the instruction
Public key of the strategy
Public key of the user's transfer authority
Public key of the vault
Public key of the vault asset mint
Transaction instruction for instant strategy withdrawal with tolerance
const ix = await client.createInstantWithdrawStrategyWithToleranceIx(
{
amount: new BN('1000000000'),
isAmountInLp: true,
isWithdrawAll: false,
tolerance: new BN(1000),
},
{
userTransferAuthority: userPubkey,
vault: vaultPubkey,
strategy: strategyPubkey,
vaultAssetMint: mintPubkey,
assetTokenProgram: tokenProgramPubkey,
remainingAccounts: [],
}
);
Creates an instant withdraw instruction for a vault (no waiting period required)
Instant withdrawal arguments
Instant withdraw parameters
Public key of the asset token program
Public key of the user's transfer authority
Public key of the vault
Public key of the vault asset mint
Transaction instruction for instant withdrawal
Creates an instruction to remove a strategy from a vault
Parameters for removing strategy
Public key of the adaptor program
Public key of the admin
Public key of the vault
Transaction instruction for removing adaptor from vault
Creates a request withdraw instruction for a vault
Arguments for withdrawing from the vault
Request withdraw parameters
Public key of the payer
Public key of the user authority
Public key of the vault
Transaction instruction for withdrawal
Creates an instruction to update the protocol configuration
The protocol configuration field to update
The serialized data for the new value
Parameters for updating the protocol
Public key of the protocol admin
Transaction instruction for updating the protocol
Creates an instruction to update a specific vault configuration field
The configuration field to update
The serialized data for the new value
Parameters for updating the vault config
Public key of the vault admin
Public key of the vault
OptionalvaultLpMint?: PublicKeyRequired when updating management fees
Transaction instruction for updating the vault config
const newMaxCap = new BN(20_000_000_000_000);
const data = newMaxCap.toArrayLike(Buffer, "le", 8);
const ix = await client.createUpdateVaultConfigIx(
VaultConfigField.MaxCap,
data,
{
vault: vaultPubkey,
admin: adminPubkey
}
);
const newManagerManagementFee = 1000; // 10%
const data = Buffer.alloc(2);
data.writeUInt16LE(newManagerManagementFee, 0);
const vaultLpMint = client.findVaultLpMint(vaultPubkey);
const ix = await client.createUpdateVaultConfigIx(
VaultConfigField.ManagerManagementFee,
data,
{
vault: vaultPubkey,
admin: adminPubkey,
vaultLpMint: vaultLpMint
}
);
Creates an instruction to update per-vault protocol fees (admin-only, protocol level)
The protocol fee field to update
The new fee value in basis points
Parameters for updating the protocol fee
Public key of the protocol admin
Public key of the vault
Transaction instruction for updating the protocol fee
Creates an instruction to withdraw assets from a strategy
Withdrawal arguments
OptionaladditionalArgs?: null | Buffer<ArrayBufferLike>OptionalinstructionDiscriminator?: null | Buffer<ArrayBufferLike>Strategy withdrawal parameters
Public key of the adaptor program
Public key of the asset token program
Remaining accounts for the instruction
Public key of the strategy
Public key of the vault
Public key of the vault asset mint
Transaction instruction for withdrawing assets from strategy
const ix = await client.createWithdrawStrategyIx(
{
withdrawAmount: new BN('1000000000'),
instructionDiscriminator: Buffer.from('...'),
additionalArgs: Buffer.from('...')
},
{
vault: vaultPubkey,
vaultAssetMint: mintPubkey,
strategy: strategyPubkey,
assetTokenProgram: tokenProgramPubkey,
adaptorProgram: adaptorProgramPubkey,
remainingAccounts: []
}
);
Creates a withdraw instruction for a vault
Withdraw parameters
Public key of the asset token program
Public key of the user authority
Public key of the vault
Public key of the vault asset mint
Transaction instruction for withdrawal
Fetches an adaptor add receipt account's data
Public key of the adaptor add receipt account
Promise resolving to the adaptor add receipt account data
Fetches all adaptor add receipt accounts of a vault
Public key of the vault
Promise resolving to an array of adaptor add receipt accounts
Fetches all request withdraw vault receipt accounts of a vault
Public key of the vault
Promise resolving to an array of request withdraw vault receipt accounts
Fetches all strategy init receipt accounts
Promise resolving to an array of strategy init receipt accounts
Fetches all strategy init receipt accounts of a vault
Public key of the vault
Promise resolving to an array of strategy init receipt accounts
Fetches the protocol account's data
Promise resolving to the protocol account data
Fetches a request withdraw vault receipt account's data
Public key of the request withdraw vault receipt account
Promise resolving to the request withdraw vault receipt account data
Fetches a strategy init receipt account's data
Public key of the strategy init receipt account
Promise resolving to the strategy init receipt account data
Finds the direct withdraw init receipt address
Public key of the vault
Public key of the strategy
The PDA for the direct withdraw init receipt
Finds the request withdraw vault receipt address
Public key of the vault
Public key of the user
The PDA for the request withdraw vault receipt
Finds all vault-related addresses
Public key of the vault
Object containing all vault-related PDAs
Finds the vault's asset idle authority address
Public key of the vault
The PDA for the vault's asset idle authority
Finds the vault LP mint address for a given vault
Public key of the vault
The PDA for the vault's LP mint
Fetches all pending withdrawals for a vault
Public key of the vault
Promise resolving to an array of pending withdrawals
Fetches the pending withdrawal for a user
Public key of the vault
Public key of the user
Promise resolving to the pending withdrawal
Fetches the position and total values for a vault
Public key of the vault
Promise resolving to the position and total values
Fetches the breakdown of the LP supply for a vault
Public key of the vault
Promise resolving to the breakdown of the LP supply
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