Quicknode logoBuilt on Quicknode infrastructure

Hyperliquid API

One line to trade Hyperliquid.Your keys never leave your machine.

4 SDKs
Zero custody
Perps & Spot
HIP-3 & HIP-4 Markets
Always stay up-to-date on the latest HyperliquidAPI by joining our Telegram
pip install hyperliquid-sdk
from hyperliquid_sdk import HyperliquidSDK

sdk = HyperliquidSDK(endpoint, private_key=key)

# Market buy $100 of BTC
order = sdk.market_buy("BTC", notional=100)
print(f"Filled {order.filled_size} @ ${order.avg_price}")

Everything you need

Trading, streaming, market data — one SDK, four languages

One-Line Trading

Market orders, limits, stops — all in a single call

sdk.market_buy("BTC", notional=100)

Zero Custody

Sign locally. Your keys never leave your machine

# Private key stays local

Real-Time Streaming

WebSocket and gRPC for live trades and order books

sdk.stream.trades(["BTC"], callback)

Full Market Data

Prices, order books, positions, candles — all included

sdk.info.l2_book("ETH")

HIP-3 Markets

Trade community perpetuals with the same API

sdk.buy("xyz:SILVER", notional=11)

Advanced Orders

TWAP, triggers, stop loss, take profit built-in

sdk.twap_order("BTC", size=0.1, ...)

REST API

Build without signature, send with signature. Click any endpoint to try it.

Order priority is set with priorityFee, which the API encodes as {"grouping":{"p":10000}} before hashing. Hyperliquid interprets p as p / 100000000 of filled notional; 10000 is 1 bp. Use cDeposit through the same endpoint to move spot HYPE into undelegated staking HYPE for priority fees. HIP-4 # markets settle in USDH and do not support priority fees.

Exchange — Build (no signature)

Exchange — Send (with signature)

Enhanced Endpoints

Error Codes

Every error uses the appropriate HTTP status code and includes error, message, and guidance with exactly what to do next.

HTTPError Code
403NOT_APPROVED
422BUILDER_MISMATCH
422SIGNATURE_INVALID
422HL_EXCHANGE_*
400INVALID_JSON
422INVALID_PARAMS
500INTERNAL_ERROR

Fees

Two fees apply per trade: our builder fee (injected into your order) and Hyperliquid's exchange fee (maker/taker, charged by the protocol).

Builder Fee— charged by us, injected into each order
MarketFeeProtocol Max
Perpetuals0.04%0.1%
Spot0.05%1%
Exchange Fee— charged by Hyperliquid, based on your volume tier
MarketTakerMaker
Perpetuals0.045%0.015%
Spot0.070%0.040%

You approve a maxFeeRate ceiling (e.g. "1%") for the builder fee. The actual builder fee is always within your approved limit. You can revoke at any time.

Order priority is optional. Set priorityFee on an order to encode Hyperliquid's priority grouping. Priority fees are paid from undelegated staking HYPE; use cDeposit through POST /exchange to move spot HYPE into that balance. HIP-4 # markets do not support priority fees.

FAQ

Common questions about Hyperliquid API.

Hyperliquid API is a zero-custody REST builder API for Hyperliquid, built by Quicknode. It lets you trade perpetuals, spot, HIP-3, and HIP-4 markets programmatically while your private keys never leave your machine.

Every trade follows three steps: (1) Build — construct your order parameters locally, (2) Sign — sign the transaction with your private key on your machine, (3) Send — submit the signed payload to the Hyperliquid API endpoint. Your private key is never transmitted.

Hyperliquid API charges a builder fee of 0.04% on perpetual trades and 0.05% on spot trades. These are on top of Hyperliquid's native exchange fees.

Order priority fees are paid from undelegated staking HYPE, not spot USDC. If you have spot HYPE, build a cDeposit action through POST /exchange, sign the returned hash, then send the returned action with the signature. For example, wei 100000 moves 0.001 HYPE into undelegated staking HYPE.

Set the top-level priorityFee field when building an order. The API encodes it into action.grouping as { p: priorityFee } before hashing, so you must sign and send the returned action unchanged. A priorityFee of 10000 is 1 bp. Do not use priorityFee on HIP-4 prediction markets; Hyperliquid rejects priority grouping for # assets.

No. Hyperliquid API is fully non-custodial. You sign every transaction locally with your own private key. The API only forwards your pre-signed transactions to Hyperliquid. Your keys never leave your machine.

Hyperliquid API provides examples and SDK support for Python, TypeScript, and Rust. The API uses a REST API over HTTPS, so any language with an HTTP client can integrate.

You can trade perpetuals (perps), spot markets, HIP-3 markets, and HIP-4 prediction markets on Hyperliquid through the API. HIP-4 markets use # aliases like #10 or native asset indices like 100000010.

Use the same POST /exchange build-sign-send flow and set the asset to a # alias such as #10, or the native asset index such as 100000010. HIP-4 markets require USDH balance, have a 10 USDH minimum order value, and should use grouping na because priorityFee is not supported for # markets.

Use the USDH/USDC spot market @230. Build a spot IOC buy through POST /exchange with asset @230, sign the returned hash locally, then send the signed action. After the USDH fill settles in spot balance, HIP-4 # market orders can meet the 10 USDH minimum.

Yes. Hyperliquid API by Quicknode is a production-ready REST API for trading on Hyperliquid. It supports perpetuals, spot, HIP-3, and HIP-4 markets with a non-custodial build-sign-send pattern. You sign locally and the API forwards your pre-signed transactions to Hyperliquid.

Use the Hyperliquid API to build a trading bot in Python, TypeScript, or Rust. Call the order endpoint with your parameters, sign the payload with your private key locally, and submit via HTTPS. The API handles routing to Hyperliquid while you retain full custody of your keys.

Send REST API requests to the Hyperliquid API over HTTPS. Build your order parameters, sign the transaction locally with your private key, and call the send endpoint. The API supports market, limit, and trigger orders for perpetuals, spot, HIP-3, and HIP-4 markets.

A builder fee is a small fee charged by Hyperliquid API infrastructure providers on top of Hyperliquid's native exchange fees. Hyperliquid API charges 0.04% on perpetual trades and 0.05% on spot trades. Builder fees are set by the API provider, not by Hyperliquid itself.

To cancel an order through Hyperliquid API, send a cancel request with the order ID, sign it locally with your private key, and submit. To modify, cancel the existing order and place a new one. Both operations follow the same build-sign-send pattern as placing orders.

HIP-3 is Hyperliquid's protocol for permissionless spot token deployment and liquidity. Through the Hyperliquid API, you can trade HIP-3 tokens programmatically alongside perpetuals and standard spot markets. HIP-3 markets use the same REST API endpoints as other order types.

HIP-4 is Hyperliquid's protocol for on-chain prediction markets, enabling programmatic trading on event-based outcomes. Through the Hyperliquid API, you can trade HIP-4 markets using # aliases like #10 or native asset indices like 100000010. HIP-4 markets use the same REST API endpoints as perpetuals, spot, and HIP-3.

No. Hyperliquid API is fully non-custodial — your private key never leaves your machine. You sign every transaction locally and only send the signed payload to the API. The server cannot execute trades without your cryptographic signature.