Skip to main content

createTradePtInstruction

Builds a raw instruction to execute an exact-in swap between PT and SY tokens. The swap direction determines whether PT is being bought (SY in, PT out) or sold (PT in, SY out). An optional price limit provides anti-sandwich protection by reverting if the spot price moves beyond the specified threshold.

Usage

Accounts

Args

Returns

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