CCXT
hyperliquid

hyperliquid

hyperliquid cryptocurrency exchange — CCXT unified API: methods, parameters and endpoints.

🔌 Looking for raw exchange endpoints? See the hyperliquid implicit API — every endpoint in this exchange's API exposed as an implicit method.

hyperliquid

Kind: global class
Extends: Exchange

fetchStatus

the latest known information on the availability of the exchange API

Kind: instance method of hyperliquid
Returns: object - a status structure

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.fetchStatus (params?)

fetchTime

fetches the current integer timestamp in milliseconds from the exchange server

Kind: instance method of hyperliquid
Returns: int - the current integer timestamp in milliseconds from the exchange server

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.fetchTime (params?)

fetchCurrencies

fetches all available currencies on an exchange

Kind: instance method of hyperliquid
Returns: object - an associative dictionary of currencies

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-metadata

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.fetchCurrencies (params?)

fetchMarkets

retrieves data on all markets for hyperliquid

Kind: instance method of hyperliquid
Returns: Array<object> - an array of objects representing market data

See

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.fetchMarkets (params?)

fetchHip3Markets

retrieves data on all hip3 markets for hyperliquid

Kind: instance method of hyperliquid
Returns: Array<object> - an array of objects representing market data

See

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.fetchHip3Markets (params?)

fetchSwapMarkets

retrieves data on all swap markets for hyperliquid

Kind: instance method of hyperliquid
Returns: Array<object> - an array of objects representing market data

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.fetchSwapMarkets (params?)

calculatePricePrecision

Helper function to calculate the Hyperliquid DECIMAL_PLACES price precision

Kind: instance method of hyperliquid
Returns: int - The calculated price precision

ParamTypeDescription
pricefloatthe price to use in the calculation
amountPrecisionintthe amountPrecision to use in the calculation
maxDecimalsintthe maxDecimals to use in the calculation
hyperliquid.calculatePricePrecision (price, amountPrecision, maxDecimals)

fetchSpotMarkets

retrieves data on all spot markets for hyperliquid

Kind: instance method of hyperliquid
Returns: Array<object> - an array of objects representing market data

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.fetchSpotMarkets (params?)

fetchBalance

query for balance and get the amount of funds available for trading or funds locked in orders

Kind: instance method of hyperliquid
Returns: object - a balance structure

See

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNouser address, will default to this.walletAddress if not provided
params.typestringNowallet type, ['spot', 'swap'], defaults to swap
params.marginModestringNo'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null
params.dexstringNofor hip3 markets, the dex name, eg: 'xyz'
params.subAccountAddressstringNosub account user address
params.enableUnifiedMarginbooleanNoenable unified margin, CCXT tries to auto-detects this value but you can override it
hyperliquid.fetchBalance (params?)

fetchOrderBook

fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data

Kind: instance method of hyperliquid
Returns: object - an order book structure

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#l2-book-snapshot

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the order book for
limitintNothe maximum amount of order book entries to return
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.fetchOrderBook (symbol, limit?, params?)

fetchTickers

fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market

Kind: instance method of hyperliquid
Returns: object - a dictionary of ticker structures

See

ParamTypeRequiredDescription
symbolsArray<string>Nounified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
paramsobjectNoextra parameters specific to the exchange API endpoint
params.typestringNo'spot' or 'swap', by default fetches both
params.hip3booleanNoset to true to fetch hip3 markets only
hyperliquid.fetchTickers (symbols?, params?)

fetchFundingRate

fetch the current funding rate for a symbol - hyperliquid only offers a bulk endpoint, so this filters the result of fetchFundingRates

Kind: instance method of hyperliquid
Returns: object - a funding rate structure

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc

ParamTypeRequiredDescription
symbolstringYesunified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.fetchFundingRate (symbol, params?)

fetchFundingRates

retrieves data on all swap markets for hyperliquid

Kind: instance method of hyperliquid
Returns: Array<object> - an array of objects representing market data

See

ParamTypeRequiredDescription
symbolsArray<string>Nolist of unified market symbols
paramsobjectNoextra parameters specific to the exchange API endpoint
params.dexstringNoperp dex name for hip3 markets, eg: 'xyz', inferred from the symbols if not provided
params.methodstringNo'metaAndAssetCtxs' (default) for the current funding rates, or 'predictedFundings' for the predicted rate and time of the next funding, only available for the main dex, the predictions for other venues are in info
hyperliquid.fetchFundingRates (symbols?, params?)

fetchOHLCV

fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market

Kind: instance method of hyperliquid
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#candle-snapshot

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch OHLCV data for
timeframestringYesthe length of time each candle represents, support '1m', '15m', '1h', '1d'
sinceintNotimestamp in ms of the earliest candle to fetch
limitintNothe maximum amount of candles to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest candle to fetch
hyperliquid.fetchOHLCV (symbol, timeframe, since?, limit?, params?)

fetchTrades

get the list of most recent trades for a particular symbol

Kind: instance method of hyperliquid
Returns: Array<Trade> - a list of trade structures

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch trades for
limitintNothe maximum number of trades structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest trade
params.addressstringNowallet address that made trades
params.userstringNowallet address that made trades
params.subAccountAddressstringNosub account user address
hyperliquid.fetchTrades (symbol, since?, limit?, params?)

isUnifiedEnabled

returns enableUnifiedMargin so the user can check if unified account is enabled

Kind: instance method of hyperliquid
Returns: bool - enableUnifiedMargin

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-abstraction-state

ParamTypeRequiredDescription
methodstringYesthe method for which we want to check if unified margin is enabled, this is used to check options for specific methods (e.g. fetchBalance can have a specific option to enable unified margin)
addressstringNothe wallet address to query; defaults to the configured walletAddress
shouldRefreshbooleanNoforce a fresh request instead of returning the cached value
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.isUnifiedEnabled (method, address?, shouldRefresh?, params?)

setUserAbstraction

set user abstraction mode

Kind: instance method of hyperliquid
Returns: dictionary response from the exchange

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#set-user-abstraction

