# OneSource Deepstate On-Chain Trades Feed

> OneSource Deepstate On-Chain Trades Feed 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 recent matched trades (fills) for a specific on-chain order book on the Deepstate decentralized exchange, including price, amounts, sides, and block-level metadata.

## Facts

- Endpoint: GET https://api.onesource.io/deepstate/v1/trades/%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-on-chain-trades-feed-88405963
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_mdCOXZZUl5QsD2BXzogNH

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-on-chain-trades-feed-88405963
```

Example prompt: Pull the latest trades from the NVDA/USDG Deepstate order book — I want to see recent fills including price, side, and amounts.

## When to prefer this

Use this endpoint when you need granular, on-chain trade execution data (fills) for a specific Deepstate order book — including exact prices, counterparty addresses, block-level provenance, and fee details. Prefer this over order book snapshot endpoints when you need historical fill sequences rather than current open orders, and over general Ethereum RPC endpoints when you need structured DEX trade data rather than raw transaction decoding.

## Known failure modes

- Invalid or unknown book identifier returns empty trades array or 404
- Malformed book address causes a 400 bad request
- No trades in the requested block range returns empty trades array
- Payment failure (x402/MPP) results in 402 Payment Required with no data
- Rate limiting or session expiry returns 429 or 402
- Network congestion on Robinhood Chain may cause stale or delayed data

## 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 an array of trade records for the specified book. Each trade includes: side (bid/ask), price, price net of fee, base and quote token amounts (raw and human-readable), order ID, transaction hash, block hash and number, finality status (head/finalized), gas used, fee amount and recipient, maker and taker addresses, market session, and match event type. Also returns book metadata: book ID, slug, label, base token (symbol/address/decimals), and quote token (symbol/address/decimals), plus a cursor (next_before) for pagination.

## Request schema (JSON Schema)

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

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "trades": [
   {
    "side": "bid",
    "price": 216.47999901,
    "book_id": "0xdf941c235503a5d2e67aee5dea00f2965f99421c0d034bd77f924c05c66bf399",
    "finality": "head",
    "gas_used": 412903,
    "order_id": "0x2ace85d500000000000000000000000000000000db5ac90000000000fffbb01b",
    "price_raw": "216.47999901",
    "timestamp": 1788362840,
    "base_token": "0xd0601CE157Db5bdC3162BbaC2a2C8aF5320D9EEC",
    "block_hash": "0x2d4f6a8c0e2b4d6f8a0c2e4b6d8f0a2c4e6b8d0f2a4c6e8b0d2f4a6c8e0b2d4f",
    "book_label": "NVDA/USDG",
    "attribution": "exact",
    "match_event": "BidMatched",
    "quote_token": "0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",
    "block_number": 52685331,
    "fee_recipient": "0xbfb7b3Ff3D498a559b946B836d26F0E168f273D5",
    "is_bid_token0": false,
    "maker_address": "0x884a1B2c3D4e5F60718293a4B5c6D7e8F90A1b2C",
    "taker_address": "0x2b4d6f8a0c2e4b6d8f0a2c4e6b8d0f2a4c6e8b0d",
    "fee_amount_raw": "1598069",
    "market_session": "regular",
    "base_amount_raw": "7381992258086111446",
    "gas_used_for_l1": 287441,
    "quote_amount_raw": "1598069869",
    "transaction_hash": "0xa1c3e5b7d9f02a4c6e8b0d2f4a6c8e0b2d4f6a8c0e2b4d6f8a0c2e4b6d8f0a2c",
    "price_net_of_fee_raw": "216.26352901",
    "effective_gas_price_raw": "485000000"
   }
  ],
  "book_id": "0xdf941c235503a5d2e67aee5dea00f2965f99421c0d034bd77f924c05c66bf399",
  "book_slug": "NVDA-USDG",
  "base_token": {
   "symbol": "NVDA",
   "address": "0xd0601CE157Db5bdC3162BbaC2a2C8aF5320D9EEC",
   "decimals": 18
  },
  "book_label": "NVDA/USDG",
  "next_before": 52685331,
  "quote_token": {
   "symbol": "USDG",
   "address": "0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",
   "decimals": 6
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/onesource-deepstate-on-chain-trades-feed-88405963/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)
