Skip to main content
These flows use many instructions. If you hit compute limits, add ComputeBudgetProgram.setComputeUnitLimit({ units: 1_000_000 }) (or higher) as the first instruction in your transaction.
Withdraw pool tokens from a Native Staked Vault, then burn them via the Single Pool program to receive your stake back. Flow:
  1. Withdraw pool tokens from vault via getOperateIx (negative colAmount)
  2. Burn pool tokens with SinglePoolProgram.withdraw → receive stake account

Withdraw

1

Import Dependencies

2

Withdraw Pool Tokens from Vault

Use getOperateIx with MAX_WITHDRAW_AMOUNT to withdraw all collateral.
3

Burn Pool Tokens and Receive Stake

Use SinglePoolProgram.withdraw to burn pool tokens and receive a new stake account.
4

Assemble and Execute the Transaction

Build a v0 message, sign with user keypair and new stake account keypair.