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

# Pool Price

> This endpoint calculates the price of a token in a Uniswap pool.

The price is calculated based on the current pool state and the specified fee tier.



## OpenAPI

````yaml /v1/combined_spec.json get /v1/uniswap/pool_price
openapi: 3.1.0
info:
  title: Compass API
  description: Compass Labs DeFi API
  version: 0.0.1
servers:
  - url: https://api.compasslabs.ai
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /v1/uniswap/pool_price:
    get:
      tags:
        - Uniswap V3
      summary: Pool Price
      description: >-
        This endpoint calculates the price of a token in a Uniswap pool.


        The price is calculated based on the current pool state and the
        specified fee tier.
      operationId: v1_uniswap_pool_price
      parameters:
        - name: chain
          in: query
          required: true
          schema:
            type: string
            enum:
              - arbitrum
              - base
              - ethereum
            title: Chain
            default: arbitrum
        - name: token_in
          in: query
          required: true
          schema:
            type: string
            title: Token In
            description: >-
              A token identifier - either a supported symbol (e.g., USDC, WETH)
              or a valid Ethereum address (0x...)
            examples:
              - USDC
              - WETH
              - '0xA0b86a33E6441ccF30EE5DdEF1E9b652C91ac1c8'
            default: USDC
          description: The symbol or address of a token in the pool
        - name: token_out
          in: query
          required: true
          schema:
            type: string
            title: Token Out
            description: >-
              A token identifier - either a supported symbol (e.g., USDC, WETH)
              or a valid Ethereum address (0x...)
            examples:
              - USDC
              - WETH
              - '0xA0b86a33E6441ccF30EE5DdEF1E9b652C91ac1c8'
            default: USDT
          description: The symbol or address of a token in the pool
        - name: fee
          in: query
          required: true
          schema:
            type: string
            enum:
              - '0.01'
              - '0.05'
              - '0.3'
              - '1.0'
            title: FeeEnum
            description: |-
              The transaction fee of a Uniswap pool in bips.

              Uniswap supports 4 different fee levels.
            default: '0.01'
          description: The fee of the pool
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UniswapPoolPriceResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from compass_api_sdk import CompassAPI, models


            with CompassAPI(
                api_key_auth="<YOUR_API_KEY_HERE>",
            ) as compass_api:

                res = compass_api.uniswap_v3.uniswap_pool_price(chain=models.V1UniswapPoolPriceChain.ARBITRUM, token_in="USDC", token_out="USDC", fee=models.V1UniswapPoolPriceFeeEnum.ZERO_DOT_01)

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { CompassApiSDK } from "@compass-labs/api-sdk";

            const compassApiSDK = new CompassApiSDK({
              apiKeyAuth: "<YOUR_API_KEY_HERE>",
            });

            async function run() {
              const result = await compassApiSDK.uniswapV3.uniswapPoolPrice({
                chain: "arbitrum",
                tokenIn: "USDC",
                tokenOut: "USDC",
                fee: "0.01",
              });

              console.log(result);
            }

            run();
components:
  schemas:
    UniswapPoolPriceResponse:
      properties:
        token_in:
          type: string
          title: Token In
          description: The first token in the pool
        token_out:
          type: string
          title: Token Out
          description: The second token in the pool
        price:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Price
          description: >-
            The price of the pool. This is expressed as an instantanteous amount
            of how many token0 you need to buy 1 token1. In any swap this will
            not change during the trade; use the quote endpoint to get a better
            idea of how much you will pay!
        tick:
          type: integer
          title: Tick
          description: >-
            The current tick in the pool. This is a number that represents the
            price of the pool according to the uniswap v3 concentrated liquidity
            concept.
      type: object
      required:
        - token_in
        - token_out
        - price
        - tick
      title: UniswapPoolPriceResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your Compass API Key. Get your key
        [here](https://www.compasslabs.ai/dashboard).

````