Comment on page

API

Documentation for the Hyperliquid public API
You can also use the API via the Hyperliquid Python SDK: https://github.com/hyperliquid-dex/hyperliquid-python-sdk
All example API calls use the Mainnet url (https://api.hyperliquid.xyz), but you can make the same requests against Testnet using the corresponding url (https://api.hyperliquid-testnet.xyz)

Notation

The API currently uses some nonstandard notation. Relevant changes will be batched into a breaking v1 API change.
Abbreviation
Full name
Explanation
Px
Price
Sz
Size
In units of coin, i.e. base currency
Szi
Signed size
Positive for long, negative for short
Ntl
Notional
USD amount, Px * Sz
Side
Side of trade or book
B = Bid = Buy, A = Ask = Short. Side is aggressing side for trades.
Asset
Asset
An integer representing the asset being traded. See below for explanation
Tif
Time in force
GTC = good until canceled, ALO = add liquidity only (post only), IOC = immediate or cancel

Asset IDs

When requests expect an integer for asset, use the index of the coin found in the meta info response. E.g. BTC = 0 on mainnet.

Tick size and lot size

Both Price (px) and Size (sz) have a maximum number of decimals that are accepted.
Prices can have up to 5 significant figures, but no more than 6 decimals places. For example, 1234.5 is valid but 1234.56 is not (too many significant figures). 0.001234 is valid, but 0.0012345 is not (more than 6 decimal places).
Sizes are rounded to the szDecimals of that asset. For example, if szDecimals = 3 then 1.001 is a valid size but 1.0001 is not.
You can find the szDecimals for an asset by making a meta request to the info endpoint

Rate Limits

There is a rate limit of 1200 requests per minute per IP address. Use websockets for lowest latency realtime data. See the python SDK for a full-featured example.