# Order Book Depth & Slippage

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

Returns spot order book data for OKX, Gate, or Kraken including best bid/ask, spread in bps, USD depth at 0.5%/1%/2%, and average fill price/slippage for a given USD order size.

## Facts

- Endpoint: GET https://bess-x402.onrender.com/v1/crypto/orderbook?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/order-book-depth-slippage-ed2d3e85
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_waNTXNdyAz75SXsHgxg0b

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-ed2d3e85
```

Example prompt: What's the current bid-ask spread and order book depth for BTC-USDT on OKX, and how much slippage would I get on a $50,000 market buy?

## When to prefer this

Use this endpoint when you need real-time order book microstructure data — specifically spread, depth, and slippage estimates — for crypto spot markets on OKX, Gate, or Kraken. Prefer it over generic price feeds when execution quality, market impact, or liquidity analysis is the goal rather than just a last-traded price.

## Known failure modes

- Unsupported trading pair for the selected venue returns an error or empty data
- Invalid venue name (not okx, gate, or kraken) causes a 400 or similar error
- Exchange API downtime or rate limiting may result in stale or missing data
- Very illiquid pairs may show zero depth at certain price bands
- size_usd larger than total available book depth will produce incomplete slippage estimates

## How this service works

Spot order book on OKX, Gate or Kraken: best bid/ask, spread in bps, USD depth within 0.5%, 1% and 2% of mid, and the average fill price and slippage to market-buy or sell a given USD size.

## Output

Returns the best bid and ask prices, spread in basis points, available USD liquidity within 0.5%, 1%, and 2% of the mid price, and (when size_usd is provided) the estimated average fill price and slippage in basis points for a market buy or sell of that USD notional.

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [],
     "properties": {
      "pair": {
       "type": "string",
       "description": "Pair, e.g. BTC-USDT or ETH-USD"
      },
      "venue": {
       "type": "string",
       "description": "okx, gate or kraken"
      },
      "size_usd": {
       "type": "number",
       "description": "Order size in quote currency for slippage"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

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