spot or perp balance directly to a Solana
associated token account (ATA) using CCTP. The withdrawal burns USDC on HyperEVM
and mints it on Solana in a single operation. For withdrawals to EVM
blockchains, see
Withdraw USDC from HyperCore to EVM chains.
For CCTP domain IDs, see
Supported blockchains and domains.
Prerequisites
Before you begin, ensure that you’ve:- Installed Node.js v22+
- Prepared an EVM wallet with the private key available
-
Funded your HyperCore account with USDC in either
spotorperpbalance -
Created a new Node project and installed dependencies:
-
Created a
.envfile with required environment variables. Open the file in your editor and add your private key and Solana addresses:Keep your private key safe and never commit.envto version control. Add.envto your.gitignorefile.
Steps
Step 1. Derive the recipient ATA and createATA hook data
For Solana, the mint recipient is the associated token account for the USDC mint and recipient owner. ThecreateATA hook data tells CCTP to create that ATA
when needed.
TypeScript
Step 2. Construct the sendToEvmWithData action
Create a sendToEvmWithData action object with the following parameters:
type:sendToEvmWithDatahyperliquidChain:Mainnet(orTestnetfor testnet)signatureChainId: The ID of the chain used when signing in hexadecimal format (for example,"0xa4b1"for Arbitrum).token:USDCamount: The amount of USDC as a string (for example,"10"for 10 USDC,"1.5"for 1.5 USDC)sourceDex:"spot"to withdraw from spot balance, or""forperpbalancedestinationRecipient: The recipient ATA on Solana. This is the ATA for the recipient owner and the USDC mint, not the owner wallet address.addressEncoding:base58for Solana recipientsdestinationChainId:5, the CCTP destination domain ID for SolanagasLimit: Gas limit for the transaction on the destination blockchaindata: ThecreateATAhook data from the previous step, which includes the recipient owner public key asataOwner. The CCTPdestinationCalleris always set to the zero address, so any caller can submit the CCTP receive instruction on Solana. The USDC still mints only todestinationRecipient.nonce: Current timestamp in milliseconds
TypeScript
Step 3. 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 fromsignatureChainId(as a number)verifyingContract:"0x0000000000000000000000000000000000000000"
TypeScript
Step 4. 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 Solana. By default, it withdraws 10 USDC from your perp balance. UpdatedestinationChainId only if the CCTP Solana domain changes, and set
signatureChainId to the ID of the chain used when signing in hexadecimal
format.
TypeScript