Skip to main content

createBuyYtInstruction

Builds a raw instruction to buy YT tokens using SY. This instruction strips SY into PT and YT, then sells the excess PT back to the pool for SY, effectively converting the input SY into YT at the current market rate. The process leverages the PT/SY AMM to determine the conversion ratio.

Usage

Accounts

Args

Returns

TransactionInstruction — a transaction instruction ready to be added to a transaction.