> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trusset.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Daily Stats

> Daily OHLC and volume history for every book on one token

Returns a day-by-day series for a base token rather than a single book. Every non-closed stock book your instance holds on that token contributes, and any pooled peers of those books contribute too, so the series describes the instrument as your venue sees it.

The response always carries one entry per calendar day in the range, in UTC, including days with no activity. That keeps the series directly plottable without gap-filling on the client.

## Path Parameters

<ParamField path="tokenAddress" type="string" required>
  Base token contract. Matched case-insensitively.
</ParamField>

## Query Parameters

<ParamField query="range" type="string" default="1M">
  Window length: `1W`, `1M`, `3M`, `6M` or `1Y`. Anything else returns `INVALID_PARAM`.
</ParamField>

## Response Fields

<ResponseField name="data" type="object">
  <Expandable>
    <ResponseField name="hasOrderbook" type="boolean">
      False when your instance holds no non-closed stock book on this token. `orderbooks` and `stats` are then empty and `totals` are zero.
    </ResponseField>

    <ResponseField name="orderbooks" type="array">
      The books that contributed, oldest first.

      <Expandable>
        <ResponseField name="id" type="string">Order book ID.</ResponseField>
        <ResponseField name="name" type="string">Display name.</ResponseField>
        <ResponseField name="symbol" type="string">Display symbol.</ResponseField>
        <ResponseField name="settlementMode" type="string">`OFF_CHAIN` or `ON_CHAIN`.</ResponseField>
        <ResponseField name="status" type="string">`ACTIVE` or `PAUSED`.</ResponseField>
        <ResponseField name="tokenType" type="string">`STOCK_TOKEN`.</ResponseField>
        <ResponseField name="quoteTokenAddress" type="string">Quote token.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="stats" type="array">
      One entry per day in the range, oldest first.

      <Expandable>
        <ResponseField name="date" type="string">UTC day, `YYYY-MM-DD`.</ResponseField>
        <ResponseField name="orderCount" type="integer">Orders submitted that day.</ResponseField>
        <ResponseField name="tradeCount" type="integer">Trades executed that day.</ResponseField>
        <ResponseField name="volumeBase" type="number">Base volume as a decimal number, already divided out of order book units.</ResponseField>
        <ResponseField name="volumeQuote" type="number">Quote notional as a decimal number.</ResponseField>
        <ResponseField name="priceHigh" type="number">Highest trade price that day, or `null`.</ResponseField>
        <ResponseField name="priceLow" type="number">Lowest trade price, or `null`.</ResponseField>
        <ResponseField name="priceOpen" type="number">First trade price, or `null`.</ResponseField>
        <ResponseField name="priceClose" type="number">Last trade price, or `null`.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="range" type="string">The range applied.</ResponseField>

    <ResponseField name="truncated" type="boolean">
      True when the underlying order or trade scan hit its 50,000-row ceiling, meaning the series understates a very busy instrument.
    </ResponseField>

    <ResponseField name="totals" type="object">
      <Expandable>
        <ResponseField name="orderCount" type="integer">Orders across the range.</ResponseField>
        <ResponseField name="tradeCount" type="integer">Trades across the range.</ResponseField>
        <ResponseField name="volumeBase" type="number">Base volume across the range.</ResponseField>
        <ResponseField name="volumeQuote" type="number">Quote notional across the range.</ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<Note>
  Prices and volumes here are decimal numbers, not order book unit strings. Everywhere else on this surface amounts are integer strings; this endpoint is the display series and is scaled for charting.
</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.trusset.org/orderbooks/stocks/api/order-books/by-token/0xabc7f1093d5e26b804a1c3f78de025916b47c0d3/daily-stats?range=3M" \
    -H "X-API-Key: trusset_your_key_here"
  ```

  ```typescript TypeScript theme={null}
  const res = await fetch(
    `https://api.trusset.org/orderbooks/stocks/api/order-books/by-token/${tokenAddress}/daily-stats?range=3M`,
    { headers: { 'X-API-Key': 'trusset_your_key_here' } }
  );
  const { data } = await res.json();

  if (!data.hasOrderbook) console.log('no book on this token');
  if (data.truncated) console.warn('series truncated at the scan limit');
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "hasOrderbook": true,
      "orderbooks": [
        {
          "id": "clx_ob_stock_002",
          "name": "Nyala Fund I",
          "symbol": "NYF1",
          "settlementMode": "OFF_CHAIN",
          "status": "ACTIVE",
          "tokenType": "STOCK_TOKEN",
          "quoteTokenAddress": "0x98ad0ca091552e23c564b41c74282e5343d03e8a"
        }
      ],
      "stats": [
        {
          "date": "2025-06-13",
          "orderCount": 0,
          "tradeCount": 0,
          "volumeBase": 0,
          "volumeQuote": 0,
          "priceHigh": null,
          "priceLow": null,
          "priceOpen": null,
          "priceClose": null
        },
        {
          "date": "2025-06-14",
          "orderCount": 9,
          "tradeCount": 4,
          "volumeBase": 12,
          "volumeQuote": 2185.2,
          "priceHigh": 182.6,
          "priceLow": 181.2,
          "priceOpen": 181.4,
          "priceClose": 182.35
        }
      ],
      "range": "3M",
      "truncated": false,
      "totals": {
        "orderCount": 241,
        "tradeCount": 118,
        "volumeBase": 702,
        "volumeQuote": 127884.5
      }
    }
  }
  ```
</ResponseExample>

## Error Codes

| Code                  | HTTP  | Cause                                               |
| --------------------- | ----- | --------------------------------------------------- |
| `INVALID_PARAM`       | `400` | `range` is not one of the five accepted values      |
| `VALIDATION_ERROR`    | `400` | `tokenAddress` is not a valid address               |
| `INSTANCE_REQUIRED`   | `400` | The request carried no resolvable instance          |
| `SERVICE_NOT_ENABLED` | `403` | The Trading service is not enabled on this instance |
