For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Contact SupportDiscordGo to dashboard
HomeDocsAPI ReferenceLiquidity IntegrationChangelog
HomeDocsAPI ReferenceLiquidity IntegrationChangelog
  • Introduction
    • Welcome
    • Supported Chains and Providers
    • Demo Apps
    • FAQ
    • API Issues & Error Codes
    • Need Help?
  • Swap API
    • Introduction
    • FAQ
  • Gasless API
    • Introduction
    • Gasless FAQ
  • Cross-Chain API
    • Introduction
      • Get started
      • Cross Chain Swaps from Solana
      • Cross Chain Swaps from Tron
      • Cross Chain Swaps to HyperCore
      • Streaming Quotes
      • Monetize Your App
    • Learn More
  • Trade Analytics API
    • Introduction
    • Transaction Data
    • Trade Analytics FAQ
  • Core Concepts
    • Introduction to 0x
    • 0x Cheat Sheet
    • Contracts
    • Order Types
    • Glossary
    • White Paper
    • Transaction Data
  • Developer Resources
    • Bounties
    • Rate Limits
    • System Status
  • Upgrading
    • Overview
    • Upgrading to Swap v2
    • Upgrading to Gasless v2
  • Need Help?
    • FAQ
    • API Issues & Error Codes
    • Contact Support
    • Contact Sales
LogoLogo
Contact SupportDiscordGo to dashboard
On this page
  • Steps to Cross Chain Swap Tokens to HyperCore
  • 0. Prerequisites
  • 1. Fetch a Quote
  • 2. Set a token allowance
  • 3. Sign and submit a transaction
  • 4. Monitor the cross chain execution
  • Supported tokens
  • Checking token balances
  • Key differences from EVM, Solana, and Tron
Cross-Chain APIGuides

Cross Chain Swaps to HyperCore

||View as Markdown|
Was this page helpful?
Edit this page
Previous

Cross Chain Swaps from Tron

Next

Streaming Quotes

Built with

The 0x Cross-Chain API is in private beta. Request access to start building.

HyperCore (also known as Hyperliquid) is supported as a destination chain. You can bridge tokens from any supported origin chain into HyperCore; bridging out of HyperCore is not yet supported. HyperCore works much like other supported chains, with one key difference: tokens are identified by 16-byte token IDs instead of standard EVM addresses.

You can identify HyperCore using any of the following:

  • Chain name: hypercore
  • Alias: hyperliquid
  • Chain ID: 999999999992

Steps to Cross Chain Swap Tokens to HyperCore

This guide will walk you through using the /quotes and /status endpoints on 0x’s Cross Chain API to:

  1. Fetch a quote
  2. Set allowance
  3. Sign and send a transaction
  4. Monitor the status of the cross chain swap

In our example, we will be swapping USDC on Arbitrum to USDC_PERP on HyperCore. Because the origin chain is a standard EVM chain, the signing and submission flow is identical to any other EVM origin — see Get started for more detail on the EVM-specific steps.

0. Prerequisites

Make sure you have:

  • A funded Arbitrum wallet
  • 0x API key
  • An RPC Connection (see Get started for setting up a wallet client with viem)

1. Fetch a Quote

Start by sending a GET request to the 0x /quotes endpoint. The destinationChain is HyperCore, and the buyToken is the 16-byte HyperCore token ID (see Supported tokens below).

1const quotesParams = new URLSearchParams({
2 originChain: '42161', // Arbitrum mainnet
3 destinationChain: 'hypercore', // HyperCore (or '999999999992')
4 sellToken: '0xaf88d065e77c8cc2239327c5edb3a432268e5831', // USDC on Arbitrum (20-byte EVM address)
5 buyToken: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee', // USDC_PERP on HyperCore (16-byte token ID)
6 sellAmount: '5000000', // Amount of sellToken in base units
7 originAddress: '$USER_TAKER_ADDRESS', // Arbitrum address that will make the trade
8 destinationAddress: '$USER_RECEIVER_ADDRESS', // HyperCore address that will receive the output (standard EVM address)
9 sortQuotesBy: 'price', // Prefer the quote that will result in the best price / output
10 maxNumQuotes: 1 // only the best quote
11});
12
13const headers = {
14 '0x-api-key': '[api-key]', // Get your live API key from the 0x Dashboard (https://dashboard.0x.org/apps)
15};
16
17const quoteResponse = await fetch('https://api.0x.org/cross-chain/quotes?' + quotesParams.toString(), { headers });
18
19console.log(await quoteResponse.json());

