createFillWithdrawalInstruction
Fills a depositor’s queued withdrawal request with underlying tokens. This is a manager-only operation — the vault manager specifies which token and how much to allocate to the pending withdrawal. There is no high-level class method for this instruction; use the raw instruction builder directly.
LP tokens are burned during this step. After a withdrawal is filled, the depositor can call Execute Withdrawal to receive their tokens.
Usage
import { createFillWithdrawalInstruction } from "@exponent-labs/exponent-sdk/client/vaults";
const ix = createFillWithdrawalInstruction(
{
manager: wallet.publicKey,
vault: vaultAddress,
exponentPrices: exponentPricesPda,
withdrawalAccount: withdrawalAccountAddress,
mintLp: vaultMintLp,
},
{
mint: usdcMint, // Token to fill with (null for SOL)
amount: 1_000_000n, // Amount of the token to fill
},
);
const tx = new Transaction().add(ix);
await sendAndConfirmTransaction(connection, tx, [wallet]);
Accounts
| Name | Signer | Writable | Description |
|---|
manager | Yes | No | Vault manager wallet |
vault | No | Yes | The vault account |
exponentPrices | No | No | ExponentPrices PDA for AUM validation |
withdrawalAccount | No | Yes | The depositor’s withdrawal account to fill |
mintLp | No | Yes | The vault’s LP token mint |
Args
| Name | Type | Description | |
|---|
mint | `PublicKey | null` | The token mint to fill with. null for SOL |
amount | u64 | Amount of the token to allocate to this withdrawal | |
Returns
TransactionInstruction — a transaction instruction ready to be added to a transaction.
A withdrawal may be partially filled across multiple calls with different tokens. The depositor can execute the withdrawal once all fills are complete and the lock period has passed.