# OneSource Deepstate Depth History

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

Returns a time-series heatmap of resting order sizes by price level for a given order book market, with configurable time range and resolution

## Facts

- Endpoint: GET https://api.onesource.io/deepstate/v1/analytics/depth-history
- Price: $0.02/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-depth-history-06fa6602
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_DRmUY9Db-oaazTQR6Rqgl

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-depth-history-06fa6602
```

Example prompt: Show me the hourly bid-side depth history for the ETH-USDC order book on Deepstate from 2024-11-01 to 2024-11-07 so I can see how resting liquidity was distributed across price levels.

## When to prefer this

Choose this endpoint when you need historical order book depth data over time for a specific Deepstate market — particularly for building heatmaps, identifying liquidity clusters, analyzing price-level support/resistance, or monitoring how resting order distribution has evolved. This is the right choice for time-series depth analysis rather than a point-in-time snapshot. Prefer this over live order book endpoints when you need a look-back window of hours or days at 1h or 1d resolution.

## Known failure modes

- Missing required 'book' parameter returns a validation error
- Invalid resolution value (not '1h' or '1d') returns an enum validation error
- Invalid side value (not 'bid' or 'ask') returns an enum validation error
- Unknown or unsupported book ID returns empty results or a 404
- Time range too broad for the selected resolution may result in large payloads or truncation
- Payment failure or missing x402 payment header returns a 402 Payment Required response
- Future 'to' date beyond chain head returns no data or partial results

## How this service works

Deepstate, the on-chain order-book exchange on Robinhood Chain. Depth heatmap - resting order size by price level over time for a market.

## Output

Returns a time-indexed array of depth data points, each containing the price bucket, side (bid/ask), resting order size (raw and denominated), order count, block number, market session, and finality status. Also includes book metadata (ID, slug, label), the queried time range, resolution, and coverage statistics (total order and denominated order counts). Size token metadata (symbol, address, decimals) is included for unit 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "book"
     ],
     "properties": {
      "to": {
       "type": "string"
      },
      "res": {
       "enum": [
        "1h",
        "1d"
       ],
       "type": "string"
      },
      "book": {
       "type": "string"
      },
      "from": {
       "type": "string"
      },
      "side": {
       "enum": [
        "bid",
        "ask"
       ],
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "to": {
       "type": "string"
      },
      "from": {
       "type": "string"
      },
      "points": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "side": {
          "type": "string"
         },
         "bucket": {
          "type": "string"
         },
         "finality": {
          "type": "string"
         },
         "size_raw": {
          "type": "string"
         },
         "price_raw": {
          "type": "string"
         },
         "order_count": {
          "type": "integer"
         },
         "block_number": {
          "type": "integer"
         },
         "market_session": {
          "type": "string"
         },
         "denominated_order_count": {
          "type": "integer"
         }
        }
       }
      },
      "book_id": {
       "type": "string"
      },
      "coverage": {
       "type": "object",
       "properties": {
        "order_count": {
         "type": "integer"
        },
        "denominated_order_count": {
         "type": "integer"
        }
       }
      },
      "book_slug": {
       "type": "string"
      },
      "book_label": {
       "type": "string"
      },
      "resolution": {
       "type": "string"
      },
      "size_token": {
       "type": "object",
       "properties": {
        "symbol": {
         "type": "string"
        },
        "
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "to": "2026-09-02T16:00:00Z",
  "from": "2026-09-02T15:00:00Z",
  "points": [
   {
    "side": "bid",
    "bucket": "2026-09-02T15:00:00Z",
    "finality": "safe",
    "size_raw": "5213000000",
    "price_raw": "216.480000000000000000",
    "order_count": 4,
    "block_number": 52661600,
    "market_session": "regular",
    "denominated_order_count": 4
   },
   {
    "side": "ask",
    "bucket": "2026-09-02T15:00:00Z",
    "finality": "safe",
    "price_raw": "220.480000000000000000",
    "order_count": 3,
    "block_number": 52661600,
    "market_session": "regular",
    "denominated_order_count": 0
   }
  ],
  "book_id": "0xdf941c235503a5d2e67aee5dea00f2965f99421c0d034bd77f924c05c66bf399",
  "coverage": {
   "order_count": 253,
   "denominated_order_count": 129
  },
  "book_slug": "NVDA-USDG",
  "book_label": "NVDA/USDG",
  "resolution": "1h",
  "size_token": {
   "symbol": "USDG",
   "address": "0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",
   "decimals": 6
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/onesource-deepstate-depth-history-06fa6602/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)
