# OneSource Deepstate Market Stats

> OneSource Deepstate Market Stats 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-13).

Returns aggregated on-chain market statistics (OHLC, VWAP, volume, trade count, price change) for a Deepstate order-book over 24h, 7d, and 30d windows

## Facts

- Endpoint: GET https://api.onesource.io/deepstate/v1/stats/%7Bbook%7D
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/onesource-deepstate-market-stats-7660e567
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_lXT2_ulIV3bX2aL26Njnm

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-market-stats-7660e567
```

Example prompt: Pull the on-chain market stats for the NVDA/USDG book on Deepstate — I want to see the 24-hour and 7-day VWAP, volume, trade count, and price change.

## When to prefer this

Use this endpoint when you need aggregated market statistics (VWAP, volume, trade count, price change, high/low) for a specific Deepstate on-chain order book over standardized time windows (24h, 7d, 30d). Prefer it over raw RPC reads when you want pre-computed analytics rather than raw event logs. Choose it over general DeFi price APIs when the asset is a tokenized real-world asset (e.g. NVDA) trading on the Deepstate protocol on Robinhood Chain or Ethereum.

## Known failure modes

- Unknown book slug or address returns a 404 or empty response
- Payment not included or insufficient — returns HTTP 402 requiring USDC payment on Base
- Stale or missing chain data if the indexer lags behind head — 'finality' field may reflect 'pending' or delayed state
- Malformed book path parameter results in a 400 error
- Network congestion on Base or Tempo may delay payment confirmation and retry

## How this service works

Two data families for AI agents: live Ethereum mainnet, Sepolia testnet, and Robinhood Chain RPC reads, plus Deepstate on-chain market data (order books, trades, candles, and analytics). Pay per call or use batch/session mode: USDC on Base via x402, or pathUSD/USDC.e on Tempo via MPP. No API key required to start; a flat-rate monthly subscription is also available.

## Output

A JSON object containing the book ID, slug, label, last price, base and quote token details (symbol, address, decimals), current block number, market session (e.g. 'regular'), and a 'windows' object with 24h, 7d, and 30d sub-objects each containing trade count, low/high prices, VWAP, price change percentage, and quote volume (both human-readable and raw).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "properties": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "book_id": "0xdf941c235503a5d2e67aee5dea00f2965f99421c0d034bd77f924c05c66bf399",
  "windows": {
   "7d": {
    "trades": 171,
    "low_raw": "210.44032118",
    "high_raw": "229.11004221",
    "vwap_raw": "219.03881204",
    "change_pct": 2.41,
    "volume_quote": 19800000,
    "volume_quote_raw": "19800000000000"
   },
   "24h": {
    "trades": 24,
    "low_raw": "215.70112004",
    "high_raw": "220.47999716",
    "vwap_raw": "217.90441002",
    "change_pct": -1.82,
    "volume_quote": 500000,
    "volume_quote_raw": "500000000000"
   },
   "30d": {
    "trades": 402,
    "low_raw": "198.03118022",
    "high_raw": "241.72004112",
    "vwap_raw": "221.44120038",
    "change_pct": 8.77,
    "volume_quote": 141900000,
    "volume_quote_raw": "141900000000000"
   }
  },
  "finality": "head",
  "book_slug": "NVDA-USDG",
  "base_token": {
   "symbol": "NVDA",
   "address": "0xd0601CE157Db5bdC3162BbaC2a2C8aF5320D9EEC",
   "decimals": 18
  },
  "book_label": "NVDA/USDG",
  "last_price": 216.48219249,
  "quote_token": {
   "symbol": "USDG",
   "address": "0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",
   "decimals": 6
  },
  "block_number": 52685677,
  "last_price_raw": "216.48219249",
  "market_session": "regular"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/onesource-deepstate-market-stats-7660e567/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)
