# OneSource Deepstate Order Book Snapshot

> OneSource Deepstate Order Book Snapshot is a paid API for AI agents from api.onesource.io, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Returns a full order-book snapshot for a named market, with bids sorted descending and asks sorted ascending, including summary statistics like spread and mid price

## Facts

- Endpoint: GET https://api.onesource.io/deepstate/v1/book/:book
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/onesource-deepstate-order-book-snapshot-8b82cd1f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vM-ef6LvVl5oDxxVgwEZ2

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 onesource-deepstate-order-book-snapshot-8b82cd1f
```

Example prompt: Pull the current order book snapshot for the ETH-USDC book on OneSource — show me the top 50 levels of bids and asks with the spread and mid price.

## When to prefer this

Use this endpoint when you need a real-time, fully ordered on-chain order book snapshot with raw blockchain-level detail (sequence numbers, block height, maker addresses, queue positions) for a specific named market. Prefer it over generic DEX aggregators when you need the authoritative on-chain state rather than aggregated or estimated liquidity, or when downstream logic requires raw values for verification or trade construction.

## Known failure modes

- Unknown book identifier returns 404 or empty result
- depth parameter out of range (must be 1–500) returns 400 validation error
- Market temporarily unavailable or chain sync lag returns stale or empty snapshot
- Network timeout if the on-chain node is slow to respond
- Insufficient USDC balance or failed x402 payment results in 402 Payment Required

## How this service works

Deepstate, the on-chain order-book exchange on Robinhood Chain. Order-book snapshot for a market, bids descending and asks ascending, with live resting size per level.

## Output

A JSON object containing two arrays — bids (price-descending) and asks (price-ascending) — each with fields for price, size, maker address, order_id, raw on-chain values (price_raw, size_raw, sequence_raw), rest_index, queue_position, rested_at_block, and is_bid_token0; plus a summary object with book_id, book_label, best_bid, best_ask, spread_bps, spread_raw, mid_raw, bid_count, ask_count, order_count, and finality status.

## 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"
    },
    "pathParams": {
     "type": "object",
     "required": [
      "book"
     ],
     "properties": {
      "book": {
       "type": "string"
      }
     }
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "depth": {
       "type": "integer",
       "maximum": 500,
       "minimum": 1
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asks": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "side": {
          "type": "string"
         },
         "size": {
          "type": "number"
         },
         "maker": {
          "type": "string"
         },
         "price": {
          "type": "number"
         },
         "order_id": {
          "type": "string"
         },
         "size_raw": {
          "type": "string"
         },
         "nonce_raw": {
          "type": "integer"
         },
         "price_raw": {
          "type": "string"
         },
         "rest_index": {
          "type": "integer"
         },
         "sequence_raw": {
          "type": "string"
         },
         "is_bid_token0": {
          "type": "boolean"
         },
         "price_key_raw": {
          "type": "string"
         },
         "queue_position": {
          "type": "integer"
         },
         "rested_at_block": {
          "type": "integer"
         }
        }
       }
      },
      "bids": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "side": {
          "type": "string"
         },
         "size": {
          "type": "number"
         },
         "maker": {
          "type": "string"
         },
         "price": {
          "type": "number"
         },
         "order_id": {
          "type": "string"
         },
         "size_raw": {
          "type": "string"
         },
         "nonce_raw": {
        
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/onesource-deepstate-order-book-snapshot-8b82cd1f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.onesource.io](https://www.zero.xyz/host/api.onesource.io/llms.txt)
