Skip to main content
This guide shows how to withdraw USDC from a HyperCore spot or perp balance to HyperEVM using the HyperCore API.
You can only withdraw USDC from HyperCore to the same address on HyperEVM. It’s not possible to specify a different recipient address.

Prerequisites

Before you begin, ensure that you’ve:
  • Installed Node.js v22.6+
  • Prepared an EVM wallet with the private key available
  • Funded your HyperCore account with USDC in either spot or perp balance
  • Created a new Node project and installed dependencies:
  • Created a .env file with required environment variables:

Steps

Use the following steps to withdraw USDC from HyperCore to HyperEVM.

Step 1. Construct the sendAsset action

Create a sendAsset action object with the following parameters:
  • type: sendAsset
  • hyperliquidChain: Mainnet (or Testnet for testnet)
  • signatureChainId: An EVM chain ID used for EIP-712 replay protection. Must match between signing and the action payload, but can be any valid chain ID (for example, "0xa4b1" for Arbitrum)
  • destination: The USDC token system address (0x2000000000000000000000000000000000000000)
  • sourceDex: "spot" to withdraw from spot balance, or "" for perp balance
  • destinationDex: "spot"
  • token: USDC
  • amount: The amount of USDC as a human-readable string (for example, "10" for 10 USDC)
  • fromSubAccount: Set to "" for main account, or the subaccount address
  • nonce: Current timestamp in milliseconds
TypeScript

Step 2. Sign the action using EIP-712

Sign the action using the EIP-712 typed data signing standard. The signature proves that you authorize this withdrawal. The signing domain should include:
  • name: "HyperliquidSignTransaction"
  • version: "1"
  • chainId: The chain ID from signatureChainId (as a number)
  • verifyingContract: "0x0000000000000000000000000000000000000000"
TypeScript

Step 3. Submit the signed action to the exchange API

Call the exchange endpoint with the action, nonce, and signature.
TypeScript

Full example code

The following is a complete example of how to withdraw USDC from HyperCore to HyperEVM. By default, it withdraws 10 USDC from your perp balance to HyperEVM testnet.
TypeScript
Run the script: