BTB
/

Hyperliquid

Derivativeswebsite
Perpetuals and spot order-book exchange running on its own L1 (HyperCore). Agents trade, cancel, transfer and withdraw by POSTing EIP-712-signed actions to the official HTTP API, read positions/orders from the public info endpoint, deposit USDC from Arbitrum via the bridge contract, and can reach HyperCore from HyperEVM (chainId 999) contracts via the CoreWriter system contract.

What you can do

place orderPlace a perp or spot limit/IOC/post-only/trigger orderPOST https://api.hyperliquid.xyz/exchange with action {type:'order', orders:[{a,b,p,s,r,t,c?}], grouping:'na'}, nonce = ms timestamp, signed as an L1 action (phantom Agent EIP-712, chainId 1337). Market orders are IOC limit orders with an aggressive price. From HyperEVM: CoreWriter.sendRawAction with action ID 1.
cancel orderCancel by order id or client order idPOST /exchange with action {type:'cancel', cancels:[{a, o: oid}]} or {type:'cancelByCloid', cancels:[{asset, cloid}]}, L1-signed. scheduleCancel sets a dead-man's switch. From HyperEVM: CoreWriter action IDs 10/11.
depositDeposit USDC from Arbitrum to HyperliquidTransfer native Arbitrum USDC (min 5 USDC) to Bridge2 0x2Df1c51E09aECF9cacB7bc98cB1742757f163dF7; credited to the same address in <1 minute. Or Bridge2.batchedDepositWithPermit with a user's USDC permit. Docs call this bridge legacy/deprecated and prefer Circle CCTP for native USDC.
withdrawWithdraw USDC to ArbitrumPOST /exchange with user-signed action {type:'withdraw3', hyperliquidChain, signatureChainId, destination, amount, time} where time == nonce. No Arbitrum tx needed; validators send funds in about 3-5 minutes; $1 fee at time of writing.
read positionsRead open perp positions, margin and balancesPOST https://api.hyperliquid.xyz/info {type:'clearinghouseState', user:<address>} for perps (assetPositions, marginSummary); {type:'spotClearinghouseState', user} for spot balances; {type:'openOrders', user} for resting orders. No auth.
set leverageChange cross/isolated leverage for an assetPOST /exchange {type:'updateLeverage', asset, isCross, leverage}, L1-signed.
approve API (agent) walletLet a separate key sign trades for the accountPOST /exchange user-signed action approveAgent {agentAddress, agentName?}. Agent wallets only sign; query state with the master address.
move HYPE / tokens between HyperCore and HyperEVMBridge assets between the L1 order book and HyperEVMEVM->Core: send HYPE to 0x2222222222222222222222222222222222222222, or ERC20 transfer a linked token to its system address (0x20 followed by zeros and the token index big-endian). Core->EVM: spotSend/sendAsset to the token's system address.
Trading is not done through EVM contracts: orders are off-chain-signed API actions processed by HyperCore validators; a wrong signature yields errors like 'User or API Wallet ... does not exist'.
Bridge deposits below 5 USDC are not credited and are lost forever.
Bridge2 is documented as legacy/deprecated; Circle CCTP is the preferred way to get native USDC onto Hyperliquid.
Nonces: each signer keeps its 100 highest nonces; a nonce must exceed the smallest of them, be unused, and be within (T - 2 days, T + 1 day) of block time.

Contracts

Read any function, or build a write and sign it. Amounts are in base units (1 USDC = 1000000).
Hyperliquid Bridge2 (legacy USDC bridge)bridge on arbitrum0x2Df1c51E09aECF9cacB7bc98cB1742757f163dF7
write batchedDepositWithPermit((address,uint64,uint64,(uint256,uint256,uint8))[])
Deposit native Arbitrum USDC on behalf of users. Each entry is DepositWithPermit{user, usd (6 decimals), deadline, Signature{r,s,v}} where the signature is the user's EIP-2612 Permit on Arbitrum USDC (domain name 'USD Coin', version '2', chainId 42161, verifyingContract 0xaf88d065e77c8cC2239327C5EDb3A432268e5831) with spender = this bridge. Anyone can submit.
read usdcToken()
Address of the USDC token the bridge accepts.
read paused()
True if the bridge is paused (deposits via permit and withdrawals halt).
read disputePeriodSeconds()
Dispute period applied to withdrawals before validators finalize them.
USDC (native, Arbitrum) - deposit assettoken on arbitrum0xaf88d065e77c8cC2239327C5EDb3A432268e5831
write transfer(address,uint256)
Simplest deposit: transfer native USDC (6 decimals) to the Bridge2 address; credited to the sending address on Hyperliquid in under 1 minute. Minimum 5 USDC - smaller amounts are lost forever.
read balanceOf(address)
USDC balance on Arbitrum.
read nonces(address)
EIP-2612 permit nonce, needed to sign the permit for batchedDepositWithPermit.
CoreWriter (system contract)other on hyperevm0x3333333333333333333333333333333333333333
write sendRawAction(bytes)
Send a HyperCore action from HyperEVM (msg.sender is the HyperCore account). Encoding: byte 1 = version (1), bytes 2-4 = big-endian action ID, rest = abi.encode of the action's fields. IDs: 1 limit order (uint32 asset, bool isBuy, uint64 limitPx, uint64 sz, bool reduceOnly, uint8 tif, uint128 cloid); 2 vault transfer; 3 token delegate; 4 staking deposit; 5 staking withdraw; 6 spot send; 7 USD class transfer; 8 finalize EVM contract; 9 add API wallet; 10 cancel by oid; 11 cancel by cloid; 12 approve builder fee; 13 send asset; 15 borrow/lend; 16 set abstraction; 17 outcome operation.
HYPE system address (HyperCore <> HyperEVM HYPE transfers)bridge on hyperevm0x2222222222222222222222222222222222222222
write receive()
On HyperEVM, send native HYPE as tx value to this address to move it to HyperCore (emits Received(address indexed user, uint256 amount), credited to msg.sender). On HyperCore, sending HYPE to this address (spotSend/sendAsset) moves it to HyperEVM as native gas token.