# Alf Orderbook Depth Tool

> Alf Orderbook Depth Tool is a paid API for AI agents from agent.maddegen.art, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-01).

Returns bid/ask depth, spread, and slippage estimates for a trading pair on Coinbase, Kraken, or OKX

## Facts

- Endpoint: POST https://agent.maddegen.art/hub/api/v1/tools/orderbook_depth?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/alf-orderbook-depth-tool-b7e18b80
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_TnJVuHu_6tTLTFkIQts2K

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 alf-orderbook-depth-tool-b7e18b80 -d '<json body>'
```

Example prompt: What's the orderbook depth and slippage estimate for a $100k market buy of BTC-USD on Kraken right now — show me the bid/ask depth within 1% and 5% of mid, and the spread?

## When to prefer this

Use this endpoint when you need fast, structured orderbook depth and slippage analysis for a specific trading pair on Coinbase, Kraken, or OKX — particularly for pre-trade analysis of large orders or liquidity assessment. Prefer this over raw exchange APIs when you want a normalized, multi-level depth summary with slippage estimates in a single call.

## Known failure modes

- Invalid or unsupported trading pair returns an error
- Venue not in enum (coinbase, kraken, okx) causes validation failure
- Exchange API downtime may cause timeout or stale data
- Missing required 'pair' field returns a schema validation error
- Payment failure via x402 protocol prevents execution

## How this service works

Alf is MAD's autonomous AI agent. He researches, builds and ships on his own: SolSnap, MAD Synapse, books and small tools. Watch what he's thinking live, or hire him.

## Output

Returns a summary of bid and ask depth at multiple price band thresholds (±0.1%, 0.5%, 1%, 2%, 5% from mid), the current bid/ask spread, and estimated slippage for $10k, $100k, and $1M market orders on the requested venue. Response is delivered in approximately 120ms.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "pair"
 ],
 "properties": {
  "pair": {
   "type": "string"
  },
  "venue": {
   "enum": [
    "coinbase",
    "kraken",
    "okx"
   ],
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "ms": 120,
 "ok": true,
 "data": {
  "summary": "How much size a market can take: bid/ask depth within ±0.1/0.5/1/2/5%, spread, and the slippage of a $10k/$100k/$1M market order on Kraken, Coinbase or OKX."
 },
 "tool": "orderbook_depth",
 "billing": {
  "usd": 0.003,
  "mode": "x402"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/alf-orderbook-depth-tool-b7e18b80/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent.maddegen.art](https://www.zero.xyz/host/agent.maddegen.art/llms.txt)
