> ## 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.

# Cancel Withdrawal

> Cancel a queued withdrawal and reclaim LP tokens

# ixCancelWithdrawal

Cancels a previously queued withdrawal and returns the escrowed LP tokens to the depositor. Can only be called by the owner of the withdrawal account, and only before the withdrawal has been fully filled by the vault manager.

## Usage

```typescript theme={null}
const ix = vault.ixCancelWithdrawal({
  owner: wallet.publicKey,
  withdrawalAccount: withdrawalKeypair.publicKey,
});

const tx = new Transaction().add(ix);
await sendAndConfirmTransaction(connection, tx, [wallet]);
```

## Parameters

| Name                | Type        | Required | Description                                                                             |
| ------------------- | ----------- | -------- | --------------------------------------------------------------------------------------- |
| `owner`             | `PublicKey` | Yes      | The depositor who queued the withdrawal (must be signer)                                |
| `withdrawalAccount` | `PublicKey` | Yes      | The withdrawal account to cancel                                                        |
| `tokenLpDst`        | `PublicKey` | No       | Destination for returned LP tokens. Defaults to the owner's ATA for the vault's LP mint |
| `tokenProgram`      | `PublicKey` | No       | SPL Token program. Defaults to `TOKEN_PROGRAM_ID`                                       |
| `tokenLpEscrow`     | `PublicKey` | No       | The vault's LP token escrow. Auto-derived from vault state                              |

## Returns

`TransactionInstruction` — a single instruction that cancels the withdrawal and returns LP tokens.

<Note>
  After cancellation, the withdrawal account is closed and its rent is returned to the owner. The LP tokens are transferred from the vault's LP escrow back to the owner's token account.
</Note>
