Overview
Mayan supports direct Hyperliquid (HyperCore) deposits and withdrawals through the Swap SDK. You can:- Deposit β swap from any supported token on any supported chain into a HyperCore USDC balance.
- Withdraw β move USDC out of a HyperCore balance back to an EVM chain.
0xβ¦ address β the same address the
user signs with. HyperCore holds USDC in two distinct balances, and every deposit/withdrawal targets one of them:
- USDC (spot) β the Hyperliquid spot balance.
- USDC (perps) β the Hyperliquid perpetuals (collateral) balance.
fetchQuote and swapFromEvm / swapFromSolana entry points with
hypercore as the toChain (deposit) or fromChain (withdraw), and consume the resulting Quote
exactly as you would for any other pair.
Requires
@mayanfinance/swap-sdk v14.3.0 or later.HyperCore token identifiers
When you fetch a quote, the HyperCore side is addressed with thesetoToken / fromToken values:
| Balance | Quote token name | Identifier (contract) |
|---|---|---|
| USDC (spot) | USDC (spot) | 0x000000000000000000000000000000000000ffff |
| USDC (perps) | USDC (perps) | 0x0000000000000000000000000000000000000000 |
fetchTokenList('hypercore')) instead of hard-coding them.
Deposit (into HyperCore)
Bridge/swap from a source chain into a HyperCore USDC balance. This is a normal signed transaction on the source chain (so the user needs gas there); the SDK and Mayan relayer handle the rest, crediting the chosen HyperCore balance.1. Fetch a quote
SettoChain: 'hypercore' and toToken to the spot or perps identifier. The returned quote is a
SWIFT quote whose toToken.name is 'USDC (spot)' or 'USDC (perps)'.
- The input token can be anything Mayan supports on the source chain (native ETH, USDC, etc.); Mayan swaps it to USDC and deposits it.
gasDropis not supported for HyperCore deposits and is ignored.- HyperCore deposits do not accept a caller-supplied payload β passing one throws. The route builds its own fixed payload.
- HyperCore enforces a minimum deposit (around 5 USDC of output). Size
amountIn64so the expected output clears it.
2. Execute the deposit
Use the regularswapFromEvm (or swapFromSolana) β there is no extra signing step. Pass the
userβs HyperCore address (the 0xβ¦ account) as destinationAddress.
getSwapFromEvmTxPayload
instead. Solana sources are supported via swapFromSolana; depositing from HyperEVM uses a
mono-chain quote and the same swapFromEvm entry point.
3. Track the deposit
A deposit returns a normalTransactionResponse. Track it on the
Explorer API by transaction hash and watch
clientStatus (INPROGRESS β COMPLETED / REFUNDED):
Withdraw (out of HyperCore)
Move USDC out of a HyperCore balance to an EVM chain. Withdrawals are gasless: the user signs an EIP-712 typed-data message instead of sending an on-chain transaction, and the SDK submits it to the Mayan relayer. No source-chain gas is required.1. Fetch a quote
SetfromChain: 'hypercore' and fromToken to the spot or perps identifier, and pass
{ gasless: true }. HyperCore withdrawals must be gasless SWIFT quotes β the returned quote
carries an hcSwiftWithdraw object.
2. Execute the withdrawal
Call the sameswapFromEvm. Because quote.fromChain === 'hypercore' and the quote is a gasless
SWIFT quote, the SDK builds the HyperliquidTransaction:SendToEvmWithData EIP-712 message, has the
signer sign it, submits it to the relayer, and returns an orderId string (no on-chain tx).
- Withdrawals must use a gasless SWIFT quote. Passing a non-gasless quote (or a non-SWIFT
quote) throws
Only SWIFT gasless quotes are supported from hypercore withdraw. - Unlike deposits, a custom
payloadis supported and is appended to the orderβs hook data. - You only specify the final
toChain/toTokenin the quote; the SDK and relayer handle delivery to that destination.
3. Track the withdrawal
swapFromEvm returns an orderId (e.g. HCS_WITHDRAW_0xβ¦) for HyperCore withdrawals. Track it on the
Explorer API via the order-id endpoint (not the
trx endpoint used for deposits) and watch clientStatus: