# Order Book Depth & Slippage

> Order Book Depth & Slippage is a paid API for AI agents from derivs.duoleads.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-15).

Returns real-time order book depth, bid/ask spread, slippage estimates, and wall detection for crypto perpetual futures across 8 major exchanges.

## Facts

- Endpoint: GET https://derivs.duoleads.com/v1/orderbook?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/order-book-depth-slippage-9d2f4203
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap__T-PRYwMSlaB2uwyFgZLV

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 order-book-depth-slippage-9d2f4203
```

Example prompt: What's the current order book depth and estimated slippage for buying $500,000 of BTC perp — show me the top 5 price levels per side across all exchanges?

## When to prefer this

Use this endpoint when you need real-time, cross-exchange order book microstructure data for crypto perpetual futures — specifically for pre-trade slippage estimation, liquidity comparison across venues, order wall detection, or spread analysis. It covers 8 major perp exchanges in a single call with no API key required, making it ideal for trading agents, execution routers, or market monitoring workflows. Prefer this over exchange-native APIs when you need a normalized, multi-venue view without managing separate auth credentials per exchange.

## Known failure modes

- Unknown coin symbol returns empty or error response
- Coin traded on fewer than all 8 exchanges returns partial venue list
- Stale book data flagged via 'stale: true' per venue if feed is delayed
- levels parameter out of range (>20) rejected by schema validation
- size_usd outside 1–1e9 range rejected
- x402 payment failure blocks request if USDC balance on Base is insufficient
- Network timeout if exchange feed is temporarily unavailable

## How this service works

Perp funding rates, open interest, futures basis, implied volatility, liquidations, order book depth and a perp screener for crypto perpetual futures across 8 exchanges (Bybit, Hyperliquid, dYdX, Gate, Kraken, Bitfinex, Deribit, OKX), paid per call over x402 with USDC on Base. No account, no API key.

## Output

A JSON object keyed by coin symbol with a list of venue-level order book snapshots. Each venue entry includes: mid price, best bid/ask, spread in basis points, bid/ask depth in USD at configurable percentage bands, bid/ask imbalance ratio, top N price levels per side (if requested), detected order walls with size in USD, slippage estimate (buy and sell) for the specified order size, book timestamp, and a staleness flag. Units metadata is provided for interpretation.

## 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",
       "maxLength": 32,
       "minLength": 1,
       "description": "Coin symbol: BTC, ETH, SOL, PEPE ... (also BTCUSDT, BTC-PERP, XBT, 1000PEPE, kPEPE)."
      },
      "levels": {
       "type": "string",
       "default": "0",
       "pattern": "^[0-9]{1,2}$",
       "description": "Also return the top N price levels per side (0-20). Default 0."
      },
      "size_usd": {
       "type": "string",
       "default": "100000",
       "description": "Order size in USD for the slippage estimate (1-1e9). Default 100000."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "coin": "BTC",
  "colo": null,
  "as_of": "2026-10-14T23:00:00Z",
  "units": {
   "times": "ISO 8601 UTC",
   "levels": "[price USD, size coins]",
   "prices": "USD per coin",
   "depth_usd": "USD resting within +/- pct % of mid (price x size)",
   "imbalance": "(bid_usd - ask_usd) / (bid_usd + ask_usd), -1..1",
   "spread_bps": "(ask - bid) / mid x 10,000",
   "slippage_bps": "average fill vs mid in basis points (>= 0 is worse than mid)"
  },
  "venues": [
   {
    "mid": 81644.95,
    "as_of": "2026-10-14T23:00:00Z",
    "depth": [
     {
      "pct": 0.1,
      "ask_usd": 7913202.056,
      "bid_usd": 8009555.947,
      "imbalance": 0.00605133
     },
     {
      "pct": 0.5,
      "ask_usd": 7913202.056,
      "bid_usd": 8009555.947,
      "imbalance": 0.00605133
     }
    ],
    "stale": false,
    "venue": "bybit",
    "walls": {
     "asks": [
      {
       "price": 81672,
       "size_usd": 510695.016
      },
      {
       "price": 81669.3,
       "size_usd": 452692.9299
      }
     ],
     "bids": [
      {
       "price": 81634.1,
       "size_usd": 642378.7329
      },
      {
       "price": 81644.9,
       "size_usd": 483174.5182
      }
     ]
    },
    "symbol": "BTCUSDT",
    "best_ask": 81645,
    "best_bid": 81644.9,
    "slippage": {
     "buy": {
      "filled": true,
      "avg_price": 81645,
      "filled_usd": 100000,
      "slippage_bps": 0.00612408
     },
     "sell": {
      "filled": true,
      "avg_price": 81644.9,
      "filled_usd": 100000,
      "slippage_bps": 0.00612408
     },
     "size_usd": 100000
    },
    "book_time": "2026-10-14T22:50:24Z",
    "spread_bps": 0.0122482,
    "levels_held": {
     "asks": 200,
     "bids": 200
    }
   },
   {
    "mid": 81648.5,
    "as_of": "2026-10-14T23:00:00Z",
    "depth": [
     {
      "pct": 0.1,
      "ask_usd": 5325002.521,
      "bid_usd": 5932686.945,
      "imbalance": 0.0539795
     },
     {
      "pct": 0.5,
      "ask_usd": 5325002.521,
      "bid_usd": 5932686.945,
      "imbalance": 0.0539795
     }
    ],
    "stale": false,
    "venue": "hyperliquid",
    "walls": {
     "asks": [
      {
       "price": 81649,
       "size_usd": 735450.918
      },
      {
       "price": 81665,
       "size_usd": 702384.332
      }
     ],
     "bids": [
      {
       "price": 81630,
       "size_usd": 1456431.848
      },
      {
       "price": 81631,
       "size_usd": 1080598.526
      }
     ]
    },
    "symbol": "BTC",
    "best
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/order-book-depth-slippage-9d2f4203/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from derivs.duoleads.com](https://www.zero.xyz/host/derivs.duoleads.com/llms.txt)