ParamTypeRequiredDescription
abstractionstringYesone of the strings ["disabled", "unifiedAccount", "portfolioMargin"],
paramsobjectNo
params.typestringNo'userSetAbstraction' or 'agentSetAbstraction' default is 'userSetAbstraction'
hyperliquid.setUserAbstraction (abstraction, params?)

enableUserDexAbstraction

If set, actions on HIP-3 perps will automatically transfer collateral from validator-operated USDC perps balance for HIP-3 DEXs where USDC is the collateral token, and spot otherwise

Kind: instance method of hyperliquid
Returns: dictionary response from the exchange

ParamTypeRequiredDescription
enabledbooleanYeswhether to enable user dex abstraction
paramsobjectNoextra parameters specific to the exchange API endpoint
params.typestringNo'userDexAbstraction' or 'agentEnableDexAbstraction' default is 'userDexAbstraction'
hyperliquid.enableUserDexAbstraction (enabled, params?)

setAgentAbstraction

set agent abstraction mode

Kind: instance method of hyperliquid
Returns: dictionary response from the exchange

ParamTypeRequiredDescription
abstractionstringYesone of the strings ["i", "u", "p"] where "i" is "disabled", "u" is "unifiedAccount", and "p" is "portfolioMargin"
paramsobjectNo
hyperliquid.setAgentAbstraction (abstraction, params?)

createOrder

create a trade order

Kind: instance method of hyperliquid
Returns: object - an order structure

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to create an order in
typestringYes'market' or 'limit'
sidestringYes'buy' or 'sell'
amountfloatYeshow much of currency you want to trade in units of base currency
pricefloatNothe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
paramsobjectNoextra parameters specific to the exchange API endpoint
params.timeInForcestringNo'Gtc', 'Ioc', 'Alo'
params.postOnlyboolNotrue or false whether the order is post-only
params.reduceOnlyboolNotrue or false whether the order is reduce-only
params.triggerPricefloatNoThe price at which a trigger order is triggered at
params.clientOrderIdstringNoclient order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
params.slippagestringNothe slippage for market order
params.vaultAddressstringNothe vault address for order
params.subAccountAddressstringNosub account user address
params.priorityFeeintNothe order priority fee rate in units of 1e-8 (10000 = 1 bp), only for IOC orders (market orders included) or post-only orders that are not reduce-only, paid in HYPE from the undelegated staking balance
params.trailingPercentfloatNoswap only the percent to trail away from the best mark price, the order is sent as a native trailing stop that executes as a market order
params.trailingAmountfloatNoswap only the quote amount to trail away from the best mark price, the order is sent as a native trailing stop that executes as a market order
params.trailingTriggerPricefloatNoswap only the mark price at which a trailing order starts tracking, tracking starts immediately if omitted
params.expiresAfterintNotimestamp in ms after which the request is rejected by the exchange
hyperliquid.createOrder (symbol, type, side, amount, price?, params?)

createTwapOrder

create a trade order that is executed as a TWAP order over a specified duration.

Kind: instance method of hyperliquid
Returns: object - an order structure

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to create an order in
sidestringYes'buy' or 'sell'
amountfloatYeshow much of currency you want to trade in units of base currency
durationintYesthe duration of the TWAP order in milliseconds
paramsobjectNoextra parameters specific to the exchange API endpoint
params.randomizeboolNowhether to randomize the time intervals of the TWAP order slices (default is false, meaning equal intervals)
params.reduceOnlyboolNotrue or false whether the order is reduce-only
params.expiresAfterintNotimestamp in ms after which the request is rejected by the exchange
params.vaultAddressstringNothe vault address for order
hyperliquid.createTwapOrder (symbol, side, amount, duration, params?)

createOrders

create a list of trade orders

Kind: instance method of hyperliquid
Returns: object - an order structure

See

ParamTypeRequiredDescription
ordersArrayYeslist of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
paramsobjectNoextra parameters specific to the exchange API endpoint
params.priorityFeeintNothe order priority fee rate in units of 1e-8 (10000 = 1 bp) applied to the whole request, only when every order is IOC (market orders included) or every order is post-only and not reduce-only, paid in HYPE from the undelegated staking balance
params.expiresAfterintNotimestamp in ms after which the request is rejected by the exchange
hyperliquid.createOrders (orders, params?)

createOrdersRequest

create a list of trade orders

Kind: instance method of hyperliquid
Returns: object - an order structure

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order

ParamTypeDescription
ordersArraylist of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
hyperliquid.createOrdersRequest (orders)

cancelOrder

cancels an open order

Kind: instance method of hyperliquid
Returns: object - An order structure

See

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.clientOrderIdstringNoclient order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
params.vaultAddressstringNothe vault address for order
params.subAccountAddressstringNosub account user address
params.twapbooleanNowhether the order to cancel is a twap order, (default is false)
params.fastbooleanNowhether to send the cancel with the fast flag, rejected for trigger orders, prioritized in the mempool in a future network upgrade, (default is false)
params.expiresAfterintNotimestamp in ms after which the request is rejected by the exchange
hyperliquid.cancelOrder (id, symbol, params?)

cancelOrders

cancel multiple orders

Kind: instance method of hyperliquid
Returns: object - an list of order structures

See

ParamTypeRequiredDescription
idsArray<string>Yesorder ids
symbolstringNounified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
params.clientOrderIdstring, Array<string>Noclient order ids, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
params.vaultAddressstringNothe vault address
params.subAccountAddressstringNosub account user address
params.fastbooleanNowhether to send the cancel with the fast flag, rejected for trigger orders, prioritized in the mempool in a future network upgrade, (default is false)
params.expiresAfterintNotimestamp in ms after which the request is rejected by the exchange
hyperliquid.cancelOrders (ids, symbol?, params?)

cancelTwapOrder

cancels a running twap order

