> ## 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.

# Uniswap pool

> Returns pool metadata, the latest reserve snapshot, and price/liquidity state for a Uniswap pool.

```bash theme={null}
curl "https://staging-api.struct.to/v1/uniswap/pools/{pool}?chain=base&chain_id=8453&protocol=v4&fields=short" \
  -H "X-API-Key: YOUR_API_KEY"
```

```json Response (Long) theme={null}
{
  "protocol": "UniswapV4",
  "pool_id": "0x1111111111111111111111111111111111111111111111111111111111111111",
  "block": 22100000,
  "initialized": true,
  "metadata": {
    "protocol": "UniswapV4",
    "pool_id": "0x1111111111111111111111111111111111111111111111111111111111111111",
    "currency0": "0x0000000000000000000000000000000000000000",
    "currency1": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "fee": 3000,
    "tick_spacing": 60,
    "hooks": "0x0000000000000000000000000000000000000000",
    "creation_block": 22090000,
    "creation_timestamp": 1709990000000,
    "creator": "0x12a371444CCeBb6B64Cc35EBbC70d1d998433d51"
  },
  "reserves": {
    "reserve0": "934064700000000000000",
    "reserve1": "2322765870000",
    "reserve0_decimal": "934.0647",
    "reserve1_decimal": "2322765.87",
    "reserve0_usd": "2310871.22",
    "reserve1_usd": "2322765.87",
    "reserves_usd": "4633637.09",
    "currency0_decimals": 18,
    "currency1_decimals": 6,
    "currency0_price_usd": "2474.05",
    "currency1_price_usd": "1.00"
  },
  "cl_state": {
    "sqrt_price_x96": "12345678901234567890",
    "tick": -120,
    "liquidity": "1000000000"
  }
}
```

```jsonc Response (Short) theme={null}
{
  "pr": "UniswapV4",
  "p": "0x1111111111111111111111111111111111111111111111111111111111111111",
  "b": 22100000,
  "i": true,
  "md": {
    "pr": "UniswapV4",
    "p": "0x1111111111111111111111111111111111111111111111111111111111111111",
    "c0": "0x0000000000000000000000000000000000000000",
    "c1": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "f": 3000,
    "ts": 60,
    "h": "0x0000000000000000000000000000000000000000",
    "cb": 22090000,
    "ct": 1709990000000,
    "cr": "0x12a371444CCeBb6B64Cc35EBbC70d1d998433d51"
  },
  "r": {
    "r0": "934064700000000000000",
    "r1": "2322765870000",
    "d0": "934.0647",
    "d1": "2322765.87",
    "u0": "2310871.22",
    "u1": "2322765.87",
    "ru": "4633637.09",
    "c0": 18,
    "c1": 6,
    "p0": "2474.05",
    "p1": "1.00"
  },
  "st": {
    "sp": "12345678901234567890",
    "tk": -120,
    "lq": "1000000000"
  }
}
```


## OpenAPI

