Skip to main content
The ixWrapperWithdrawFunds instruction withdraws trading balances from your orderbook escrow. When you post an order, tokens enter the escrow. As orders fill, balances shift between token types (e.g. SY becomes YT on a filled BuyYT). After removing unfilled orders, the remaining balances become withdrawable. Use this instruction to transfer PT, YT, and SY from your escrow to your wallet.
Staged interest from YT accrual is not included in these balances. Collect it separately with ixWrapperCollectInterest.

Usage

Required Parameters

Optional Parameters

Amount Helper

The amount helper from @exponent-labs/exponent-sdk creates the discriminated union used for withdrawal amounts:

Returns

Returns a TransactionInstruction that executes the withdraw call.

Checking Withdrawable Funds

Before withdrawing, you can check the available balances using getUserBalances: