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.
createBuyPtInstruction
Builds a raw instruction to buy PT tokens using base assets. This instruction handles SY minting from the base asset internally via remaining accounts, making it a convenience wrapper that combines the mint-SY and buy-PT steps into a single instruction.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 |
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 |
addressLookupTable | 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 |
eventAuthority | PublicKey | No | No | Event authority PDA |
program | PublicKey | No | No | CLMM program ID |
Args
| Name | Type | Description |
|---|---|---|
minPtAmount | u64 | Minimum amount of PT tokens to receive |
baseAmount | u64 | Amount of base asset to spend |
priceSpotLimit | f64 (optional) | Price limit for anti-sandwich protection |
mintSyRemAccountsUntil | u8 | Number of remaining accounts used for the SY minting CPI |
Returns
TransactionInstruction — a transaction instruction ready to be added to a transaction.