The API automatically selects the best available bridge based on your request parameters. HyperCore is currently served by the Across V4 and Relay bridges, and available quotes depend on each bridge’s token coverage.

Example response
1{
2 "liquidityAvailable": true,
3 "allowanceTarget": "0x0000000000001ff3684f28c67538d4d072c22734",
4 "originChainId": 42161,
5 "originChain": "arbitrum",
6 "destinationChainId": 999999999992,
7 "destinationChain": "hypercore",
8 "sellToken": "0xaf88d065e77c8cc2239327c5edb3a432268e5831",
9 "buyToken": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
10 "issues": {
11 "allowance": null,
12 "balance": null,
13 "simulationIncomplete": false,
14 "invalidSwapSourcesPassed": [],
15 "invalidBridgesPassed": []
16 },
17 "zid": "0x0d190f698dfa2a134b2089d6",
18 "quotes": [
19 {
20 "sellAmount": "5000000",
21 "buyAmount": "375000000",
22 "minBuyAmount": "371250000",
23 "fees": {
24 "integratorFee": null,
25 "integratorFees": null,
26 "zeroExFee": {
27 "amount": "50000",
28 "token": "0xaf88d065e77c8cc2239327c5edb3a432268e5831",
29 "type": "volume"
30 },
31 "bridgeNativeFee": null
32 },
33 "gasCosts": {
34 "chainType": "evm",
35 "gasPrice": "22945500",
36 "gasLimit": "183470",
37 "totalNetworkFee": "4209810885000"
38 },
39 "steps": [
40 {
41 "type": "bridge",
42 "originChainId": 42161,
43 "destinationChainId": 999999999992,
44 "sellToken": "0xaf88d065e77c8cc2239327c5edb3a432268e5831",
45 "buyToken": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
46 "sellAmount": "4950000",
47 "buyAmount": "375000000",
48 "minBuyAmount": "371250000",
49 "provider": "relay",
50 "estimatedTimeSeconds": 2
51 }
52 ],
53 "transaction": {
54 "chainType": "evm",
55 "details": {
56 "to": "0x0000000000001ff3684f28c67538d4d072c22734",
57 "data": "0x2213bc0b...",
58 "gas": "183470",
59 "gasPrice": "22945500",
60 "value": "0"
61 }
62 },
63 "estimatedTimeSeconds": 2,
64 "issues": {
65 "allowance": null,
66 "balance": null,
67 "simulationIncomplete": false
68 },
69 "quoteId": "0x0d190f698dfa2a134b2089d64ec0370a"
70 }
71 ]
72}

2. Set a token allowance

Because the origin chain is an EVM chain, you may need to set a token allowance to 0x’s AllowanceHolder contract. When an allowance is required, it is reported in issues.allowance in the response. Always use the spender value from the response rather than hardcoding an address.

1// Example assumes that you've set up your walletClient with viem
2import { erc20Abi } from "viem";
3...
4const approveTxHash = await walletClient.writeContract({
5 address: quoteResponse.sellToken as `0x${string}`,
6 abi: erc20Abi,
7 functionName: "approve",
8 args: [
9 quoteResponse.quotes[0].issues.allowance.spender as `0x${string}`,
10 BigInt(quoteResponse.sellAmount),
11 ],
12});
13
14await walletClient.waitForTransactionReceipt({
15 hash: approveTxHash,
16 confirmations: 1,
17});

3. Sign and submit a transaction

With the approval in place, construct, sign, and submit the origin-chain transaction from the quote response, exactly as you would for any EVM swap.

1const txRequest = {
2 to: quoteResponse.quotes[0].transaction.details.to as `0x${string}`,
3 data: quoteResponse.quotes[0].transaction.details.data as `0x${string}`,
4 value: BigInt(quoteResponse.quotes[0].transaction.details.value),
5 gas: quoteResponse.quotes[0].transaction.details.gas
6 ? BigInt(quoteResponse.quotes[0].transaction.details.gas)
7 : undefined,
8};
9
10const txHash = await walletClient.sendTransaction(txRequest);
11
12const receipt = await walletClient.waitForTransactionReceipt({
13 hash: txHash,
14 confirmations: 2,
15});
16console.log(`Transaction confirmed in block: ${receipt.blockNumber}`);

