Skip to main content

createCancelWithdrawalInstruction

Builds a raw instruction to cancel a previously queued withdrawal. The LP tokens locked in escrow are returned to the owner’s token account and the withdrawal account is closed. Called by the withdrawal account owner.

Usage

import { createCancelWithdrawalInstruction } from "@exponent-labs/exponent-sdk/client/vaults";
import { PublicKey } from "@solana/web3.js";

const ix = createCancelWithdrawalInstruction({
  owner: wallet.publicKey,
  vault: vaultAddress,
  withdrawalAccount: withdrawalAccountAddress,
  tokenLpEscrow: vaultLpEscrowAccount,
  tokenLpDst: ownerLpTokenAccount,
  tokenProgram: TOKEN_PROGRAM_ID,
});

Accounts

NameSignerWritableDescription
ownerYesYesThe withdrawal account owner
vaultNoNoThe Strategy Vault account
withdrawalAccountNoYesThe withdrawal request account to cancel
tokenLpEscrowNoYesVault’s LP token escrow account
tokenLpDstNoYesOwner’s destination LP token account
tokenProgramNoNoSPL Token program

Returns

TransactionInstruction — a transaction instruction ready to be added to a transaction.