Kind: instance method of hyperliquid
Returns: object - An order structure

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-a-twap-order

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.expiresAfterintNotimestamp in ms after which the request is rejected by the exchange
params.vaultAddressstringNothe vault address for order
hyperliquid.cancelTwapOrder (id, symbol, params?)

cancelOrdersRequest

build the request payload for cancelling multiple orders

Kind: instance method of hyperliquid
Returns: object - the raw request object to be sent to the exchange

See

ParamTypeRequiredDescription
idsArray<string>Yesorder ids
symbolstringYesunified market symbol
paramsobjectNo
params.fastbooleanNowhether to send the cancel with the fast flag, rejected for trigger orders, (default is false)
hyperliquid.cancelOrdersRequest (ids, symbol, params?)

cancelOrdersForSymbols

cancel multiple orders for multiple symbols

Kind: instance method of hyperliquid
Returns: object - an list of order structures

See

ParamTypeRequiredDescription
ordersArray<CancellationRequest>Yeseach order should contain the parameters required by cancelOrder namely id and symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
paramsobjectNoextra parameters specific to the exchange API endpoint
params.vaultAddressstringNothe vault address
params.subAccountAddressstringNosub account user address
params.fastbooleanNowhether to send the cancel with the fast flag, rejected for trigger orders, prioritized in the mempool in a future network upgrade, (default is false)
params.expiresAfterintNotimestamp in ms after which the request is rejected by the exchange
hyperliquid.cancelOrdersForSymbols (orders, params?)

cancelAllOrdersAfter

dead man's switch, cancel all orders after the given timeout

Kind: instance method of hyperliquid
Returns: object - the api result

ParamTypeRequiredDescription
timeoutnumberYestime in milliseconds, 0 represents cancel the timer
paramsobjectNoextra parameters specific to the exchange API endpoint
params.vaultAddressstringNothe vault address
params.subAccountAddressstringNosub account user address
params.expiresAfterintNotimestamp in ms after which the request is rejected by the exchange
hyperliquid.cancelAllOrdersAfter (timeout, params?)

editOrder

edit a trade order

Kind: instance method of hyperliquid
Returns: object - an order structure

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-multiple-orders

ParamTypeRequiredDescription
idstringYescancel order id
symbolstringYesunified symbol of the market to create an order in
typestringYes'market' or 'limit'
sidestringYes'buy' or 'sell'
amountfloatYeshow much of currency you want to trade in units of base currency
pricefloatNothe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
paramsobjectNoextra parameters specific to the exchange API endpoint
params.timeInForcestringNo'Gtc', 'Ioc', 'Alo'
params.postOnlyboolNotrue or false whether the order is post-only
params.reduceOnlyboolNotrue or false whether the order is reduce-only
params.triggerPricefloatNoThe price at which a trigger order is triggered at
params.clientOrderIdstringNoclient order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
params.vaultAddressstringNothe vault address for order
params.subAccountAddressstringNosub account user address
params.expiresAfterintNotimestamp in ms after which the request is rejected by the exchange
hyperliquid.editOrder (id, symbol, type, side, amount, price?, params?)

editOrders

edit a list of trade orders

Kind: instance method of hyperliquid
Returns: object - an order structure

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-multiple-orders

ParamTypeRequiredDescription
ordersArrayYeslist of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
paramsobjectNoextra parameters specific to the exchange API endpoint
params.expiresAfterintNotimestamp in ms after which the request is rejected by the exchange
hyperliquid.editOrders (orders, params?)

createVault

creates a value

Kind: instance method of hyperliquid
Returns: object - the api result

ParamTypeRequiredDescription
namestringYesThe name of the vault
descriptionstringYesThe description of the vault
initialUsdnumberYesThe initialUsd of the vault
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.createVault (name, description, initialUsd, params?)

fetchFundingRateHistory

fetches historical funding rate prices

Kind: instance method of hyperliquid
Returns: Array<object> - a list of funding rate structures

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-historical-funding-rates

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the funding rate history for
sinceintNotimestamp in ms of the earliest funding rate to fetch
limitintNothe maximum amount of funding rate structures to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest funding rate
hyperliquid.fetchFundingRateHistory (symbol, since?, limit?, params?)

fetchOpenOrders

fetch all unfilled currently open orders

Kind: instance method of hyperliquid
Returns: Array<Order> - a list of order structures

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-open-orders

ParamTypeRequiredDescription
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch open orders for
limitintNothe maximum number of open orders structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNouser address, will default to this.walletAddress if not provided
params.methodstringNo'openOrders' or 'frontendOpenOrders' default is 'frontendOpenOrders'
params.subAccountAddressstringNosub account user address
params.dexstringNoperp dex name. default is null
hyperliquid.fetchOpenOrders (symbol, since?, limit?, params?)

fetchClosedOrders

fetch all unfilled currently closed orders

Kind: instance method of hyperliquid
Returns: Array<Order> - a list of order structures

ParamTypeRequiredDescription
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch open orders for
limitintNothe maximum number of open orders structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNouser address, will default to this.walletAddress if not provided
hyperliquid.fetchClosedOrders (symbol, since?, limit?, params?)

fetchCanceledOrders

fetch all canceled orders

Kind: instance method of hyperliquid
Returns: Array<Order> - a list of order structures

ParamTypeRequiredDescription
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch open orders for
limitintNothe maximum number of open orders structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNouser address, will default to this.walletAddress if not provided
hyperliquid.fetchCanceledOrders (symbol, since?, limit?, params?)

fetchCanceledAndClosedOrders

fetch all closed and canceled orders

Kind: instance method of hyperliquid
Returns: Array<Order> - a list of order structures

ParamTypeRequiredDescription
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch open orders for
limitintNothe maximum number of open orders structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNouser address, will default to this.walletAddress if not provided
hyperliquid.fetchCanceledAndClosedOrders (symbol, since?, limit?, params?)

fetchOrders

fetch all orders

Kind: instance method of hyperliquid
Returns: Array<Order> - a list of order structures