4. Monitor the cross chain execution

Finally, monitor execution of the cross chain transaction, including the fill on HyperCore, using the /status endpoint. Pass the origin tx hash and quoteId.

1const statusParams = new URLSearchParams({
2 originChain: '42161', // origin chain
3 originTxHash: txHash, // origin chain transaction hash from the previous step
4 quoteId: quoteResponse.quotes[0].quoteId, // recommended for faster status resolution
5});
6
7const headers = {
8 '0x-api-key': '[api-key]', // Get your live API key from the 0x Dashboard (https://dashboard.0x.org/apps)
9};
10
11const statusResponse = await fetch('https://api.0x.org/cross-chain/status?' + statusParams.toString(), { headers });
12
13console.log(await statusResponse.json());

In your application, you might need to monitor the status repeatedly, as the bridging operation might take several seconds or minutes to complete.

For full status lifecycle details, polling intervals, and failure handling, see Tracking Transaction Status and Handling Failures and Recovery.

Supported tokens

HyperCore identifies tokens by 16-byte token IDs (32 hex characters), not by the 20-byte EVM address or 32-byte Solana public key used on other chains. The following tokens are currently supported:

TokenToken IDDescription
USDC_PERP0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeUSDC for perpetual trading
HYPE0x0d01dc56dcaaca66ad901c959b4011ecNative HYPE token
USDH0x54e00a5988577cb0b0c9ab0cb6ef7f4bHyperliquid USD
USDC_SPOT0x6d1e7cde53ba9467b783cb7c530ce054USDC for spot trading
USDT0x25faedc3f054130dbb4e4203aca63567USDT0 OFT token
USDe0x2e6d84f2d7ca82e6581e03523e4389f7USDe token

Additional tokens may be available depending on the bridge used. To discover more tokens and their IDs, query the HyperCore API directly:

$curl -X POST https://api.hyperliquid.xyz/info \
> -H "Content-Type: application/json" \
> -d '{"type": "spotMeta"}'

The response includes a tokens array with a tokenId field for each token. Note that not all tokens are supported by all bridges.

Use token IDs, not system addresses. Elsewhere in the HyperCore ecosystem you may see “system addresses” — 20-byte addresses (e.g. 0x2000000000000000000000000000000000000020) used internally for transfers between HyperCore and HyperEVM. These are not token IDs and must not be passed to the 0x Cross-Chain API. The API handles the mapping between token IDs and system addresses internally; always pass the 16-byte token ID.

Checking token balances

HyperCore does not expose a JSON-RPC node. Instead, query token balances through the HyperCore API. Note that originAddress and destinationAddress on HyperCore use the standard 20-byte EVM format, and tx hashes are 32-byte EVM-style hashes — only token identifiers use the 16-byte format.

$# Spot token balances (all tokens except USDC_PERP)
$curl -X POST https://api.hyperliquid.xyz/info \
> -H "Content-Type: application/json" \
> -d '{"type": "spotClearinghouseState", "user": "0x0000000000000000000000000000000000000000" }'
$
$# USDC_PERP balance (see the `withdrawable` field in the response)
$curl -X POST https://api.hyperliquid.xyz/info \
> -H "Content-Type: application/json" \
> -d '{"type": "clearinghouseState", "user": "0x0000000000000000000000000000000000000000" }'

Key differences from EVM, Solana, and Tron

EVMSolanaHyperCoreTron
Supported asOrigin & destinationOrigin & destinationDestination onlyOrigin & destination
Chain identifierNumeric chain ID (e.g. 8453)solana or 999999999991hypercore / hyperliquid or 999999999992tron or 999999999993
Token format20-byte address, 0x-prefixedBase58 (Pubkey)16-byte token ID (32 hex chars)Base58Check (e.g. T...)
User address formatHex, 0x-prefixedBase58 (Pubkey)Hex, 0x-prefixed (standard EVM)Base58Check (e.g. T...)
Balance / chain dataJSON-RPC nodeJSON-RPC nodeHyperCore API (api.hyperliquid.xyz/info)Tron HTTP API
BridgesVaries by chainAcross V4, Relay, othersAcross V4, RelayRelay, NEAR Intents

Want to collect fees? See Monetize Your App to learn how to add integrator fees to cross-chain swaps.