Hyperliquid Native API vs CCXT for Trading Bot Integration
CCXT offers a unified interface across 100+ exchanges while Hyperliquid's native API exposes order book depth and vault mechanics unavailable elsewhere — this guide shows which integration path wins for each bot type.
If you are integrating a trading bot with Hyperliquid today, you have two realistic options: pull in CCXT and lean on its unified interface, or write directly against Hyperliquid's own REST and WebSocket APIs. The choice is not academic — it shapes what data you can see, how fast your orders land, and which strategies are even possible. Here is what that decision looks like from the production side.
What CCXT Actually Gives You on Hyperliquid
CCXT added Hyperliquid support in late 2023. The abstraction covers the standard surface area: fetching balances, placing market and limit orders, querying open positions, and pulling OHLCV candles. If you already run bots across multiple venues — say, a cross-exchange basis strategy that also touches Binance and OKX — CCXT is genuinely useful. One interface, one authentication pattern, one error-handling layer.
The library normalizes Hyperliquid's response format into the same dictionary shape it uses everywhere else. That is valuable when your signal generation layer does not care which venue executes. Order status codes, timestamp formats, and fee representations all come out consistent.
The cost is abstraction loss. CCXT wraps Hyperliquid's API in a way that smooths over some of its most powerful features.
What the Native API Exposes That CCXT Does Not
Hyperliquid's native API is built around an L2 order book model with a few capabilities that do not exist on most CEXs and therefore have no CCXT equivalent.
Full L2 order book snapshots and diffs via WebSocket. The native l2Book subscription gives you bids and asks to 20 levels, updating every 100–200 ms. CCXT's watchOrderBook method exposes this in theory, but the implementation as of mid-2025 only surfaces the top 5 levels and does not expose the coin metadata fields the exchange includes.
Vault deposits and vault equity reads. Hyperliquid vaults are on-chain smart contract accounts that hold trader capital. If you are building a fund-style product — where external capital deposits into a vault you manage — the native API's /info endpoint with type: "vaultDetails" and type: "userVaultEquities" is the only path. CCXT has no abstraction for vault mechanics.
Builder fee configuration. The native API lets you set a builder field on orders, routing a portion of fees to a designated address. This is how front-ends and infrastructure providers monetize order flow on Hyperliquid. CCXT does not expose this field.
Sub-account and agent wallet patterns. Hyperliquid supports agent wallets — a separate key that can trade on behalf of a main account without holding funds. Useful for isolating hot keys in production. The native API exposes this cleanly; CCXT does not model the pattern.
Latency and Connection Architecture
Both paths ultimately call the same Hyperliquid infrastructure, so raw network latency is identical. The difference is overhead.
A CCXT create_order call in Python goes through parameter normalization, symbol mapping, request construction, and response parsing — typically adding 2–8 ms of CPU overhead per call compared to a raw httpx or aiohttp request against the native endpoint. For most strategies that is irrelevant. For latency-sensitive market making at 10–50 orders per second, it is not.
On the WebSocket side, CCXT's async implementation is solid, but it re-serializes messages through its normalization layer on every tick. If you are running a model that consumes raw order book diffs at high frequency, deserializing the native JSON directly is measurably faster and avoids the intermediate allocation.
When CCXT is the Right Choice
- Your bot already runs on multiple exchanges and Hyperliquid is one venue among several.
- The strategy is signal-driven and execution is not latency-sensitive (arbitrage with a multi-second holding period, trend following, mean reversion on hourly candles).
- Your team knows CCXT and the cost of rewriting the integration is higher than any performance gain.
- You want to inherit CCXT's community-maintained error handling and retry logic rather than building your own.
When to Go Native
- You are building a market maker that needs full L2 depth and sub-200 ms reaction times.
- The product involves vaults, sub-accounts, or agent wallets.
- You need the
builderfee configuration for monetization. - You are writing in a language where a production-quality CCXT binding does not exist — Rust and Go integrations against the native API are straightforward and several open implementations are available.
- The bot is Hyperliquid-only and there is no cross-exchange portability requirement.
Hybrid Architectures in Practice
The cleanest production pattern we have used is a hybrid: CCXT for account management and non-latency-sensitive order types (closing positions, adjusting leverage, querying PnL), and a native WebSocket + REST client for the market making loop. The two clients share state through a lightweight in-process message bus. This avoids the trap of either going fully native and reimplementing things CCXT handles well, or going fully CCXT and accepting its limitations on the hot path.
One practical note on authentication: Hyperliquid uses an EIP-712 signing scheme for orders. CCXT handles this under the hood. If you go native, you need a signing library — eth_account in Python, ethers in JS, or alloy in Rust. It is not complex, but it is one more dependency to manage and audit.
If you are building a trading bot on Hyperliquid and want production-grade integration work — whether native, CCXT-based, or a hybrid — reach out to TierZero. We design and operate these systems and can shortcut months of integration work.
Need a bot like this built?
We design, build and run trading bots on Solana, Hyperliquid and Polymarket.
Start a projectMore from the blog
Public vs Paid RPC: How to Run a Fair Benchmark
A fair comparison of public and paid RPC endpoints must account for quotas, workload, freshness and support guarantees.
Read articleRPC Benchmark Percentiles Explained: p50, p95 and p99
Why averages hide the latency spikes that break trading bots, wallets and production blockchain applications.
Read articleHyperliquid REST vs WebSocket Benchmark: What to Measure
A benchmark plan for Hyperliquid market data that separates request latency from streaming freshness and recovery.
Read article