architecture/SKILL.md
HyperCore vs HyperEVM — what lives where, how they interact, the complete system model. Essential reading before building anything on Hyperliquid. Use when planning architecture, understanding state, or deciding where logic belongs.
npx skillsauth add cloudzombie/liquidskills architectureInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
"Hyperliquid is an EVM chain." HyperEVM is ONE component of Hyperliquid. The other component — HyperCore — is a custom exchange engine that runs alongside the EVM. They share finality but are distinct execution environments.
"Everything is a contract." HyperCore has no contracts. Its logic (orderbook matching, liquidations, funding rate calculation) is built into the L1 protocol. You can't deploy to HyperCore — you integrate with it via API.
"The EVM and exchange are on separate chains." They share the same validator set and consensus round. An EVM transaction and a HyperCore order placed in the same block are final at the same time. This atomic finality is what makes Hyperliquid unique.
┌─────────────────────────────────────────────────────────────┐
│ HyperBFT Consensus │
│ (All validators agree on HyperCore + HyperEVM state) │
│ │
│ ┌──────────────────────┐ ┌──────────────────────────┐ │
│ │ HyperCore │ │ HyperEVM │ │
│ │ │ │ │ │
│ │ • Perp orderbook │ │ • EVM contracts │ │
│ │ • Spot orderbook │◄──┤ • ERC-20 tokens │ │
│ │ • Positions │ │ • DeFi protocols │ │
│ │ • Funding rates │ │ • Chain ID 999 │ │
│ │ • HLP vault │ │ • HYPE gas token │ │
│ │ • HIP-1/2/3 tokens │ │ │ │
│ │ • Cross-margin │ │ │ │
│ └──────────────────────┘ └──────────────────────────┘ │
│ │
│ Access: Access: │
│ POST /info Standard EVM RPC │
│ POST /exchange https://rpc.hyperliquid.xyz/ │
│ WSS /ws evm │
└─────────────────────────────────────────────────────────────┘
HyperCore is the native exchange engine. It is NOT EVM — it's a purpose-built exchange running at L1 consensus speed.
Perpetual Futures:
Spot Orderbook:
Vaults:
Token Standards:
User Accounts:
All via POST /info to https://api.hyperliquid.xyz/info:
// Get perp market metadata
{ "type": "meta" }
// Get spot market metadata
{ "type": "spotMeta" }
// Get user state (all positions, balances)
{ "type": "clearinghouseState", "user": "0x..." }
// Get open orders
{ "type": "openOrders", "user": "0x..." }
// Get orderbook
{ "type": "l2Book", "coin": "ETH" }
// Get all perp markets ticker data
{ "type": "allMids" }
All via POST /exchange to https://api.hyperliquid.xyz/exchange:
{
"action": { "type": "order", ... },
"nonce": 1234567890123,
"signature": { "r": "0x...", "s": "0x...", "v": 27 }
}
Every write requires an EIP-712 signature. No unsigned writes.
HyperEVM is a standard EVM environment running alongside HyperCore.
| Feature | Ethereum Mainnet | HyperEVM | |---------|-----------------|----------| | Chain ID | 1 | 999 (mainnet) / 998 (testnet) | | Native currency | ETH | HYPE | | Block time | ~12s | ~1-2s | | Priority fees | → validators | Burned | | Blob transactions | Yes (Cancun) | No (Cancun opcodes, no blobs) | | MEV | Significant | Minimal | | Testnet | Sepolia (11155111) | 998 |
// viem
import { defineChain } from 'viem';
export const hyperliquid = defineChain({
id: 999,
name: 'HyperEVM',
nativeCurrency: { name: 'HYPE', symbol: 'HYPE', decimals: 18 },
rpcUrls: {
default: { http: ['https://rpc.hyperliquid.xyz/evm'] },
},
blockExplorers: {
default: { name: 'HyperEVM Explorer', url: 'https://explorer.hyperliquid.xyz' },
},
});
export const hyperliquidTestnet = defineChain({
id: 998,
name: 'HyperEVM Testnet',
nativeCurrency: { name: 'HYPE', symbol: 'HYPE', decimals: 18 },
rpcUrls: {
default: { http: ['https://rpc.hyperliquid-testnet.xyz/evm'] },
},
blockExplorers: {
default: { name: 'HyperEVM Testnet Explorer', url: 'https://explorer-testnet.hyperliquid.xyz' },
},
});
The system address 0x2222222222222222222222222222222222222222 is the HyperCore ↔ HyperEVM bridge.
Moving HYPE from HyperCore to HyperEVM:
0x2222...2222 with HYPE value. This is counterintuitive — you're sending FROM HyperEVM TO the bridge address, and HYPE appears on HyperEVM.0x2222...2222 on HyperEVM withdraws it TO HyperCore.Let me clarify the bridge mechanics:
HyperEVM → HyperCore (withdraw from EVM):
0x2222222222222222222222222222222222222222 on HyperEVMHyperCore → HyperEVM (deposit to EVM):
/exchange API with action type "spotSend" or use the "evmUserModify" actionIn practice:
HyperEVM contracts can read HyperCore state via a system precompile at address 0x0000000000000000000000000000000000000800 (verify current address in official docs — may change).
This enables HyperEVM contracts to:
This is advanced functionality — most builders use the REST API instead of the precompile.
Both HyperCore and HyperEVM reach finality in the same HyperBFT round. This means:
No waiting for "safe" confirmations. 1 block = final. Plan your UX accordingly.
Does it involve trading, positions, or native token markets?
├─ YES → HyperCore API (/exchange)
│ Use SDK, EIP-712 signing
│
└─ NO → Does it need custom contract logic?
├─ YES → HyperEVM (Solidity contract)
│ Chain ID 999, HYPE gas
│
└─ NO → Is it a read query?
├─ HyperCore state → POST /info
└─ EVM state → standard eth_call via RPC
Understanding asset IDs is critical for HyperCore API calls:
meta.universe array (e.g., ETH-perp might be asset 1)Always fetch current asset IDs via POST /info with { "type": "meta" } — never hardcode them.
# Get current asset IDs
import requests
meta = requests.post('https://api.hyperliquid.xyz/info',
json={'type': 'meta'}).json()
# Perp assets
for i, asset in enumerate(meta['universe']):
print(f"Perp {i}: {asset['name']}")
# Spot assets
spot_meta = requests.post('https://api.hyperliquid.xyz/info',
json={'type': 'spotMeta'}).json()
for i, token in enumerate(spot_meta['tokens']):
print(f"Spot {i} (ID: {10000+i}): {token['name']}")
development
Why build on Hyperliquid. HyperBFT consensus, native orderbook, speed, AI agent angle, honest tradeoffs. Use when someone asks "should I build on Hyperliquid?", "why not Ethereum?", or when an agent needs to understand what makes Hyperliquid unique.
development
Wallets on Hyperliquid — MetaMask + chain ID 999 setup, HyperCore API wallets, agent wallet patterns, EIP-712 signing for exchange actions. Essential for any agent that needs to interact with Hyperliquid.
tools
Development tools for Hyperliquid — Foundry, Hardhat, viem, wagmi for HyperEVM; Python SDK and TypeScript SDK for HyperCore API. What works, what to use, how to set up.
testing
Smart contract testing for HyperEVM with Foundry/Hardhat — unit tests, fuzz testing, testnet fork testing. What to test, what not to test, and what LLMs get wrong on Hyperliquid.