Withdraw funds
Pull collateral back out with the single-call withdraw flow.
Withdrawals are a single call, but two things make them different from a normal transaction: they need a separate fee payer, and the funds settle asynchronously.
1. Build the withdrawal
curl -X POST $FLASH_API_URL/transaction-builder/withdraw -d '{
"owner": "<WALLET>", "tokenSymbol": "USDC", "amount": "12.5", "feePayer": "<FEE_PAYER>"
}'feePayermust differ fromowner— the delegation program rejectsowner == feePayer. The client holds this keypair and co-signs the transaction.Optionally pass
feePayerTopUpLamportsto prepend anowner → feePayertransfer that covers the escrow rent.
2. Handle the response
The response includes receipt, custodySettlementRequired, and isNativeSol.
custodySettlementRequired: true→ the trade vault can't cover the amount yet. Settle first, then retrywithdraw:curl -X POST $FLASH_API_URL/transaction-builder/custody-settlement -d '{ "owner": "<WALLET>", "tokenSymbol": "USDC" }'
3. Submit and wait
Sign (owner + fee payer), submit to your Solana RPC, then poll until the escrow receipt account closes — that means the funds landed in your ATA.
isNativeSol: true→ the funds arrive as WSOL; unwrap the WSOL account back to native SOL.If the withdrawal doesn't finalize on its own, resume it:
A lower-level
request-withdrawalperforms just the request step (also requiresfeePayer≠owner). Most integrations should usewithdraw.
→ Full fields: API reference › Account & funds · Background: Funds lifecycle
Last updated
Was this helpful?

