# Hyperliquid Perpetuals L2 Order Book (BTC/ETH/SOL)

> Hyperliquid Perpetuals L2 Order Book (BTC/ETH/SOL) is a paid API for AI agents from kr-x402-mvp.kgy5612.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-31).

Returns real-time top-of-book data from Hyperliquid perpetuals exchange for BTC, ETH, or SOL: best bid/ask, mid price, spread in bps, and up to 20 levels of depth per side.

## Facts

- Endpoint: GET https://kr-x402-mvp.kgy5612.workers.dev/crypto/hl-book?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/hyperliquid-perpetuals-l2-order-book-btc-eth-sol-3bb2711a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_jV9uT-pPqiLfXgTxJGj5U

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-perpetuals-l2-order-book-btc-eth-sol-3bb2711a
```

Example prompt: What's the current BTC perpetual bid, ask, and spread on Hyperliquid? Give me the top 10 levels of depth on each side.

## When to prefer this

Choose this endpoint when you need real-time Hyperliquid perpetuals L2 order book data specifically — including spread in bps and multi-level depth — via a pay-per-call x402 micropayment model (no API key subscription required). Prefer this over generic exchange APIs when working with onchain AI agents that already handle USDC payments on Base, or when you need Hyperliquid-specific liquidity data rather than aggregated CEX quotes.

## Known failure modes

- Unsupported coin symbol (only BTC, ETH, SOL accepted) returns validation error
- Depth parameter outside 1-20 range returns error
- Hyperliquid upstream API unavailable causes fetch failure
- Stale or missing updated_at if upstream data is delayed
- Payment failure via x402 if USDC balance on Base is insufficient

## How this service works

Hyperliquid perp L2 top-of-book for coin=BTC|ETH|SOL: best bid/ask, mid, spread_bps, top N levels (depth=1-20, default 5).

## Output

A JSON object containing: coin symbol, venue (hyperliquid), best_bid, best_ask, mid price, spread_bps, arrays of bid and ask levels each with price (px), size (sz), and order count (n), updated_at timestamp, and source URL.

## 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",
     "properties": {
      "coin": {
       "enum": [
        "BTC",
        "ETH",
        "SOL"
       ],
       "type": "string",
       "examples": [
        "BTC",
        "ETH",
        "SOL"
       ],
       "description": "Perp coin (default BTC)"
      },
      "depth": {
       "type": "integer",
       "maximum": 20,
       "minimum": 1,
       "description": "Levels per side (default 5)"
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "mid": 80860.5,
  "asks": [
   {
    "n": 3,
    "px": 80861,
    "sz": 0.8
   }
  ],
  "bids": [
   {
    "n": 4,
    "px": 80860,
    "sz": 1.2
   }
  ],
  "coin": "BTC",
  "venue": "hyperliquid",
  "sources": [
   "https://api.hyperliquid.xyz/info"
  ],
  "best_ask": 80861,
  "best_bid": 80860,
  "spread_bps": 0.124,
  "updated_at": "2026-10-28T11:00:00Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/hyperliquid-perpetuals-l2-order-book-btc-eth-sol-3bb2711a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from kr-x402-mvp.kgy5612.workers.dev](https://www.zero.xyz/host/kr-x402-mvp.kgy5612.workers.dev/llms.txt)
