ixMerge method on the Vault class creates a transaction instruction that merges PT and YT back into SY tokens.
This method returns SY tokens. If you want to receive the base asset directly (e.g., USDC), use
ixMergeToBase instead.Usage
Required Parameters
| Parameter | Type | Description |
|---|---|---|
pyIn | bigint | Amount of PT and YT to merge |
depositor | PublicKey | The depositor’s wallet public key |
Optional Parameters
| Parameter | Type | Description |
|---|---|---|
ptSrc | PublicKey | Source PT token account. Defaults to depositor’s ATA |
ytSrc | PublicKey | Source YT token account. Defaults to depositor’s ATA |
syDst | PublicKey | Destination SY token account. Defaults to depositor’s ATA |
Returns
Returns aTransactionInstruction that merges equal amounts of PT and YT back into SY.