ParamTypeRequiredDescription
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch open orders for
limitintNothe maximum number of open orders structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNouser address, will default to this.walletAddress if not provided
params.subAccountAddressstringNosub account user address
params.dexstringNoperp dex name. default is null
hyperliquid.fetchOrders (symbol, since?, limit?, params?)

fetchOrder

fetches information on an order made by the user

Kind: instance method of hyperliquid
Returns: object - An order structure

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-order-status-by-oid-or-cloid

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.clientOrderIdstringNoclient order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
params.userstringNouser address, will default to this.walletAddress if not provided
params.subAccountAddressstringNosub account user address
hyperliquid.fetchOrder (id, symbol, params?)

fetchMyTrades

fetch all trades made by the user

Kind: instance method of hyperliquid
Returns: Array<Trade> - a list of trade structures

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch trades for
limitintNothe maximum number of trades structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest trade
params.subAccountAddressstringNosub account user address
params.twapbooleanNoset to true to fetch the fills of twap orders instead, the exchange returns the 2000 most recent ones and ignores since and until
hyperliquid.fetchMyTrades (symbol, since?, limit?, params?)

fetchMyLiquidations

retrieves the users liquidated positions

Kind: instance method of hyperliquid
Returns: object - an array of liquidation structures

See

ParamTypeRequiredDescription
symbolstringNounified CCXT market symbol
sinceintNothe earliest time in ms to fetch liquidations for
limitintNothe maximum number of liquidation structures to retrieve
paramsobjectNoexchange specific parameters
params.untilintNotimestamp in ms of the latest liquidation
params.userstringNouser address, will default to this.walletAddress if not provided
hyperliquid.fetchMyLiquidations (symbol?, since?, limit?, params?)

fetchPosition

fetch data on an open position

Kind: instance method of hyperliquid
Returns: object - a position structure

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market the position is held in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNouser address, will default to this.walletAddress if not provided
hyperliquid.fetchPosition (symbol, params?)

fetchPositions

fetch all open positions

Kind: instance method of hyperliquid
Returns: Array<object> - a list of position structure

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary

ParamTypeRequiredDescription
symbolsArray<string>Nolist of unified market symbols
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNouser address, will default to this.walletAddress if not provided
params.subAccountAddressstringNosub account user address
params.dexstringNoperp dex name, eg: XYZ
hyperliquid.fetchPositions (symbols?, params?)

setMarginMode

set margin mode (symbol)

Kind: instance method of hyperliquid
Returns: object - response from the exchange

ParamTypeRequiredDescription
marginModestringYesmargin mode must be either [isolated, cross]
symbolstringYesunified market symbol of the market the position is held in, default is undefined
paramsobjectNoextra parameters specific to the exchange API endpoint
params.leveragestringNothe rate of leverage, is required if setting trade mode (symbol)
params.vaultAddressstringNothe vault address
params.subAccountAddressstringNosub account user address
params.expiresAfterintNotimestamp in ms after which the request is rejected by the exchange
hyperliquid.setMarginMode (marginMode, symbol, params?)

fetchLeverageTiers

retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes

Kind: instance method of hyperliquid
Returns: object - a dictionary of leverage tiers structures, indexed by market symbols

See

ParamTypeRequiredDescription
symbolsArray<string>Nolist of unified market symbols, all symbols must belong to the same dex for hip3 markets
paramsobjectNoextra parameters specific to the exchange API endpoint
params.dexstringNothe hip3 dex to fetch the tiers from, inferred from the symbols when omitted
hyperliquid.fetchLeverageTiers (symbols?, params?)

fetchLeverage

fetch the set leverage and margin mode for a swap market

Kind: instance method of hyperliquid
Returns: object - a leverage structure

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-active-asset-data

ParamTypeRequiredDescription
symbolstringYesunified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNouser address, will default to this.walletAddress if not provided
hyperliquid.fetchLeverage (symbol, params?)

setLeverage

set the level of leverage for a market

Kind: instance method of hyperliquid
Returns: object - response from the exchange

ParamTypeRequiredDescription
leveragefloatYesthe rate of leverage
symbolstringYesunified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
params.marginModestringNomargin mode must be either [isolated, cross], default is cross
params.expiresAfterintNotimestamp in ms after which the request is rejected by the exchange
hyperliquid.setLeverage (leverage, symbol, params?)

addMargin

add margin

Kind: instance method of hyperliquid
Returns: object - a margin structure

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-isolated-margin

ParamTypeRequiredDescription
symbolstringYesunified market symbol
amountfloatYesamount of margin to add
paramsobjectNoextra parameters specific to the exchange API endpoint
params.vaultAddressstringNothe vault address
params.subAccountAddressstringNosub account user address
params.expiresAfterintNotimestamp in ms after which the request is rejected by the exchange
hyperliquid.addMargin (symbol, amount, params?)

reduceMargin

remove margin from a position

Kind: instance method of hyperliquid
Returns: object - a margin structure

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-isolated-margin

ParamTypeRequiredDescription
symbolstringYesunified market symbol
amountfloatYesthe amount of margin to remove
paramsobjectNoextra parameters specific to the exchange API endpoint
params.vaultAddressstringNothe vault address
params.subAccountAddressstringNosub account user address
params.expiresAfterintNotimestamp in ms after which the request is rejected by the exchange
hyperliquid.reduceMargin (symbol, amount, params?)

transfer

transfer currency internally between wallets on the same account

Kind: instance method of hyperliquid
Returns: object - a transfer structure

See

