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)
The API currently uses some nonstandard notation. Relevant changes will be batched into a breaking v1 API change.
In units of coin, i.e. base currency
Positive for long, negative for short
USD amount, Px * Sz
Side of trade or book
B = Bid = Buy, A = Ask = Short. Side is aggressing side for trades.
An integer representing the asset being traded. See below for explanation
Time in force
GTC = good until canceled, ALO = add liquidity only (post only), IOC = immediate or cancel
When requests expect an integer for
asset, use the index of the coin found in the
metainfo response. E.g.
BTC = 0on mainnet.
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.5is valid but
0.001234is valid, but
Sizes are rounded to the
szDecimalsof that asset. For example, if
szDecimals = 3then
1.001is a valid size but
You can find the
szDecimalsfor an asset by making a meta request to the info endpoint