> ## Documentation Index
> Fetch the complete documentation index at: https://docs.exponent.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Queue Withdrawal

> Low-level instruction to queue a withdrawal by locking LP tokens in escrow

# createQueueWithdrawalInstruction

Builds a raw instruction to queue a withdrawal from a Strategy Vault. The depositor's LP tokens are locked in escrow and a withdrawal account is created to track the request. The withdrawal must later be filled by the vault manager and then executed to receive underlying tokens. Called by depositors who want to withdraw from the vault.

## Usage

```typescript theme={null}
import { createQueueWithdrawalInstruction } from "@exponent-labs/exponent-sdk/client/vaults";
import { Keypair, PublicKey } from "@solana/web3.js";

const withdrawalAccountKeypair = Keypair.generate();

const ix = createQueueWithdrawalInstruction(
  {
    depositor: wallet.publicKey,
    vault: vaultAddress,
    exponentPrices: exponentPricesPda,
    withdrawalAccount: withdrawalAccountKeypair.publicKey,
    tokenLpSrc: depositorLpTokenAccount,
    tokenLpEscrow: vaultLpEscrowAccount,
    tokenProgram: TOKEN_PROGRAM_ID,
    systemProgram: SYSTEM_PROGRAM_ID,
  },
  {
    lpAmount: BigInt(500_000),
    withdrawalType: { token: {} },
  }
);
```

## Accounts

| Name                | Signer | Writable | Description                                        |
| ------------------- | ------ | -------- | -------------------------------------------------- |
| `depositor`         | Yes    | Yes      | The user queuing the withdrawal                    |
| `vault`             | No     | Yes      | The Strategy Vault account                         |
| `exponentPrices`    | No     | No       | Global ExponentPrices account for AUM calculations |
| `withdrawalAccount` | Yes    | Yes      | New withdrawal request account (keypair signer)    |
| `tokenLpSrc`        | No     | Yes      | Depositor's LP token account (source)              |
| `tokenLpEscrow`     | No     | Yes      | Vault's LP token escrow account                    |
| `tokenProgram`      | No     | No       | SPL Token program                                  |
| `systemProgram`     | No     | No       | System program                                     |

## Args

| Name             | Type             | Description                                          |
| ---------------- | ---------------- | ---------------------------------------------------- |
| `lpAmount`       | `bigint`         | Amount of LP tokens to queue for withdrawal (u64)    |
| `withdrawalType` | `WithdrawalType` | Type of withdrawal: `{ sol: {} }` or `{ token: {} }` |

## Returns

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