Skip to main content
Withdraw funds from a provider perps account.
The examples on this page use Hyperliquid (provider: 'hyperliquid'). Withdrawal mechanics (supported assets, destination chains, and processing times) vary by provider.

Overview

PerpsClient.withdraw() is a single-call helper that builds the withdrawal payload, authorizes it through the registered provider plugin, and submits the signed action. It dispatches through the same createAction → authorize → executeAction pipeline documented in Actions, but consumers do not have to compose the steps manually.
Withdrawal authorization is provider-specific. Hyperliquid withdrawals require the user’s wallet. Lighter withdrawals are signed by the provider plugin’s SDK-managed Lighter key. Always follow the ProviderAction.signers and signingMethod metadata instead of assuming one signer for every venue.
Hyperliquid: Withdrawal processing typically takes 3–4 minutes. The bridge transfer from Hyperliquid L1 to Arbitrum is asynchronous.

Discovering Withdrawable Balances

Call getWithdrawableBalances() before rendering a withdrawal picker. Providers that support the capability return one row per withdrawable (asset, route) pair; providers without the optional read return undefined, which means the form remains amount-only.
Each WithdrawableBalance contains: The SDK joins provider rows with /assets, drops unknown assets, and filters amounts below each asset’s minWithdrawalAmount. For a row-based provider, pass the selected asset.id and route through the withdrawal action params together; never merge balances across routes. The amount remains a human-readable decimal string — the provider signer applies the asset precision.
Withdrawal submission returns 202 Accepted. Processing is asynchronous — for Hyperliquid, this typically takes 3–4 minutes via the Arbitrum bridge. Poll getAccount() to verify the balance change.

PerpsClient.withdraw

Build, sign with the provider-declared signer, and submit a withdrawal in a single call.
Parameters: WithdrawParams WithdrawalParams: Returns: ExecuteActionResponse{ results: ActionResult[] }. The array contains a single result for the WITHDRAWAL action:

Using Service Functions (advanced)

For complete control over the create/sign/execute steps — for example, to surface the typed-data payload in a confirmation dialog before requesting the signature — call the lower-level createAction / executeAction service functions directly. See Actions for the full create → sign → execute pattern.
API Reference: POST /createAction, POST /executeAction