Skip to main content

createFillWithdrawalInstruction

Builds a raw instruction to fill a depositor’s queued withdrawal with underlying tokens. The vault manager calls this to service pending withdrawal requests by specifying the token mint and amount to allocate. Once filled, the depositor can execute the withdrawal to receive their tokens.

Usage

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

const ix = createFillWithdrawalInstruction(
  {
    manager: wallet.publicKey,
    vault: vaultAddress,
    exponentPrices: exponentPricesPda,
    withdrawalAccount: withdrawalAccountAddress,
    mintLp: lpMintAddress,
  },
  {
    mint: usdcMintAddress,
    amount: BigInt(1_000_000),
  }
);

Accounts

NameSignerWritableDescription
managerYesNoThe vault manager authority
vaultNoYesThe Strategy Vault account
exponentPricesNoNoGlobal ExponentPrices account for AUM calculations
withdrawalAccountNoYesThe depositor’s withdrawal request account to fill
mintLpNoYesThe vault’s LP token mint

Args

NameTypeDescription
mintPublicKey | nullToken mint to fill with, or null for SOL
amountbigintAmount of tokens to fill (u64, in base units)

Returns

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