Portfolio Withdrawal
A guide to withdrawing assets from a portfolio
This guide explains how to withdraw assets from a Glider portfolio.
Overview
Withdrawing assets from your portfolio allows you to access your funds when needed. The withdrawal process involves:
- Getting withdrawal instructions from the Glider API
- Creating a transaction with these instructions
- Having the user sign and send the transaction
Withdrawal Process
1. Get Withdrawal Instructions
First, request withdrawal instructions from the API:
For multiple assets or ERC-20 tokens, include them in the assets array:
2. Create and Send the Transaction
The response will include transaction data that you can use to create a transaction for the user to sign:
Use this data to create and send a transaction:
3. Verify the Withdrawal
After the transaction is confirmed, you can verify the withdrawal by retrieving the portfolio details:
Withdraw as ETH Option
Glider also provides a convenient endpoint to withdraw all assets as ETH, which automatically converts all tokens to ETH before withdrawal:
Partial vs Full Withdrawals
You can withdraw a portion of each asset or the full amount:
- Partial withdrawal: Specify the exact amount for each asset
- Full withdrawal: Use the special value “max” for the amount
Best Practices
- Check available balances: Verify that the portfolio has sufficient assets before initiating a withdrawal
- Handle transaction failures: Implement proper error handling for rejected transactions
- Inform users: Display a loading state during transaction confirmation
- Gas considerations: Be aware that withdrawals may require more gas than simple transfers, especially for multiple assets
- Automation impact: Consider pausing portfolio automation before large withdrawals to prevent concurrent rebalancing
Next Steps
After withdrawing assets, you may want to:
- Update the portfolio to adjust its configuration for the new balance
- Pause automation if you’ve withdrawn a significant amount
- Archive the portfolio if you’ve withdrawn all assets and no longer need it