# Hyperliquid Orderbook Slippage

> Hyperliquid Orderbook Slippage is a paid API for AI agents from 1gateway.dev, paid per call via x402, $0.0036/call, status unknown (last checked 2026-12-03).

Returns real-time Hyperliquid order book depth, spread, bid/ask imbalance, and per-size slippage estimates for market orders on perp or HIP-3 markets.

## Facts

- Endpoint: GET https://1gateway.dev/v1/crypto/hyperliquid/orderbook?utm_source=zero.xyz
- Price: $0.0036/call
- Payment: x402
- Status: unknown
- Last checked: 2026-12-03
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/hyperliquid-orderbook-slippage-4feea241
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_QWbslpikQFiwvWpFkbp2J

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability hyperliquid-orderbook-slippage-4feea241
```

Example prompt: Before I place a $10,000 and $100,000 market buy of BTC on Hyperliquid, can you check the current order book and tell me the expected slippage and average fill prices for both sizes?

## When to prefer this

Use this endpoint when an agent needs to size a Hyperliquid market order and wants a pre-trade liquidity and slippage estimate, or when comparing order book depth and spread across coins on Hyperliquid specifically. It supports both standard perp symbols (BTC, ETH, kPEPE) and HIP-3 dex tokens (e.g. xyz:TSLA), making it the right choice for any Hyperliquid-specific microstructure analysis. Prefer over generic market data APIs when you need actionable per-size fill estimates rather than just top-of-book quotes.

## Known failure modes

- 400 error (before payment, no charge) if coin symbol is not listed or has been delisted on Hyperliquid
- 400 error if sizes_usd values are outside the 10–50,000,000 USD range or more than 5 sizes are provided
- 400 error if levels exceeds 20
- Stale data up to 3 seconds old due to caching
- Payment failure (402) if x402 payment not completed before request

## How this service works

Use when an agent sizes a Hyperliquid market order or compares liquidity. Input: coin (perp or HIP-3 xyz:TSLA), optional sizes_usd (up to 5, default 1000,10000,100000), levels (0-20). Output: JSON best bid/ask, spread bps, depth USD within 0.1/0.5/1/2%, imbalance, per size buy/sell average fill, worst price and slippage bps vs mid, top levels. Cached 3 s. Example: ?coin=BTC&sizes_usd=1000,10000

## Output

Returns a JSON object with: best bid and ask prices, spread in basis points, mid price, USD depth available within 0.1/0.5/1/2% of mid on each side, bid/ask imbalance ratio, per-requested-size estimates of average fill price, worst fill price, and slippage in bps for both buy and sell directions, plus top N raw order book levels (price, size, order count) for each side. Data is cached for 3 seconds.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "coin"
     ],
     "properties": {
      "coin": {
       "type": "string",
       "pattern": "^([a-z][a-z0-9]{0,9}:)?[A-Za-z0-9]{1,20}$",
       "description": "Hyperliquid perp symbol (BTC, ETH, kPEPE) or HIP-3 dex:COIN (xyz:TSLA). Not listed or delisted: 400…"
      },
      "levels": {
       "type": "integer",
       "default": 10,
       "maximum": 20,
       "minimum": 0,
       "description": "Book levels per side to return (0-20, default 10)"
      },
      "sizes_usd": {
       "type": "string",
       "pattern": "^[0-9.]+(,[0-9.]+){0,4}$",
       "maxLength": 80,
       "description": "1-5 comma-separated order notionals in USD, 10 to 50,000,000 (default 1000,10000,100000)"
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "coin",
      "dex",
      "as_of",
      "top",
      "visibleBook",
      "depth",
      "slippage",
      "levels"
     ],
     "properties": {
      "dex": {
       "type": "string"
      },
      "top": {
       "type": "object",
       "properties": {
        "ask": {
         "type": "integer"
        },
        "bid": {
         "type": "integer"
        },
        "mid": {
         "type": "number"
        },
        "spreadBps": {
         "type": "number"
        }
       },
       "additionalProperties": true
      },
      "coin": {
       "type": "string"
      },
      "as_of": {
       "type": "string"
      },
      "depth": {
       "type": "array",
       "items": {
        "type": "object",
        "additionalProperties": true
       }
      },
      "levels": {
       "type": "object",
       "properties": {
        "asks": {
         "type": "array"
        },
        "bids": {
         "type": "array"
        }
       },
       "additionalProperties": true
      },
      "slippage": {
       "type": "array",
       "items": {
 
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/hyperliquid-orderbook-slippage-4feea241/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 1gateway.dev](https://www.zero.xyz/host/1gateway.dev/llms.txt)
