Voltr SDK
    Preparing search index...

    Class VoltrClient

    Main client for interacting with the Voltr protocol

    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.

    import { VoltrClient } from '@voltr/vault-sdk';
    import { Connection } from '@solana/web3.js';

    const connection = new Connection('https://api.mainnet-beta.solana.com');
    const client = new VoltrClient(connection);

    Hierarchy

    • AccountUtils
      • VoltrClient
    Index

    Constructors

    • Creates a new VoltrClient instance

      Parameters

      • conn: Connection

        Solana connection instance

      • Optionalwallet: Keypair

        Optional keypair for signing transactions

      • Optionalopts: ConfirmOptions

      Returns VoltrClient

    Properties

    conn: Connection
    provider: AnchorProvider
    vaultIdl: Idl
    vaultProgram: Program<VoltrVault>

    Methods

    • Calculates the amount of assets that would be received for a given LP token amount

      Parameters

      • vaultPk: PublicKey

        Public key of the vault

      • lpAmount: BN

        Amount of LP tokens to calculate for

      Returns Promise<BN>

      Promise resolving to the amount of assets that would be received

      If LP supply or total assets are invalid

      If math overflow occurs during calculation

      const assetsToReceive = await client.calculateAssetsForWithdraw(
      vaultPubkey,
      new BN('1000000000')
      );
    • Parameters

      • vaultTotalValue: BN
      • vaultLastUpdatedLockedProfit: BN
      • vaultLockedProfitDegradationDuration: BN
      • vaultAccumulatedLpAdminFees: BN
      • vaultAccumulatedLpManagerFees: BN
      • vaultAccumulatedLpProtocolFees: BN
      • vaultRedemptionFee: number
      • lpSupply: BN
      • lpAmount: BN

      Returns BN

    • Parameters

      • lastUpdatedLockedProfit: BN
      • lockedProfitDegradationDuration: BN
      • currentTime: BN

      Returns BN

    • Calculates the amount of LP tokens that would be received for a given asset deposit

      Parameters

      • vaultPk: PublicKey

        Public key of the vault

      • assetAmount: BN

        Amount of assets to deposit

      Returns Promise<BN>

      Promise resolving to the amount of LP tokens that would be received

      If math overflow occurs during calculation

      const lpTokens = await client.calculateLpTokensForDeposit(
      vaultPubkey
      new BN('1000000000'),
      );
    • Calculates the amount of LP tokens that would be burned for a given asset amount

      Parameters

      • vaultPk: PublicKey

        Public key of the vault

      • assetAmount: BN

        Amount of assets to calculate for

      Returns Promise<BN>

      Promise resolving to the amount of LP tokens that would be burned

      If LP supply or total assets are invalid

      If math overflow occurs during calculation

      const lpTokensToBurn = await client.calculateLpForWithdraw(
      vaultPubkey,
      new BN('1000000000')
      );
    • Creates an instruction to add an adaptor to a vault

      Parameters

      • params: {
            adaptorProgram?: PublicKey;
            admin: PublicKey;
            payer: PublicKey;
            vault: PublicKey;
        }

        Parameters for adding adaptor to vault

        • OptionaladaptorProgram?: PublicKey

          Public key of the adaptor program

        • admin: PublicKey

          Public key of the admin

        • payer: PublicKey

          Public key of the payer

        • vault: PublicKey

          Public key of the vault

      Returns Promise<TransactionInstruction>

      Transaction instruction for adding adaptor to vault

      If the instruction creation fails

      const ix = await client.createAddAdaptorIx({
      vault: vaultPubkey,
      payer: payerPubkey,
      admin: adminPubkey,
      adaptorProgram: adaptorProgramPubkey
      });
    • Creates an instruction to calibrate the high water mark

      Parameters

      • params: { admin: PublicKey; vault: PublicKey }

        Parameters for calibrating the high water mark

        • admin: PublicKey

          Public key of the admin

        • vault: PublicKey

          Public key of the vault

      Returns Promise<TransactionInstruction>

      Transaction instruction for calibrating the high water mark

      If instruction creation fails

      const ix = await client.createCalibrateHighWaterMarkIx({
      vault: vaultPubkey,
      admin: adminPubkey,
      });
    • Creates a cancel withdraw instruction for a vault

      Parameters

      • params: { userTransferAuthority: PublicKey; vault: PublicKey }

        Cancel withdraw request parameters

        • userTransferAuthority: PublicKey

          Public key of the user authority

        • vault: PublicKey

          Public key of the vault

      Returns Promise<TransactionInstruction>

      Transaction instruction for withdrawal

      If the instruction creation fails

      const ix = await client.createCancelRequestWithdrawVaultIx(
      {
      userTransferAuthority: userPubkey,
      vault: vaultPubkey,
      }
      );
    • Creates an instruction to close a strategy

      Parameters

      • params: { manager: PublicKey; payer: PublicKey; strategy: PublicKey; vault: PublicKey }

        Parameters for closing strategy

        • manager: PublicKey

          Public key of the manager

        • payer: PublicKey

          Public key of the payer

        • strategy: PublicKey

          Public key of the strategy

        • vault: PublicKey

          Public key of the vault

      Returns Promise<TransactionInstruction>

      Transaction instruction for closing strategy

      If instruction creation fails

      const ix = await client.createCloseStrategyIx({
      payer: payerPubkey,
      manager: managerPubkey,
      vault: vaultPubkey,
      strategy: strategyPubkey,
      });
    • Creates an instruction to create LP metadata

      Parameters

      • createLpMetadataArgs: { name: string; symbol: string; uri: string }

        Parameters for creating LP metadata

        • name: string

          Name of the LP

        • symbol: string

          Symbol of the LP

        • uri: string

          URI of the LP metadata

      • params: { admin: PublicKey; payer: PublicKey; vault: PublicKey }

        Parameters for creating LP metadata

        • admin: PublicKey

          Public key of the admin

        • payer: PublicKey

          Public key of the payer

        • vault: PublicKey

          Public key of the vault

      Returns Promise<TransactionInstruction>

      Transaction instruction for creating LP metadata

      If instruction creation fails

      const ix = await client.createCreateLpMetadataIx({
      name: "My LP",
      symbol: "MYLP",
      uri: "https://mylp.com/metadata",
      });
    • Creates an instruction to deposit assets into a strategy

      Parameters

      • depositArgs: DepositStrategyArgs

        Deposit arguments

        • OptionaladditionalArgs?: null | Buffer<ArrayBufferLike>
        • depositAmount: BN
        • OptionalinstructionDiscriminator?: null | Buffer<ArrayBufferLike>
      • params: {
            adaptorProgram?: PublicKey;
            assetTokenProgram: PublicKey;
            manager: PublicKey;
            remainingAccounts: {
                isSigner: boolean;
                isWritable: boolean;
                pubkey: PublicKey;
            }[];
            strategy: PublicKey;
            vault: PublicKey;
            vaultAssetMint: PublicKey;
        }

        Strategy deposit parameters

        • OptionaladaptorProgram?: PublicKey

          Public key of the adaptor program

        • assetTokenProgram: PublicKey

          Public key of the asset token program

        • manager: PublicKey

          Public key of the manager

        • remainingAccounts: { isSigner: boolean; isWritable: boolean; pubkey: PublicKey }[]

          Remaining accounts for the instruction

        • strategy: PublicKey

          Public key of the strategy

        • vault: PublicKey

          Public key of the vault

        • vaultAssetMint: PublicKey

          Public key of the vault asset mint

      Returns Promise<TransactionInstruction>

      Transaction instruction for depositing assets into strategy

      If the instruction creation fails

      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

      Parameters

      • amount: BN

        Amount of tokens to deposit

      • params: {
            assetTokenProgram: PublicKey;
            userTransferAuthority: PublicKey;
            vault: PublicKey;
            vaultAssetMint: PublicKey;
        }

        Deposit parameters

        • assetTokenProgram: PublicKey

          Public key of the asset token program

        • userTransferAuthority: PublicKey

          Public key of the user's transfer authority

        • vault: PublicKey

          Public key of the vault

        • vaultAssetMint: PublicKey

          Public key of the vault asset mint

      Returns Promise<TransactionInstruction>

      Transaction instruction for depositing tokens

      If instruction creation fails

      const ix = await client.createDepositVaultIx(
      new BN('1000000000'),
      {
      userTransferAuthority: userPubkey,
      vault: vaultPubkey,
      vaultAssetMint: mintPubkey,
      assetTokenProgram: tokenProgramPubkey
      }
      );
    • Creates an instruction to withdraw assets from a direct withdraw strategy

      Parameters

      • directWithdrawArgs: { userArgs?: null | Buffer<ArrayBufferLike> }

        Withdrawal arguments

        • OptionaluserArgs?: null | Buffer<ArrayBufferLike>

          Optional user arguments for the instruction

      • params: {
            adaptorProgram?: PublicKey;
            assetTokenProgram: PublicKey;
            remainingAccounts: {
                isSigner: boolean;
                isWritable: boolean;
                pubkey: PublicKey;
            }[];
            strategy: PublicKey;
            user: PublicKey;
            vault: PublicKey;
            vaultAssetMint: PublicKey;
        }

        Parameters for withdrawing assets from direct withdraw strategy

        • OptionaladaptorProgram?: PublicKey

          Public key of the adaptor program

        • assetTokenProgram: PublicKey

          Public key of the asset token program

        • remainingAccounts: { isSigner: boolean; isWritable: boolean; pubkey: PublicKey }[]

          Remaining accounts for the instruction

        • strategy: PublicKey

          Public key of the strategy

        • user: PublicKey

          Public key of the user

        • vault: PublicKey

          Public key of the vault

        • vaultAssetMint: PublicKey

          Public key of the vault asset mint

      Returns Promise<TransactionInstruction>

      Transaction instruction for withdrawing assets from direct withdraw strategy

      If instruction creation fails

      const ix = await client.createDirectWithdrawStrategyIx(
      {
      userArgs: Buffer.from('...')
      },
      {
      user: userPubkey,
      vault: vaultPubkey,
      strategy: strategyPubkey,
      vaultAssetMint: mintPubkey,
      assetTokenProgram: tokenProgramPubkey,
      adaptorProgram: adaptorProgramPubkey,
      remainingAccounts: []
      }
      );
    • Creates an instruction to harvest fees from a vault

      Parameters

      • params: {
            harvester: PublicKey;
            protocolAdmin: PublicKey;
            vault: PublicKey;
            vaultAdmin: PublicKey;
            vaultManager: PublicKey;
        }

        Parameters for harvesting fees

        • harvester: PublicKey

          Public key of the harvester

        • protocolAdmin: PublicKey

          Public key of the protocol admin

        • vault: PublicKey

          Public key of the vault

        • vaultAdmin: PublicKey

          Public key of the vault admin

        • vaultManager: PublicKey

          Public key of the vault manager

      Returns Promise<TransactionInstruction>

      Transaction instruction for harvesting fees

      If instruction creation fails

      const ix = await client.createHarvestFeeIx({
      harvester: harvesterPubkey,
      vaultManager: vaultManagerPubkey,
      vaultAdmin: vaultAdminPubkey,
      protocolAdmin: protocolAdminPubkey,
      vault: vaultPubkey,
      });
    • Creates an instruction to initialize a direct withdraw strategy

      Parameters

      • initArgs: InitializeDirectWithdrawStrategyArgs

        Arguments for initializing direct withdraw strategy

        • OptionaladditionalArgs?: null | Buffer<ArrayBufferLike>
        • OptionalallowUserArgs?: boolean
        • OptionalinstructionDiscriminator?: null | Buffer<ArrayBufferLike>
      • params: {
            adaptorProgram?: PublicKey;
            admin: PublicKey;
            payer: PublicKey;
            strategy: PublicKey;
            vault: PublicKey;
        }

        Parameters for initializing direct withdraw strategy

        • OptionaladaptorProgram?: PublicKey

          Public key of the adaptor program

        • admin: PublicKey

          Public key of the admin

        • payer: PublicKey

          Public key of the payer

        • strategy: PublicKey

          Public key of the strategy

        • vault: PublicKey

          Public key of the vault

      Returns Promise<TransactionInstruction>

      Transaction instruction for initializing direct withdraw strategy

      If instruction creation fails

      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

      Parameters

      • initArgs: InitializeStrategyArgs

        Arguments for strategy initialization

        • OptionaladditionalArgs?: null | Buffer<ArrayBufferLike>
        • OptionalinstructionDiscriminator?: null | Buffer<ArrayBufferLike>
      • Optionalparams: {
            adaptorProgram?: PublicKey;
            manager: PublicKey;
            payer: PublicKey;
            remainingAccounts: {
                isSigner: boolean;
                isWritable: boolean;
                pubkey: PublicKey;
            }[];
            strategy: PublicKey;
            vault: PublicKey;
        }

        Parameters for initializing strategy to vault

        • OptionaladaptorProgram?: PublicKey

          Public key of the adaptor program

        • manager: PublicKey

          Public key of the manager

        • payer: PublicKey

          Public key of the payer

        • remainingAccounts: { isSigner: boolean; isWritable: boolean; pubkey: PublicKey }[]

          Remaining accounts for the instruction

        • strategy: PublicKey

          Public key of the strategy

        • vault: PublicKey

          Public key of the vault

      Returns Promise<TransactionInstruction>

      Transaction instruction for initializing strategy to vault

      If the instruction creation fails

      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

      Parameters

      • vaultParams: VaultParams

        Configuration parameters for the vault

      • params: {
            admin: PublicKey;
            manager: PublicKey;
            payer: PublicKey;
            vault: PublicKey;
            vaultAssetMint: PublicKey;
        }

        Additional parameters for initializing the vault

        • admin: PublicKey

          Public key of the vault admin

        • manager: PublicKey

          Public key of the vault manager

        • payer: PublicKey

          Public key of the fee payer

        • vault: PublicKey

          Keypair for the new vault

        • vaultAssetMint: PublicKey

          Public key of the vault's asset mint

      Returns Promise<TransactionInstruction>

      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 remove a strategy from a vault

      Parameters

      • params: { adaptorProgram?: PublicKey; admin: PublicKey; vault: PublicKey }

        Parameters for removing strategy

        • OptionaladaptorProgram?: PublicKey

          Public key of the adaptor program

        • admin: PublicKey

          Public key of the admin

        • vault: PublicKey

          Public key of the vault

      Returns Promise<TransactionInstruction>

      Transaction instruction for removing adaptor from vault

      If instruction creation fails

      const ix = await client.createRemoveAdaptorIx({
      vault: vaultPubkey,
      admin: adminPubkey,
      adaptorProgram: adaptorProgramPubkey
      });
    • Creates a request withdraw instruction for a vault

      Parameters

      • requestWithdrawArgs: RequestWithdrawVaultArgs

        Arguments for withdrawing from the vault

        • amount: BN
        • isAmountInLp: boolean
        • isWithdrawAll: boolean
      • params: { payer: PublicKey; userTransferAuthority: PublicKey; vault: PublicKey }

        Request withdraw parameters

        • payer: PublicKey

          Public key of the payer

        • userTransferAuthority: PublicKey

          Public key of the user authority

        • vault: PublicKey

          Public key of the vault

      Returns Promise<TransactionInstruction>

      Transaction instruction for withdrawal

      If the instruction creation fails

      const ix = await client.createRequestWithdrawVaultIx(
      {
      amount: new BN('1000000000'),
      isAmountInLp: true,
      isWithdrawAll: false,
      },
      {
      payer: payerPubkey,
      userTransferAuthority: userPubkey,
      vault: vaultPubkey,
      }
      );
    • Creates an instruction to update a vault

      Parameters

      • vaultConfig: VaultConfig

        Configuration parameters for the vault

        • adminManagementFee: number
        • adminPerformanceFee: number
        • issuanceFee: number
        • lockedProfitDegradationDuration: BN
        • managerManagementFee: number
        • managerPerformanceFee: number
        • maxCap: BN
        • redemptionFee: number
        • startAtTs: BN
        • withdrawalWaitingPeriod: BN
      • params: { admin: PublicKey; vault: PublicKey }

        Parameters for updating the vault

        • admin: PublicKey

          Public key of the vault admin

        • vault: PublicKey

          Public key of the vault

      Returns Promise<TransactionInstruction>

      Transaction instruction for updating the vault

      const ix = await client.createUpdateVaultIx(
      {
      maxCap: new BN('1000000000'),
      startAtTs: new BN(Math.floor(Date.now() / 1000)),
      managerManagementFee: 50,
      managerPerformanceFee: 1000,
      adminManagementFee: 50,
      adminPerformanceFee: 1000,
      },
      { vault: vaultPubkey, admin: adminPubkey }
      );
    • Creates an instruction to withdraw assets from a strategy

      Parameters

      • withdrawArgs: WithdrawStrategyArgs

        Withdrawal arguments

        • OptionaladditionalArgs?: null | Buffer<ArrayBufferLike>
        • OptionalinstructionDiscriminator?: null | Buffer<ArrayBufferLike>
        • withdrawAmount: BN
      • params: {
            adaptorProgram?: PublicKey;
            assetTokenProgram: PublicKey;
            manager: PublicKey;
            remainingAccounts: {
                isSigner: boolean;
                isWritable: boolean;
                pubkey: PublicKey;
            }[];
            strategy: PublicKey;
            vault: PublicKey;
            vaultAssetMint: PublicKey;
        }

        Strategy withdrawal parameters

        • OptionaladaptorProgram?: PublicKey

          Public key of the adaptor program

        • assetTokenProgram: PublicKey

          Public key of the asset token program

        • manager: PublicKey
        • remainingAccounts: { isSigner: boolean; isWritable: boolean; pubkey: PublicKey }[]

          Remaining accounts for the instruction

        • strategy: PublicKey

          Public key of the strategy

        • vault: PublicKey

          Public key of the vault

        • vaultAssetMint: PublicKey

          Public key of the vault asset mint

      Returns Promise<TransactionInstruction>

      Transaction instruction for withdrawing assets from strategy

      If the instruction creation fails

      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

      Parameters

      • params: {
            assetTokenProgram: PublicKey;
            userTransferAuthority: PublicKey;
            vault: PublicKey;
            vaultAssetMint: PublicKey;
        }

        Withdraw parameters

        • assetTokenProgram: PublicKey

          Public key of the asset token program

        • userTransferAuthority: PublicKey

          Public key of the user authority

        • vault: PublicKey

          Public key of the vault

        • vaultAssetMint: PublicKey

          Public key of the vault asset mint

      Returns Promise<TransactionInstruction>

      Transaction instruction for withdrawal

      If the instruction creation fails

      const ix = await client.createWithdrawVaultIx(
      {
      userTransferAuthority: userPubkey,
      vault: vaultPubkey,
      vaultAssetMint: mintPubkey,
      assetTokenProgram: tokenProgramPubkey
      }
      );
    • Fetches an adaptor add receipt account's data

      Parameters

      • adaptorAddReceipt: PublicKey

        Public key of the adaptor add receipt account

      Returns Promise<
          {
              adaptorProgram: PublicKey;
              bump: number;
              lastUpdatedEpoch: BN;
              padding0: number[];
              reserved: number[];
              vault: PublicKey;
              version: number;
          },
      >

      Promise resolving to the adaptor add receipt account data

      const adaptorAddReceiptAccount = await client.fetchAdaptorAddReceiptAccount(adaptorAddReceiptPubkey);
      
    • Fetches all adaptor add receipt accounts of a vault

      Parameters

      • vault: PublicKey

        Public key of the vault

      Returns Promise<
          ProgramAccount<
              {
                  adaptorProgram: PublicKey;
                  bump: number;
                  lastUpdatedEpoch: BN;
                  padding0: number[];
                  reserved: number[];
                  vault: PublicKey;
                  version: number;
              },
          >[],
      >

      Promise resolving to an array of adaptor add receipt accounts

      const adaptorAddReceiptAccounts = await client.fetchAllAdaptorAddReceiptAccountsOfVault(vaultPubkey);
      
    • Fetches all request withdraw vault receipt accounts of a vault

      Parameters

      • vault: PublicKey

        Public key of the vault

      Returns Promise<
          ProgramAccount<
              {
                  amountAssetToWithdrawDecimalBits: BN;
                  amountLpEscrowed: BN;
                  bump: number;
                  user: PublicKey;
                  vault: PublicKey;
                  version: number;
                  withdrawableFromTs: BN;
              },
          >[],
      >

      Promise resolving to an array of request withdraw vault receipt accounts

      const requestWithdrawVaultReceiptAccounts = await client.fetchAllRequestWithdrawVaultReceiptsOfVault(vaultPubkey);
      
    • Fetches all strategy init receipt accounts

      Returns Promise<
          ProgramAccount<
              {
                  adaptorProgram: PublicKey;
                  bump: number;
                  lastUpdatedTs: BN;
                  padding0: number[];
                  positionValue: BN;
                  reserved: number[];
                  strategy: PublicKey;
                  vault: PublicKey;
                  vaultStrategyAuthBump: number;
                  version: number;
              },
          >[],
      >

      Promise resolving to an array of strategy init receipt accounts

      const strategyInitReceiptAccounts = await client.fetchAllStrategyInitReceiptAccounts();
      
    • Fetches all strategy init receipt accounts of a vault

      Parameters

      • vault: PublicKey

        Public key of the vault

      Returns Promise<
          ProgramAccount<
              {
                  adaptorProgram: PublicKey;
                  bump: number;
                  lastUpdatedTs: BN;
                  padding0: number[];
                  positionValue: BN;
                  reserved: number[];
                  strategy: PublicKey;
                  vault: PublicKey;
                  vaultStrategyAuthBump: number;
                  version: number;
              },
          >[],
      >

      Promise resolving to an array of strategy init receipt accounts

      const strategyInitReceiptAccounts = await client.fetchAllStrategyInitReceiptAccountsOfVault(vaultPubkey);
      
    • Fetches a request withdraw vault receipt account's data

      Parameters

      • requestWithdrawVaultReceipt: PublicKey

        Public key of the request withdraw vault receipt account

      Returns Promise<
          {
              amountAssetToWithdrawDecimalBits: BN;
              amountLpEscrowed: BN;
              bump: number;
              user: PublicKey;
              vault: PublicKey;
              version: number;
              withdrawableFromTs: BN;
          },
      >

      Promise resolving to the request withdraw vault receipt account data

      const requestWithdrawVaultReceiptAccount = await client.fetchRequestWithdrawVaultReceiptAccount(requestWithdrawVaultReceiptPubkey);
      
    • Fetches a strategy init receipt account's data

      Parameters

      • strategyInitReceipt: PublicKey

        Public key of the strategy init receipt account

      Returns Promise<
          {
              adaptorProgram: PublicKey;
              bump: number;
              lastUpdatedTs: BN;
              padding0: number[];
              positionValue: BN;
              reserved: number[];
              strategy: PublicKey;
              vault: PublicKey;
              vaultStrategyAuthBump: number;
              version: number;
          },
      >

      Promise resolving to the strategy init receipt account data

      const strategyInitReceiptAccount = await client.fetchStrategyInitReceiptAccount(strategyInitReceiptPubkey);
      
    • Fetches a vault account's data

      Parameters

      • vault: PublicKey

        Public key of the vault

      Returns Promise<
          {
              admin: PublicKey;
              asset: {
                  idleAta: PublicKey;
                  idleAtaAuthBump: number;
                  mint: PublicKey;
                  reserved: number[];
                  totalValue: BN;
              };
              description: number[];
              feeConfiguration: {
                  adminManagementFee: number;
                  adminPerformanceFee: number;
                  issuanceFee: number;
                  managerManagementFee: number;
                  managerPerformanceFee: number;
                  redemptionFee: number;
                  reserved: number[];
              };
              feeState: {
                  accumulatedLpAdminFees: BN;
                  accumulatedLpManagerFees: BN;
                  accumulatedLpProtocolFees: BN;
                  reserved: number[];
              };
              feeUpdate: {
                  lastManagementFeeUpdateTs: BN;
                  lastPerformanceFeeUpdateTs: BN;
              };
              highWaterMark: {
                  highestAssetPerLpDecimalBits: BN;
                  lastUpdatedTs: BN;
                  reserved: number[];
              };
              lastUpdatedTs: BN;
              lockedProfitState: { lastReport: BN; lastUpdatedLockedProfit: BN };
              lp: {
                  mint: PublicKey;
                  mintAuthBump: number;
                  mintBump: number;
                  reserved: number[];
              };
              manager: PublicKey;
              name: number[];
              padding0: number[];
              reserved: number[];
              vaultConfiguration: {
                  lockedProfitDegradationDuration: BN;
                  maxCap: BN;
                  reserved: number[];
                  startAtTs: BN;
                  withdrawalWaitingPeriod: BN;
              };
              version: number;
          },
      >

      Promise resolving to the vault account data

    • Finds the direct withdraw init receipt address

      Parameters

      • vault: PublicKey

        Public key of the vault

      • strategy: PublicKey

        Public key of the strategy

      Returns PublicKey

      The PDA for the direct withdraw init receipt

      const directWithdrawInitReceipt = client.findDirectWithdrawInitReceipt(vaultPubkey, strategyPubkey);
      
    • Finds the LP metadata account for a given vault

      Parameters

      • vault: PublicKey

        Public key of the vault

      Returns PublicKey

      The PDA for the LP metadata account

      const lpMetadataAccount = client.findLpMetadataAccount(vaultPubkey);
      
    • Finds the request withdraw vault receipt address

      Parameters

      • vault: PublicKey

        Public key of the vault

      • user: PublicKey

        Public key of the user

      Returns PublicKey

      The PDA for the request withdraw vault receipt

      const requestWithdrawVaultReceipt = client.findRequestWithdrawVaultReceipt(vaultPubkey, userPubkey);
      
    • Finds the strategy init receipt address

      Parameters

      • vault: PublicKey

        Public key of the vault

      • strategy: PublicKey

        Public key of the strategy

      Returns PublicKey

      The PDA for the strategy init receipt

      const strategyInitReceipt = client.findStrategyInitReceipt(vaultPubkey, strategyPubkey);
      
    • Finds all vault-related addresses

      Parameters

      • vault: PublicKey

        Public key of the vault

      Returns { vaultAssetIdleAuth: PublicKey; vaultLpMint: PublicKey }

      Object containing all vault-related PDAs

      const addresses = client.findVaultAddresses(vaultPubkey);
      console.log(addresses.vaultLpMint.toBase58());
      console.log(addresses.vaultAssetIdleAuth.toBase58());
      console.log(addresses.vaultLpFeeAuth.toBase58());
    • Finds the vault's asset idle authority address

      Parameters

      • vault: PublicKey

        Public key of the vault

      Returns PublicKey

      The PDA for the vault's asset idle authority

    • Finds the vault LP mint address for a given vault

      Parameters

      • vault: PublicKey

        Public key of the vault

      Returns PublicKey

      The PDA for the vault's LP mint

    • Parameters

      • vault: PublicKey
      • strategy: PublicKey

      Returns {
          directWithdrawInitReceipt: PublicKey;
          strategyInitReceipt: PublicKey;
          vaultStrategyAuth: PublicKey;
      }

    • Finds the vault strategy auth address

      Parameters

      • vault: PublicKey

        Public key of the vault

      • strategy: PublicKey

        Public key of the strategy

      Returns PublicKey

      The PDA for the vault strategy auth

      const vaultStrategyAuth = client.findVaultStrategyAuth(vaultPubkey, strategyPubkey);
      
    • Fetches the accumulated admin fees for a vault

      Parameters

      • vault: PublicKey

        Public key of the vault

      Returns Promise<BN>

      Promise resolving to the accumulated admin fees

      const accumulatedAdminFees = await client.getAccumulatedAdminFeesForVault(vaultPubkey);
      
    • Fetches the accumulated manager fees for a vault

      Parameters

      • vault: PublicKey

        Public key of the vault

      Returns Promise<BN>

      Promise resolving to the accumulated manager fees

      const accumulatedManagerFees = await client.getAccumulatedManagerFeesForVault(vaultPubkey);
      
    • Fetches all pending withdrawals for a vault

      Parameters

      • vault: PublicKey

        Public key of the vault

      Returns Promise<
          {
              amountAssetToWithdrawAtPresent: number;
              amountAssetToWithdrawAtRequest: number;
              amountAssetToWithdrawEffective: number;
              amountLpEscrowed: number;
              user: PublicKey;
              withdrawableFromTs: number;
          }[],
      >

      Promise resolving to an array of pending withdrawals

      const pendingWithdrawals = await client.getAllPendingWithdrawalsForVault(vaultPubkey);
      
    • Gets the balance of a Solana account

      Parameters

      • publicKey: PublicKey

        Public key to check balance for

      Returns Promise<number>

      Promise resolving to the account balance in lamports

      If fetching balance fails

    • Fetches the current asset per LP for a vault

      Parameters

      • vault: PublicKey

        Public key of the vault

      Returns Promise<number>

      Promise resolving to the current asset per LP

      const currentAssetPerLp = await client.getCurrentAssetPerLpForVault(vaultPubkey);
      
    • Fetches the high water mark for a vault

      Parameters

      • vault: PublicKey

        Public key of the vault

      Returns Promise<{ highestAssetPerLp: number; lastUpdatedTs: number }>

      Promise resolving to the high water mark

      const highWaterMark = await client.getHighWaterMarkForVault(vaultPubkey);
      
    • Fetches the pending withdrawal for a user

      Parameters

      • vault: PublicKey

        Public key of the vault

      • user: PublicKey

        Public key of the user

      Returns Promise<
          {
              amountAssetToWithdrawAtPresent: number;
              amountAssetToWithdrawAtRequest: number;
              amountAssetToWithdrawEffective: number;
              amountLpEscrowed: number;
              user: PublicKey;
              withdrawableFromTs: number;
          },
      >

      Promise resolving to the pending withdrawal

      const pendingWithdrawal = await client.getPendingWithdrawalForUser(vaultPubkey, userPubkey);
      
    • Fetches the position and total values for a vault

      Parameters

      • vault: PublicKey

        Public key of the vault

      Returns Promise<
          {
              strategies: { amount: number; strategyId: string }[];
              totalValue: number;
          },
      >

      Promise resolving to the position and total values

      const positionAndTotalValues = await client.getPositionAndTotalValuesForVault(vaultPubkey);