Skip to main content
Withdraw ERC20 tokens from the Monaco Protocol vault back to your wallet.

Quick Setup

Understanding Asset IDs

Monaco uses asset IDs (UUIDs) for all vault operations. See the Deposit Tokens page for a detailed explanation.

Step-by-Step Withdrawal Process

1. Authenticate

Authentication is required before any vault operations:

2. Get Asset Information

Retrieve the asset you want to withdraw from a trading pair:

3. Check Vault Balance

Verify you have sufficient balance to withdraw:

4. Execute Withdrawal

Withdraw tokens from the vault to your wallet:

5. Verify Withdrawal

Check updated balances:

Complete Example

Partial Withdrawals

Withdraw a portion of your vault balance:

Maximum Withdrawal

Withdraw all available tokens:

Error Handling

Transaction Result

The withdraw() method returns a WithdrawResult object:
If the on-chain submission fails or is dropped, retry using the saved index — no new withdrawal slot is allocated:

Low-Level Withdrawals (no broadcast)

sdk.vault.withdraw is the high-level flow: it fetches the gateway-signed calldata and broadcasts the transaction on-chain through the connected wallet. If you’d rather submit the transaction yourself — a custom signer, relayer, batching, or just inspecting the calldata first — use the low-level sdk.withdrawals API, which returns the signed executeSignedWithdrawal calldata without broadcasting.

Withdrawal Validation

Check Balance Before Withdrawal

Best Practices

  1. Always authenticate first - Login before any vault operations
  2. Get asset IDs from trading pairs - Use sdk.market.getTradingPairBySymbol() or sdk.market.getPaginatedTradingPairs() to get valid asset IDs
  3. Check balances - Verify sufficient vault balance before withdrawal
  4. Handle errors gracefully - Check for ASSET_NOT_FOUND errors if using invalid asset IDs
  5. Verify results - Check vault balance after withdrawals

Troubleshooting

Asset Not Found Error

If you get an ASSET_NOT_FOUND error, make sure you’re using a valid asset ID from a trading pair:

Insufficient Balance

Transaction Failed

Signature Issues