perp

Perp Withdraw

Withdraw perp collateral.

Pass destination_chain_id (+ token) to land it in the agent's own wallet, or to_address to have Hyperliquid pay USDC on Arbitrum straight to an outside address.

post/v1/perp/withdraw

Request

  • Base URL
    https://api.fereai.xyz
  • URL
    https://api.fereai.xyz/v1/perp/withdraw
  • Auth
    none declared

Query parameters

waitboolean

Block until task completes

timeoutinteger

Seconds to block when wait=true (max 90; the ~100s edge cuts longer waits — use wait=false + poll for longer).

Request body

amount_usdnumber required

USD notional of perp collateral (USDC) to withdraw. Hyperliquid deducts a flat $1 fee; minimum $6.

destination_chain_idinteger nullable

Target chain for the withdrawn token, landing in the agent's own wallet. Required unless to_address is set; with to_address omit it or pass 42161 (Arbitrum).

destination_tokenstring nullable

ERC-20 on destination chain, Solana mint, or null for the native token. With to_address omit it or pass Arbitrum USDC.

to_addressstring nullable

Outside EVM address. Hyperliquid pays USDC on Arbitrum straight there (amount minus the $1 fee); it never passes through the agent's wallet. Must accept USDC on Arbitrum One; the agent's own wallets are refused.

Example request

{
  "amount_usd": 25,
  "to_address": "0x1111111111111111111111111111111111111111"
}

Response

Successful Response

task_idstring required

Celery task ID for tracking the async operation.

statusstring

Current task status: queued, pending, started.

poll_urlstring nullable

Relative URL to poll for task status.

notification_streamstring nullable

SSE stream URL for real-time task updates.

Example response

{
  "notification_stream": "/v1/notifications/stream",
  "poll_url": "/v1/tasks/d290f1ee-6c54-4b01-90e6-d701748f0851",
  "status": "queued",
  "task_id": "d290f1ee-6c54-4b01-90e6-d701748f0851"
}

Changes

No recorded changes to this operation across all 1 revision of this API.