ParamTypeRequiredDescription
codestringYesunified currency code
amountfloatYesamount to transfer
fromAccountstringYesaccount to transfer from spot, swap, main or a sub-account address
toAccountstringYesaccount to transfer to swap, spot, main or a sub-account address
paramsobjectNoextra parameters specific to the exchange API endpoint
params.vaultAddressstringNospot <> swap only, moves the balance inside this vault or sub-account instead of the main account
params.typestringNomain <> sub-account only, 'spot' moves the spot ledger instead of the perp ledger
params.methodstringNomain <> sub-account only, 'sendAsset' forces the unified-account route, 'subAccountTransfer' forces the legacy sub-account actions; defaults to sendAsset when the account abstraction is unifiedAccount
params.enableUnifiedMarginbooleanNomain <> sub-account only, skips the abstraction lookup and states whether the account is unified
params.sourceDexstringNosendAsset only, perp dex to move from, '' for the default USDC perp dex or 'spot', defaults to 'spot'
params.destinationDexstringNosendAsset only, perp dex to move to, '' for the default USDC perp dex or 'spot', defaults to 'spot'
params.userstringNosendAsset only, the master wallet address, defaults to walletAddress
hyperliquid.transfer (code, amount, fromAccount, toAccount, params?)

withdraw

make a withdrawal (only support USDC)

Kind: instance method of hyperliquid
Returns: object - a transaction structure

See

ParamTypeRequiredDescription
codestringYesunified currency code
amountfloatYesthe amount to withdraw
addressstringYesthe address to withdraw to
paramsobjectNoextra parameters specific to the exchange API endpoint
params.tagstringNomemo / destination tag, required for currencies in options['withdrawTagRequiredCurrencies']
params.vaultAddressstringNovault address withdraw from
hyperliquid.withdraw (code, amount, address, params?)

fetchTradingFee

fetch the trading fees for a market

Kind: instance method of hyperliquid
Returns: object - a fee structure

ParamTypeRequiredDescription
symbolstringYesunified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNouser address, will default to this.walletAddress if not provided
params.subAccountAddressstringNosub account user address
hyperliquid.fetchTradingFee (symbol, params?)

fetchLedger

fetch the history of changes, actions done by the user or operations that altered the balance of the user

Kind: instance method of hyperliquid
Returns: object - a ledger structure

ParamTypeRequiredDescription
codestringNounified currency code
sinceintNotimestamp in ms of the earliest ledger entry
limitintNomax number of ledger entries to return
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest ledger entry
params.subAccountAddressstringNosub account user address
hyperliquid.fetchLedger (code?, since?, limit?, params?)

fetchDeposits

fetch all deposits made to an account

Kind: instance method of hyperliquid
Returns: Array<object> - a list of transaction structures

ParamTypeRequiredDescription
codestringYesunified currency code
sinceintNothe earliest time in ms to fetch deposits for
limitintNothe maximum number of deposits structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNothe latest time in ms to fetch withdrawals for
params.subAccountAddressstringNosub account user address
params.vaultAddressstringNovault address
hyperliquid.fetchDeposits (code, since?, limit?, params?)

fetchWithdrawals

fetch all withdrawals made from an account

Kind: instance method of hyperliquid
Returns: Array<object> - a list of transaction structures

ParamTypeRequiredDescription
codestringYesunified currency code
sinceintNothe earliest time in ms to fetch withdrawals for
limitintNothe maximum number of withdrawals structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNothe latest time in ms to fetch withdrawals for
params.subAccountAddressstringNosub account user address
params.vaultAddressstringNovault address
hyperliquid.fetchWithdrawals (code, since?, limit?, params?)

fetchOpenInterests

Retrieves the open interest for a list of symbols

Kind: instance method of hyperliquid
Returns: object - an open interest structure/docs/manual#open-interest-structure

ParamTypeRequiredDescription
symbolsArray<string>NoUnified CCXT market symbol
paramsobjectNoexchange specific parameters
params.dexstringNoperp dex name for hip3 markets, eg: 'xyz', inferred from the symbols if not provided
hyperliquid.fetchOpenInterests (symbols?, params?)

fetchOpenInterest

retrieves the open interest of a contract trading pair

Kind: instance method of hyperliquid
Returns: object - an open interest structure

ParamTypeRequiredDescription
symbolstringYesunified CCXT market symbol
paramsobjectNoexchange specific parameters
hyperliquid.fetchOpenInterest (symbol, params?)

fetchFundingHistory

fetch the history of funding payments paid and received on this account

Kind: instance method of hyperliquid
Returns: object - a funding history structure

ParamTypeRequiredDescription
symbolstringNounified market symbol
sinceintNothe earliest time in ms to fetch funding history for
limitintNothe maximum number of funding history structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.subAccountAddressstringNosub account user address
hyperliquid.fetchFundingHistory (symbol?, since?, limit?, params?)

reserveRequestWeight

Instead of trading to increase the address based rate limits, this action allows reserving additional actions for 0.0005 USDC per request. The cost is paid from the Perps balance.

Kind: instance method of hyperliquid
Returns: object - a response object

ParamTypeRequiredDescription
weightnumberYesthe weight to reserve, 1 weight = 1 action, 0.0005 USDC per action
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.reserveRequestWeight (weight, params?)

approveAgent

approves an API wallet (agent) that can trade on behalf of the account but can not withdraw, the request must be signed with the private key of the main wallet, not with the one of an API wallet

Kind: instance method of hyperliquid
Returns: object - a response object

See

ParamTypeRequiredDescription
agentAddressstringYesthe address of the API wallet to approve
agentNamestringNothe name of the API wallet, an account has a single unnamed API wallet, which is replaced when another unnamed one is approved, and up to 3 named ones, append ' valid_until ' to the name to set an expiration of at most 180 days
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.approveAgent (agentAddress, agentName?, params?)

noop

sends an action that does nothing but marks the nonce as used, which invalidates a pending request sent with the same nonce, it can be a more effective way to cancel in-flight orders than a cancel

Kind: instance method of hyperliquid
Returns: object - a response object

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#invalidate-pending-nonce-noop

ParamTypeRequiredDescription
nonceintNothe nonce to mark as used, a new one is generated when omitted
paramsobjectNoextra parameters specific to the exchange API endpoint
params.vaultAddressstringNothe vault or sub-account address to send the action for
hyperliquid.noop (nonce?, params?)

claimRewards

claims the rewards earned by the account

Kind: instance method of hyperliquid
Returns: object - a response object

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#claim-rewards

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.claimRewards (params?)

