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

# Batch historical Uniswap reserves

> Returns reserves at a specific block for multiple Uniswap pool IDs on the requested chain. Batches allow up to 200 pool IDs.

```bash theme={null}
curl -X POST "https://staging-api.struct.to/v1/uniswap/reserves-at-block/batch?chain=base&chain_id=8453&protocol=v4&fields=short" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"pool_ids":["0x1111111111111111111111111111111111111111111111111111111111111111"],"block":22100000}'
```

```json Response (Long) theme={null}
{
  "0x1111111111111111111111111111111111111111111111111111111111111111": {
    "pool_id": "0x1111111111111111111111111111111111111111111111111111111111111111",
    "block": 22100000,
    "reserves": {
      "reserve0": "934064700000000000000",
      "reserve1": "2322765870000",
      "reserve0_decimal": "934.0647",
      "reserve1_decimal": "2322765.87",
      "currency1_decimals": 6,
      "currency0_decimals": 18
    }
  }
}
```

```jsonc Response (Short) theme={null}
{
  "0x1111111111111111111111111111111111111111111111111111111111111111": {
    "p": "0x1111111111111111111111111111111111111111111111111111111111111111",
    "b": 22100000,
    "r": {
      "r0": "934064700000000000000",
      "r1": "2322765870000",
      "d0": "934.0647",
      "d1": "2322765.87",
      "c1": 6,
      "c0": 18
    }
  }
}
```


## OpenAPI

````yaml onchain-openapi.json POST /uniswap/reserves-at-block/batch
openapi: 3.1.0
info:
  title: Struct On-chain API
  description: >-
    RESTful API for token market data, discovery, holders, audits, and trader
    analytics across supported chains. Pass `fields=short` or header
    `x-field-names: short` for abbreviated keys. HTTP defaults to `long`. Token
    candlesticks, token trades and wallet batch trades also support
    `fields=array` for typed positional rows.
  version: 1.0.0
servers:
  - url: https://staging-api.struct.to/v1
    description: Staging
security:
  - ApiKey: []
paths:
  /uniswap/reserves-at-block/batch:
    post:
      tags:
        - Uniswap
      summary: Batch historical Uniswap reserves
      description: >-
        Returns reserves at a specific block for multiple Uniswap pool IDs on
        the requested chain. Batches allow up to 200 pool IDs.
      operationId: post_uniswap_reserves_at_block_batch
      parameters:
        - name: chain
          in: query
          description: Chain name. Required unless `chain_id` is provided.
          required: false
          schema:
            type: string
          example: base
        - name: chain_id
          in: query
          description: Chain id. Required unless `chain` is provided. Use `-1` for Solana.
          required: false
          schema:
            type: integer
            format: int64
          example: 8453
        - name: protocol
          in: query
          description: >-
            Uniswap version: v3 or v4. Omit to split the batch by pool
            identifier.
          required: false
          schema:
            $ref: '#/components/schemas/UniswapProtocol'
          example: v4
        - name: x-field-names
          in: header
          required: false
          description: >-
            Select long (full) or short (abbreviated) field names. HTTP defaults
            to `long`. Takes precedence over `fields`. See [Response
            Format](/api-reference/response-format#long-and-short-field-names).
          schema:
            type: string
            enum:
              - long
              - short
            default: long
          example: short
        - name: fields
          in: query
          required: false
          description: >-
            Same as `x-field-names`. Use `long` or `short`. HTTP defaults to
            `long`. Ignored when the header is set. `field_names` is accepted as
            an alias.
          schema:
            type: string
            enum:
              - long
              - short
            default: long
          example: short
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReservesAtBlockBatchRequest'
            example:
              pool_ids:
                - >-
                  0x1111111111111111111111111111111111111111111111111111111111111111
              block: 22100000
        required: true
      responses:
        '200':
          description: Batch historical Uniswap reserve data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V4HistoricalReservesBatchResponse'
              examples:
                long:
                  summary: Response (Long)
                  value:
                    '0x1111111111111111111111111111111111111111111111111111111111111111':
                      pool_id: >-
                        0x1111111111111111111111111111111111111111111111111111111111111111
                      block: 22100000
                      reserves:
                        reserve0: '934064700000000000000'
                        reserve1: '2322765870000'
                        reserve0_decimal: '934.0647'
                        reserve1_decimal: '2322765.87'
                        currency1_decimals: 6
                        currency0_decimals: 18
                short:
                  summary: Response (Short)
                  value:
                    '0x1111111111111111111111111111111111111111111111111111111111111111':
                      p: >-
                        0x1111111111111111111111111111111111111111111111111111111111111111
                      b: 22100000
                      r:
                        r0: '934064700000000000000'
                        r1: '2322765870000'
                        d0: '934.0647'
                        d1: '2322765.87'
                        c1: 6
                        c0: 18
        '400':
          description: Validation error, usually invalid chain or request body.
        '503':
          description: Uniswap data is unavailable for the requested chain.
components:
  schemas:
    UniswapProtocol:
      type: string
      description: 'Uniswap version: v3 or v4.'
      enum:
        - v3
        - v4
    ReservesAtBlockBatchRequest:
      type: object
      required:
        - pool_ids
        - block
      properties:
        pool_ids:
          type: array
          items:
            type: string
          description: >-
            Pool identifiers to load. V3 pool addresses or 32-byte V4 pool ids.
            Maximum 200.
          maxItems: 200
          minItems: 1
        block:
          type: integer
          format: int64
          description: Block number to query.
          minimum: 0
      additionalProperties: false
    V4HistoricalReservesBatchResponse:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/V4HistoricalReserveResponse'
      propertyNames:
        type: string
    V4HistoricalReserveResponse:
      type: object
      properties:
        pool_id:
          type:
            - string
            - 'null'
        block:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        reserves:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/V4HistoricalReserveData'
    V4HistoricalReserveData:
      type: object
      description: |-
        Reserves at a past block: raw and decimal amounts. USD values reflect
        current prices, so they are only on current reserves.
      required:
        - reserve0
        - reserve1
      properties:
        reserve0:
          type: string
        reserve1:
          type: string
        reserve0_decimal:
          type:
            - string
            - 'null'
        reserve1_decimal:
          type:
            - string
            - 'null'
        currency0_decimals:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
        currency1_decimals:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: Secret API key (`sk_*`) or JWT public key (`pk_jwt_*`).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.