createWrapperWithdrawLiquidityClassicInstruction
Withdraws liquidity from a CLMM market and returns PT tokens and base assets separately. This instruction removes the LP position, returns the PT component directly to the withdrawer, and redeems the SY portion for the underlying base asset. This is useful when the caller wants to retain their PT tokens rather than selling them.Usage
Accounts
| Name | Type | Signer | Writable | Description |
|---|---|---|---|---|
withdrawer | PublicKey | Yes | Yes | Wallet withdrawing liquidity |
market | PublicKey | No | Yes | The CLMM market account |
ticks | PublicKey | No | Yes | The market tick array account |
tokenPtEscrow | PublicKey | No | Yes | Market PT escrow account |
tokenSyEscrow | PublicKey | No | Yes | Market SY escrow account |
tokenSyWithdrawer | PublicKey | No | Yes | Withdrawer’s SY token account |
tokenPtWithdrawer | PublicKey | No | Yes | Withdrawer’s PT token account |
tokenProgram | PublicKey | No | No | SPL Token program |
marketAddressLookupTable | PublicKey | No | No | Market address lookup table |
syProgram | PublicKey | No | No | SY program |
lpPosition | PublicKey | No | Yes | LP position account |
systemProgram | PublicKey | No | No | System program |
eventAuthority | PublicKey | No | No | Event authority PDA |
program | PublicKey | No | No | CLMM program ID |
Args
| Name | Type | Description |
|---|---|---|
| amountLp | u64 | The amount of LP tokens to withdraw |
| redeemSyAccountsLength | u8 | The number of CPI remaining accounts used for SY redemption |
Returns
TransactionInstruction — a transaction instruction ready to be added to a transaction.