usdSend

sends USDC from the perp balance to another address on hyperliquid, it does not go through the EVM bridge, the request must be signed with the private key of the main wallet

Kind: instance method of hyperliquid
Returns: object - a response object

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#core-usdc-transfer

ParamTypeRequiredDescription
amountfloatYesthe amount of USDC to send
addressstringYesthe address to send to
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.usdSend (amount, address, params?)

spotSend

sends a spot asset to another address on hyperliquid, it does not go through the EVM bridge, the request must be signed with the private key of the main wallet

Kind: instance method of hyperliquid
Returns: object - a response object

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#core-spot-transfer

ParamTypeRequiredDescription
codestringYesunified currency code of the asset to send
amountfloatYesthe amount to send
addressstringYesthe address to send to
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.spotSend (code, amount, address, params?)

stakingDeposit

moves HYPE from the spot balance into the staking balance, where it can be delegated to validators or used to pay priority fees, the request must be signed with the private key of the main wallet

Kind: instance method of hyperliquid
Returns: object - a response object

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#deposit-into-staking

ParamTypeRequiredDescription
amountfloatYesthe amount of HYPE to move into staking
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.stakingDeposit (amount, params?)

stakingWithdraw

moves HYPE from the staking balance back to the spot balance, the amount goes through a 7 day unstaking queue, the request must be signed with the private key of the main wallet

Kind: instance method of hyperliquid
Returns: object - a response object

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#withdraw-from-staking

ParamTypeRequiredDescription
amountfloatYesthe amount of HYPE to move out of staking
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.stakingWithdraw (amount, params?)

tokenDelegate

delegates HYPE of the staking balance to a validator, or undelegates it, a delegation is locked for 1 day, the request must be signed with the private key of the main wallet

Kind: instance method of hyperliquid
Returns: object - a response object

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#delegate-or-undelegate-stake-from-validator

ParamTypeRequiredDescription
validatorstringYesthe address of the validator
amountfloatYesthe amount of HYPE to delegate or undelegate
isUndelegatebooleanNotrue to undelegate, false (default) to delegate
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.tokenDelegate (validator, amount, isUndelegate?, params?)

fetchApprovedBuilders

fetch the addresses of the builders the user approved a builder fee for

Kind: instance method of hyperliquid
Returns: Array<string> - a list of builder addresses

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-approved-builders-for-user

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNouser address, will default to this.walletAddress if not provided
hyperliquid.fetchApprovedBuilders (params?)

fetchVaultDetails

fetch the details of a vault, its leader, description, portfolio history, apr and followers

Kind: instance method of hyperliquid
Returns: object - the vault details as returned by the exchange

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-details-for-a-vault

ParamTypeRequiredDescription
vaultAddressstringYesthe address of the vault
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNoa user address, when provided the response includes the state of that user as a follower of the vault
hyperliquid.fetchVaultDetails (vaultAddress, params?)

fetchStakingDelegations

fetch the amounts of HYPE the user delegated to each validator

Kind: instance method of hyperliquid
Returns: Array<object> - a list of delegations as returned by the exchange

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-staking-delegations

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNouser address, will default to this.walletAddress if not provided
hyperliquid.fetchStakingDelegations (params?)

fetchStakingSummary

fetch the staking balances of the user, the undelegated amount is the one priority fees are paid from

Kind: instance method of hyperliquid
Returns: object - the staking summary as returned by the exchange

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-staking-summary

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNouser address, will default to this.walletAddress if not provided
hyperliquid.fetchStakingSummary (params?)

fetchStakingHistory

fetch the history of the staking deposits, withdrawals, delegations and undelegations of the user

Kind: instance method of hyperliquid
Returns: Array<object> - a list of staking events as returned by the exchange

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-staking-history

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNouser address, will default to this.walletAddress if not provided
hyperliquid.fetchStakingHistory (params?)

fetchStakingRewards

fetch the staking rewards earned by the user

Kind: instance method of hyperliquid
Returns: Array<object> - a list of staking rewards as returned by the exchange

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-staking-rewards

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNouser address, will default to this.walletAddress if not provided
hyperliquid.fetchStakingRewards (params?)

fetchAccounts

fetch the sub-accounts of a master account

Kind: instance method of hyperliquid
Returns: Array<object> - a list of account structures

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-subaccounts

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNothe master account address, will default to this.walletAddress if not provided
hyperliquid.fetchAccounts (params?)

fetchCrossBorrowRates

fetch the borrow interest rates of all currencies of the borrow/lend protocol

Kind: instance method of hyperliquid
Returns: object - a list of borrow rate structures

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-all-borrow-lend-reserve-states

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.fetchCrossBorrowRates (params?)

fetchCrossBorrowRate

fetch the borrow interest rate of a currency of the borrow/lend protocol

Kind: instance method of hyperliquid
Returns: object - a borrow rate structure

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-borrow-lend-reserve-state

ParamTypeRequiredDescription
codestringYesunified currency code
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.fetchCrossBorrowRate (code, params?)

fetchBorrowInterest

fetch the interest owed by the user for the currencies borrowed from the borrow/lend protocol

Kind: instance method of hyperliquid
Returns: Array<object> - a list of borrow interest structures

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-borrow-lend-user-state

ParamTypeRequiredDescription
codestringNounified currency code
symbolstringNonot used by hyperliquid fetchBorrowInterest
sinceintNonot used by hyperliquid fetchBorrowInterest, the exchange returns the current state only
limitintNothe maximum number of structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNouser address, will default to this.walletAddress if not provided
hyperliquid.fetchBorrowInterest (code?, symbol?, since?, limit?, params?)

createSubAccount

creates a sub-account under the main account

Kind: instance method of hyperliquid
Returns: object - a response object

ParamTypeRequiredDescription
namestringYesthe name of the sub-account
paramsobjectNoextra parameters specific to the exchange API endpoint
params.expiresAfterintNotime in ms after which the sub-account will expire
hyperliquid.createSubAccount (name, params?)

