Documentation Index
Fetch the complete documentation index at: https://v2-docs.exponent.finance/llms.txt
Use this file to discover all available pages before exploring further.
createWithdrawLiquidityInstruction
Builds a raw instruction to withdraw liquidity from an LP position and claim accumulated fees. This removes a specified amount of liquidity from the position, returning PT and SY tokens to the owner along with any accrued trading fees.Usage
Accounts
| Name | Type | Signer | Writable | Description |
|---|---|---|---|---|
owner | PublicKey | Yes | Yes | Wallet withdrawing liquidity |
market | PublicKey | No | Yes | The CLMM market account |
lpPosition | PublicKey | No | Yes | LP position account |
ticks | PublicKey | No | Yes | The market tick array account |
tokenPtDst | PublicKey | No | Yes | Owner’s PT token account |
tokenSyDst | PublicKey | No | Yes | Owner’s SY token account |
tokenPtEscrow | PublicKey | No | Yes | Market PT escrow account |
tokenSyEscrow | PublicKey | No | Yes | Market SY escrow account |
addressLookupTable | PublicKey | No | No | Market address lookup table |
tokenProgram | PublicKey | No | No | SPL Token program |
syProgram | PublicKey | No | No | SY program |
systemProgram | PublicKey | No | No | System program |
eventAuthority | PublicKey | No | No | Event authority PDA |
program | PublicKey | No | No | CLMM program ID |
Args
| Name | Type | Description |
|---|---|---|
liquidityToRemove | u64 | Amount of LP tokens to withdraw |
minPtOut | u64 | Minimum PT tokens to receive |
minSyOut | u64 | Minimum SY tokens to receive |
Returns
TransactionInstruction — a transaction instruction ready to be added to a transaction.