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.
createWrapperBuyYtInstruction
Builds a raw instruction to buy YT tokens from base assets in a single atomic operation. This instruction handles SY minting from the base asset, stripping SY into PT and YT, and selling excess PT back to the pool — all within a single transaction instruction. This is the most convenient way to acquire YT from a base asset.Usage
Accounts
| Name | Type | Signer | Writable | Description |
|---|---|---|---|---|
buyer | 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 |
tokenPtEscrow | PublicKey | No | Yes | Market PT escrow account |
tokenYtEscrow | PublicKey | No | Yes | Market YT escrow account |
marketAddressLookupTable | 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 |
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 |
|---|---|---|
ytOut | u64 | Amount of YT tokens to receive |
maxBaseAmount | u64 | Maximum amount of base asset to spend |
mintSyAccountsLength | u8 | Number of CPI accounts used for SY minting |
depositYtAccountsUntil | u8 | Number of CPI accounts used for YT deposit |
Returns
TransactionInstruction — a transaction instruction ready to be added to a transaction.