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

# Withdraw Liquidity

> Withdraw an LP position back to PT and SY tokens

The `ixWithdrawLiquidity` method on the `MarketThree` class redeems LP tokens for PT and SY. You specify the LP position to withdraw from, the amount of LP to burn, and minimum outputs for slippage protection.

> [!NOTE]
>
> This is a low-level method that returns PT and SY tokens. To withdraw directly to a base asset (e.g., USDC), use [`ixWithdrawLiquidityToBase`](https://docs.exponent.finance/clmm/typescript/instructions/ix-withdraw-liquidity-to-base) or [`ixWithdrawLiquidityClassic`](https://docs.exponent.finance/clmm/typescript/instructions/ix-withdraw-liquidity-classic) instead.

## Usage

```typescript theme={null}
import { MarketThree, LOCAL_ENV } from "@exponent-labs/exponent-sdk";
import { Connection, PublicKey, Transaction, sendAndConfirmTransaction } from "@solana/web3.js";

const connection = new Connection("https://api.mainnet-beta.solana.com");
const market = await MarketThree.load(LOCAL_ENV, connection, marketAddress);

const { ixs, setupIxs } = market.ixWithdrawLiquidity({
  withdrawer: wallet.publicKey,
  lpIn: 9_000_000_000n,           // LP tokens to burn
  lpPosition: lpPositionPublicKey, // from getUserLpPositions
  minPtOut: 4_000_000_000n,       // minimum PT to receive
  minSyOut: 4_000_000_000n,       // minimum SY to receive
});

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

## Required Parameters

| Parameter | Type | Description |
| - | - | - |
| `withdrawer` | `PublicKey` | The withdrawer's wallet public key |
| `lpIn` | `bigint` | Amount of LP tokens to burn |
| `lpPosition` | `PublicKey` | The LP position account to withdraw from |
| `minPtOut` | `bigint` | Minimum amount of PT to receive |
| `minSyOut` | `bigint` | Minimum amount of SY to receive |

## Optional Parameters

| Parameter | Type | Description |
| - | - | - |
| `ptDst` | `PublicKey` | Destination PT token account. Defaults to withdrawer's ATA |
| `syDst` | `PublicKey` | Destination SY token account. Defaults to withdrawer's ATA |

## Returns

Returns an object with:

```typescript theme={null}
{
  ixs: TransactionInstruction[],      // Main withdrawal instruction
  setupIxs: TransactionInstruction[]  // Setup instructions for creating PT and SY ATAs
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.