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.
createWrapperSellYtInstruction
Sells YT tokens for base assets in a single atomic operation. This instruction buys PT on the market, merges the PT and YT back into SY, and then redeems the SY for the underlying base asset. The entire flow is executed atomically so the caller receives base tokens directly from their YT position.Usage
Accounts
| Name | Type | Signer | Writable | Description |
|---|---|---|---|---|
seller | PublicKey | Yes | Yes | Wallet executing the trade |
market | PublicKey | No | Yes | The CLMM market account |
ticks | PublicKey | No | Yes | The market tick array account |
tokenSyTrader | PublicKey | No | Yes | Trader’s SY token account |
tokenYtTrader | PublicKey | No | Yes | Trader’s YT token account |
tokenPtTrader | PublicKey | No | Yes | Trader’s PT token account |
tokenSyEscrow | PublicKey | No | Yes | Market SY escrow account |
tokenYtEscrow | PublicKey | No | Yes | Market YT escrow account |
tokenPtEscrow | PublicKey | No | Yes | Market PT escrow account |
marketAddressLookupTable | PublicKey | No | No | Market address lookup table |
tokenProgram | PublicKey | No | No | SPL Token program |
syProgram | PublicKey | No | No | SY program |
tokenFeeTreasurySy | PublicKey | No | Yes | SY fee treasury account |
tokenFeeTreasuryPt | PublicKey | No | Yes | PT fee treasury account |
exponentCoreProgram | PublicKey | No | No | Exponent core program (for strip/merge CPI) |
eventAuthority | PublicKey | No | No | Event authority PDA |
program | PublicKey | No | No | CLMM program ID |
Args
| Name | Type | Description |
|---|---|---|
| ytAmount | u64 | The amount of YT tokens to sell |
| minBaseAmount | u64 | The minimum amount of base asset to receive |
| redeemSyAccountsUntil | u8 | The number of CPI remaining accounts used for SY redemption |
Returns
TransactionInstruction — a transaction instruction ready to be added to a transaction.