Recommended sequence:
getVaultsByConfig() →
prepareWithdrawalAuthorization() → prepareWithdrawal().Step 0: Discover the Vault
Before making any withdrawal calls, discover your vault and record its name:Step 1: Check Authorization
Step 2: Submit Withdrawal Order
Optional Low-Level APIs
prepareWithdrawOrderTxDatafor manual order constructionprepareApproveWithdrawOrderTxDatafor manual approval constructionprepareCancelWithdrawOrderTxDatafor order cancellation flows
Checking Withdrawal Status
After submitting a withdrawal order, usegetWithdrawalRequests to poll for status updates:
Withdrawal Request Statuses
| Status | Description |
|---|---|
PENDING | Order submitted, awaiting fulfillment by vault operator |
COMPLETE | Order fulfilled, stablecoins sent to user |
PENDING_REFUND | Order is being refunded |
REFUNDED | Vault shares returned to user |
Withdrawal orders are fulfilled by the vault operator, typically within 24
hours of submission. Use
getWithdrawalRequests to display current status to
users.Canceling a Withdrawal
Withdrawal requests with aPENDING status can be canceled and refunded to the user in a specified asset. This uses a two-step process: retrieve the withdrawal requests, then submit the cancellation.
Step 1: Retrieve Withdrawal Requests
UsegetWithdrawalRequests to fetch pending requests for a given user address:
Step 2: Submit Cancellation
Prepare and send the transaction to cancel a specific pending withdrawal request:Only the order owner can cancel their withdrawal request. The
wantAsset
specifies the token the user will receive as a refund.Smart Wallet Behavior
In auto mode, smart wallets are routed to approval mode so approve + withdraw can be batched atomically.Related
- getVaultsByConfig - Discover vault names
- Withdrawals API
- Smart Wallets Guide