Skip to main content

createTradePtExactOutInstruction

Builds a raw instruction to execute an exact-out swap to receive a specific amount of PT or SY tokens. Unlike the exact-in variant, this instruction guarantees the output amount and calculates the required input. An optional price limit provides anti-sandwich protection.

Usage

Accounts

Args

Returns

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