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

> Returns the latest sqrt price, tick, and liquidity for a Uniswap pool.

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

```json Response (Long) theme={null}
{
  "pool_id": "0x1111111111111111111111111111111111111111111111111111111111111111",
  "block": 22100000,
  "state": {
    "sqrt_price_x96": "12345678901234567890",
    "tick": -120,
    "liquidity": "1000000000"
  }
}
```

```jsonc Response (Short) theme={null}
{
  "p": "0x1111111111111111111111111111111111111111111111111111111111111111",
  "b": 22100000,
  "st": {
    "sp": "12345678901234567890",
    "tk": -120,
    "lq": "1000000000"
  }
}
```


## OpenAPI

````yaml onchain-openapi.json GET /uniswap/pools/{pool}/state
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}/state:
    get:
      tags:
        - Uniswap
      summary: Uniswap pool state
      description: Returns the latest sqrt price, tick, and liquidity for a Uniswap pool.
      operationId: get_uniswap_pool_state
      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 state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V4ClStateResponse'
              examples:
                long:
                  summary: Response (Long)
                  value:
                    pool_id: >-
                      0x1111111111111111111111111111111111111111111111111111111111111111
                    block: 22100000
                    state:
                      sqrt_price_x96: '12345678901234567890'
                      tick: -120
                      liquidity: '1000000000'
                short:
                  summary: Response (Short)
                  value:
                    p: >-
                      0x1111111111111111111111111111111111111111111111111111111111111111
                    b: 22100000
                    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
    V4ClStateResponse:
      type: object
      properties:
        pool_id:
          type:
            - string
            - 'null'
        block:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        state:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/V4ClPoolStateData'
    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.