````yaml onchain-openapi.json GET /uniswap/pools/{pool}
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/pools/{pool}:
    get:
      tags:
        - Uniswap
      summary: Uniswap pool
      description: >-
        Returns pool metadata, the latest reserve snapshot, and price/liquidity
        state for a Uniswap pool.
      operationId: get_uniswap_pool
      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: pool
          in: path
          description: 'Pool identifier: a Uniswap V3 pool address or a 32-byte V4 pool id.'
          required: true
          schema:
            type: string
        - name: protocol
          in: query
          description: 'Uniswap version: v3 or v4. Omit to infer from the 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
      responses:
        '200':
          description: Uniswap pool data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V4PoolResponse'
              examples:
                long:
                  summary: Response (Long)
                  value:
                    protocol: UniswapV4
                    pool_id: >-
                      0x1111111111111111111111111111111111111111111111111111111111111111
                    block: 22100000
                    initialized: true
                    metadata:
                      protocol: UniswapV4
                      pool_id: >-
                        0x1111111111111111111111111111111111111111111111111111111111111111
                      currency0: '0x0000000000000000000000000000000000000000'
                      currency1: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
                      fee: 3000
                      tick_spacing: 60
                      hooks: '0x0000000000000000000000000000000000000000'
                      creation_block: 22090000
                      creation_timestamp: 1709990000000
                      creator: '0x12a371444CCeBb6B64Cc35EBbC70d1d998433d51'
                    reserves:
                      reserve0: '934064700000000000000'
                      reserve1: '2322765870000'
                      reserve0_decimal: '934.0647'
                      reserve1_decimal: '2322765.87'
                      reserve0_usd: '2310871.22'
                      reserve1_usd: '2322765.87'
                      reserves_usd: '4633637.09'
                      currency0_decimals: 18
                      currency1_decimals: 6
                      currency0_price_usd: '2474.05'
                      currency1_price_usd: '1.00'
                    cl_state:
                      sqrt_price_x96: '12345678901234567890'
                      tick: -120
                      liquidity: '1000000000'
                short:
                  summary: Response (Short)
                  value:
                    pr: UniswapV4
                    p: >-
                      0x1111111111111111111111111111111111111111111111111111111111111111
                    b: 22100000
                    i: true
                    md:
                      pr: UniswapV4
                      p: >-
                        0x1111111111111111111111111111111111111111111111111111111111111111
                      c0: '0x0000000000000000000000000000000000000000'
                      c1: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
                      f: 3000
                      ts: 60
                      h: '0x0000000000000000000000000000000000000000'
                      cb: 22090000
                      ct: 1709990000000
                      cr: '0x12a371444CCeBb6B64Cc35EBbC70d1d998433d51'
                    r:
                      r0: '934064700000000000000'
                      r1: '2322765870000'
                      d0: '934.0647'
                      d1: '2322765.87'
                      u0: '2310871.22'
                      u1: '2322765.87'
                      ru: '4633637.09'
                      c0: 18
                      c1: 6
                      p0: '2474.05'
                      p1: '1.00'
                    st:
                      sp: '12345678901234567890'
                      tk: -120
                      lq: '1000000000'
        '400':
          description: Validation error, usually invalid chain or pool.
        '503':
          description: Uniswap data is unavailable for the requested chain.
components:
  schemas:
    UniswapProtocol:
      type: string
      description: 'Uniswap version: v3 or v4.'
      enum:
        - v3
        - v4
    V4PoolResponse:
      type: object
      properties:
        protocol:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/UniswapFamily'
        pool_id:
          type:
            - string
            - 'null'
        block:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        initialized:
          type:
            - boolean
            - 'null'
        metadata:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/V4PoolMetadata'
        reserves:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/V4ReserveData'
        cl_state:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/V4ClPoolStateData'
    UniswapFamily:
      type: string
      description: Uniswap V3 or Uniswap V4.
      enum:
        - UniswapV3
        - UniswapV4
    V4PoolMetadata:
      type: object
      required:
        - protocol
        - pool_id
        - currency0
        - currency1
        - fee
        - hooks
      properties:
        protocol:
          $ref: '#/components/schemas/UniswapFamily'
        pool_id:
          type: string
        currency0:
          type: string
        currency1:
          type: string
        fee:
          type: integer
          format: int32
          minimum: 0
        tick_spacing:
          type:
            - integer
            - 'null'
          format: int32
        parameters:
          type:
            - string
            - 'null'
        pool_type:
          type:
            - string
            - 'null'
        hooks:
          type: string
        creation_block:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        creation_timestamp:
          type:
            - integer
            - 'null'
          format: int64
          description: Pool creation block time, in Unix milliseconds.
          minimum: 0
        creator:
          type:
            - string
            - 'null'
    V4ReserveData:
      type: object
      required:
        - reserve0
        - reserve1
      properties:
        reserve0:
          type: string
        reserve1:
          type: string
        reserve0_decimal:
          type:
            - string
            - 'null'
        reserve1_decimal:
          type:
            - string
            - 'null'
        reserve0_usd:
          type:
            - string
            - 'null'
        reserve1_usd:
          type:
            - string
            - 'null'
        reserves_usd:
          type:
            - string
            - 'null'
        currency0_decimals:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
        currency1_decimals:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
        currency0_price_usd:
          type:
            - string
            - 'null'
        currency1_price_usd:
          type:
            - string
            - 'null'
    V4ClPoolStateData:
      type: object
      required:
        - sqrt_price_x96
        - tick
        - liquidity
      properties:
        sqrt_price_x96:
          type: string
        tick:
          type: integer
          format: int32
        liquidity:
          type: string
  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.