Order book depth and slippage API for trading agents

How can an agent check order book depth and expected slippage before it trades?

Call GET /v1/markets/liquidity with a symbol and a size_usd. It walks the visible order book and returns best bid and ask, spread, USD depth within 0.1%, 0.5%, 1% and 2% of mid, and for your size the average and worst fill price, slippage in basis points and whether the visible book could fill it.

Example: a $100,000 order in BTC, both sides

Example call: markets-liquidity

Parameters

Liquidity parameters
ParamValuesDefault
symbolCrypto: BTC, ETH, SOL, XRP, HYPE, BNB, DOGE. US stocks: NVDA, AAPL, MSFT, GOOGL, AMZN, META, TSLA, AMD, MU, COIN, MSTR, HOOD, PLTR. Indexes: SP500, XYZ100. Commodities: GOLD, SILVER, CL (WTI crude), BRENTOIL (Brent crude).required
sidebuy walks the asks, sell walks the bids, both does bothboth
size_usdOrder size in USD of notional, 100 to 10,000,00010000

How to read the answer

  • spread_bps: the gap between best bid and best ask, in basis points of mid.
  • depth: USD on each side within 0.1%, 0.5%, 1% and 2% of mid.
  • buy and sell: avg_price, worst_price, slippage_bps against mid, levels_used, filled_usd, unfilled_usd and filled_fully.

The venue shows about 20 price levels a side. A size larger than that is reported as unfilled, not priced, and the venue may hold more depth than it shows. These are facts about the visible book, not advice.

Prices come from Hyperliquid perpetuals: crypto from the main Hyperliquid market, stocks, indexes and commodities from trade.xyz markets on Hyperliquid. They trade 24/7 and track the asset, but they are not exchange quotes, so a stock value can differ from the last Nasdaq or NYSE print, most of all outside US market hours.

FAQ

What is slippage in basis points?

How far the average fill price for your size is from the mid price, in hundredths of a percent. 10 bps is 0.1%.

Does the endpoint place orders?

No. It only reads the order book and computes what a fill would look like. Nothing is traded.

Can I use it for a Robinhood stock token on Robinhood Chain?

This endpoint reads Hyperliquid books. For Robinhood stock tokens on Robinhood Chain, use the stock-token premium endpoint, which quotes executable Uniswap prices for up to three sizes.

Updated 2026-11-16.