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.

Rounding

Both Price (px) and Size (sz) have a maximum number of decimals that are accepted.
Prices are precise to the lesser of 5 significant figures or 6 decimals. For example, 1234.5 is valid but 1234.56 is not. 0.001234 is valid, but 0.0012345 is not.
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
Last modified 21d ago