createOrdersWs

create a list of trade orders using WebSocket post request

Kind: instance method of hyperliquid
Returns: object - an order structure

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order

ParamTypeRequiredDescription
ordersArrayYeslist of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.createOrdersWs (orders, params?)

createOrderWs

create a trade order using WebSocket post request

Kind: instance method of hyperliquid
Returns: object - an order structure

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to create an order in
typestringYes'market' or 'limit'
sidestringYes'buy' or 'sell'
amountfloatYeshow much of currency you want to trade in units of base currency
pricefloatNothe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
paramsobjectNoextra parameters specific to the exchange API endpoint
params.timeInForcestringNo'Gtc', 'Ioc', 'Alo'
params.postOnlyboolNotrue or false whether the order is post-only
params.reduceOnlyboolNotrue or false whether the order is reduce-only
params.triggerPricefloatNoThe price at which a trigger order is triggered at
params.clientOrderIdstringNoclient order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
params.slippagestringNothe slippage for market order
params.vaultAddressstringNothe vault address for order
hyperliquid.createOrderWs (symbol, type, side, amount, price?, params?)

editOrderWs

edit a trade order

Kind: instance method of hyperliquid
Returns: object - an order structure

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-multiple-orders

ParamTypeRequiredDescription
idstringYescancel order id
symbolstringYesunified symbol of the market to create an order in
typestringYes'market' or 'limit'
sidestringYes'buy' or 'sell'
amountfloatYeshow much of currency you want to trade in units of base currency
pricefloatNothe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
paramsobjectNoextra parameters specific to the exchange API endpoint
params.timeInForcestringNo'Gtc', 'Ioc', 'Alo'
params.postOnlyboolNotrue or false whether the order is post-only
params.reduceOnlyboolNotrue or false whether the order is reduce-only
params.triggerPricefloatNoThe price at which a trigger order is triggered at
params.clientOrderIdstringNoclient order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
params.vaultAddressstringNothe vault address for order
hyperliquid.editOrderWs (id, symbol, type, side, amount, price?, params?)

cancelOrdersWs

cancel multiple orders using WebSocket post request

Kind: instance method of hyperliquid
Returns: Array<object> - a list of order structures

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/post-requests

ParamTypeRequiredDescription
idsArray<string>Yeslist of order ids to cancel
symbolstringYesunified symbol of the market the orders were made in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.clientOrderIdArray<string>Nolist of client order ids to cancel instead of order ids
params.vaultAddressstringNothe vault address for order cancellation
hyperliquid.cancelOrdersWs (ids, symbol, params?)

cancelOrderWs

cancel a single order using WebSocket post request

Kind: instance method of hyperliquid
Returns: object - an order structure

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/post-requests

ParamTypeRequiredDescription
idstringYesorder id to cancel
symbolstringYesunified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.clientOrderIdstringNoclient order id to cancel instead of order id
params.vaultAddressstringNothe vault address for order cancellation
hyperliquid.cancelOrderWs (id, symbol, params?)

watchOrderBook

watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data

Kind: instance method of hyperliquid
Returns: object - an order book structure

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the order book for
limitintNothe maximum amount of order book entries to return
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.watchOrderBook (symbol, limit?, params?)

unWatchOrderBook

unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data

Kind: instance method of hyperliquid
Returns: object - A dictionary of order book structures

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the order book for
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.unWatchOrderBook (symbol, params?)

watchBidsAsks

watches the best bid & ask of a market

Kind: instance method of hyperliquid
Returns: object - a dictionary of ticker structures

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions

ParamTypeRequiredDescription
symbolsArray<string>Yesa list with a single unified symbol, the stream is per market so the method must be called once for each symbol to watch
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.watchBidsAsks (symbols, params?)

unWatchBidsAsks

unWatches the best bid & ask of a market

Kind: instance method of hyperliquid
Returns: object - the exchange response

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions

ParamTypeRequiredDescription
symbolsArray<string>Yesa list with a single unified symbol, the stream is per market so the method must be called once for each symbol to unwatch
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.unWatchBidsAsks (symbols, params?)

watchTicker

watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market

Kind: instance method of hyperliquid
Returns: object - a ticker structure

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.watchTicker (symbol, params?)

unWatchTicker

unWatches the price ticker stream of a specific market

Kind: instance method of hyperliquid
Returns: any - status of the unwatch request

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to stop watching the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.unWatchTicker (symbol, params?)

watchTickers

watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list

Kind: instance method of hyperliquid
Returns: object - a ticker structure

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions

ParamTypeRequiredDescription
symbolsArray<string>Yesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
params.dexstringNofor hip3 tokens subscription, eg: 'xyz' or 'flx`, if symbols are provided we will infer it from the first symbol's market
hyperliquid.watchTickers (symbols, params?)

unWatchTickers

unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list

Kind: instance method of hyperliquid
Returns: object - a ticker structure

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions

ParamTypeRequiredDescription
symbolsArray<string>Yesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.unWatchTickers (symbols, params?)

watchMyTrades

watches information on multiple trades made by the user

Kind: instance method of hyperliquid
Returns: Array<object> - a list of order structures

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market orders were made in
sinceintNothe earliest time in ms to fetch orders for
limitintNothe maximum number of order structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNouser address, will default to this.walletAddress if not provided
hyperliquid.watchMyTrades (symbol, since?, limit?, params?)

watchMyLiquidations

watch the private liquidations of a trading pair

Kind: instance method of hyperliquid
Returns: object - an array of liquidation structures

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions

ParamTypeRequiredDescription
symbolstringYesunified CCXT market symbol
sinceintNothe earliest time in ms to fetch liquidations for
limitintNothe maximum number of liquidation structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNouser address, will default to this.walletAddress if not provided
hyperliquid.watchMyLiquidations (symbol, since?, limit?, params?)

watchMyLiquidationsForSymbols

watch the private liquidations of a list of trading pairs

Kind: instance method of hyperliquid
Returns: object - an array of liquidation structures

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions

ParamTypeRequiredDescription
symbolsArray<string>Yeslist of unified market symbols
sinceintNothe earliest time in ms to fetch liquidations for
limitintNothe maximum number of liquidation structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNouser address, will default to this.walletAddress if not provided
hyperliquid.watchMyLiquidationsForSymbols (symbols, since?, limit?, params?)

unWatchMyTrades

unWatches information on multiple trades made by the user

Kind: instance method of hyperliquid
Returns: Array<object> - a list of order structures

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market orders were made in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNouser address, will default to this.walletAddress if not provided
hyperliquid.unWatchMyTrades (symbol, params?)

watchTrades

watches information on multiple trades made in a market

Kind: instance method of hyperliquid
Returns: Array<object> - a list of trade structures

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market trades were made in
sinceintNothe earliest time in ms to fetch trades for
limitintNothe maximum number of trade structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.watchTrades (symbol, since?, limit?, params?)

unWatchTrades

unWatches information on multiple trades made in a market

Kind: instance method of hyperliquid
Returns: Array<object> - a list of trade structures

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market trades were made in
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.unWatchTrades (symbol, params?)

watchOHLCV

watches historical candlestick data containing the open, high, low, close price, and the volume of a market

Kind: instance method of hyperliquid
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch OHLCV data for
timeframestringYesthe length of time each candle represents
sinceintNotimestamp in ms of the earliest candle to fetch
limitintNothe maximum amount of candles to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.watchOHLCV (symbol, timeframe, since?, limit?, params?)

unWatchOHLCV

watches historical candlestick data containing the open, high, low, close price, and the volume of a market

Kind: instance method of hyperliquid
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch OHLCV data for
timeframestringYesthe length of time each candle represents
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.unWatchOHLCV (symbol, timeframe, params?)

watchBalance

watch balance and get the amount of funds available for trading or funds locked in orders

Kind: instance method of hyperliquid
Returns: object - a balance structure

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
params.dexstringNofor hip3 tokens subscription, eg: 'xyz' or 'flx'
hyperliquid.watchBalance (params?)

unWatchBalance

unWatches balance

Kind: instance method of hyperliquid
Returns: object - status of the unwatch request

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.unWatchBalance (params?)

watchPositions

watch all open positions

Kind: instance method of hyperliquid
Returns: Array<object> - a list of position structure

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions

ParamTypeRequiredDescription
symbolsArray<string>Nolist of unified market symbols
sinceintNothe earliest time in ms to fetch positions for
limitintNothe maximum number of positions to retrieve
paramsobjectYesextra parameters specific to the exchange API endpoint
params.dexstringNofor hip3 tokens subscription, eg: 'xyz' or 'flx`, if symbols are provided we will infer it from the first symbol's market
hyperliquid.watchPositions (symbols?, since?, limit?, params)

unWatchPositions

unWatches all open positions

Kind: instance method of hyperliquid
Returns: object - status of the unwatch request

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions

ParamTypeRequiredDescription
symbolsArray<string>Nolist of unified market symbols
paramsobjectNoextra parameters specific to the exchange API endpoint
hyperliquid.unWatchPositions (symbols?, params?)

watchOrders

watches information on multiple orders made by the user

Kind: instance method of hyperliquid
Returns: Array<object> - a list of order structures

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market orders were made in
sinceintNothe earliest time in ms to fetch orders for
limitintNothe maximum number of order structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNouser address, will default to this.walletAddress if not provided
hyperliquid.watchOrders (symbol, since?, limit?, params?)

unWatchOrders

unWatches information on multiple orders made by the user

Kind: instance method of hyperliquid
Returns: Array<object> - a list of order structures

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market orders were made in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.userstringNouser address, will default to this.walletAddress if not provided
hyperliquid.unWatchOrders (symbol, params?)

On this page

hyperliquidfetchStatusfetchTimefetchCurrenciesfetchMarketsfetchHip3MarketsfetchSwapMarketscalculatePricePrecisionfetchSpotMarketsfetchBalancefetchOrderBookfetchTickersfetchFundingRatefetchFundingRatesfetchOHLCVfetchTradesisUnifiedEnabledsetUserAbstractionenableUserDexAbstractionsetAgentAbstractioncreateOrdercreateTwapOrdercreateOrderscreateOrdersRequestcancelOrdercancelOrderscancelTwapOrdercancelOrdersRequestcancelOrdersForSymbolscancelAllOrdersAftereditOrdereditOrderscreateVaultfetchFundingRateHistoryfetchOpenOrdersfetchClosedOrdersfetchCanceledOrdersfetchCanceledAndClosedOrdersfetchOrdersfetchOrderfetchMyTradesfetchMyLiquidationsfetchPositionfetchPositionssetMarginModefetchLeverageTiersfetchLeveragesetLeverageaddMarginreduceMargintransferwithdrawfetchTradingFeefetchLedgerfetchDepositsfetchWithdrawalsfetchOpenInterestsfetchOpenInterestfetchFundingHistoryreserveRequestWeightapproveAgentnoopclaimRewardsusdSendspotSendstakingDepositstakingWithdrawtokenDelegatefetchApprovedBuildersfetchVaultDetailsfetchStakingDelegationsfetchStakingSummaryfetchStakingHistoryfetchStakingRewardsfetchAccountsfetchCrossBorrowRatesfetchCrossBorrowRatefetchBorrowInterestcreateSubAccountcreateOrdersWscreateOrderWseditOrderWscancelOrdersWscancelOrderWswatchOrderBookunWatchOrderBookwatchBidsAsksunWatchBidsAskswatchTickerunWatchTickerwatchTickersunWatchTickerswatchMyTradeswatchMyLiquidationswatchMyLiquidationsForSymbolsunWatchMyTradeswatchTradesunWatchTradeswatchOHLCVunWatchOHLCVwatchBalanceunWatchBalancewatchPositionsunWatchPositionswatchOrdersunWatchOrders