Skip to main content
GET
/
v1
/
uniswap
/
pool_price
Python (SDK)
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)
{
  "token_in": "<string>",
  "token_out": "<string>",
  "price": "<string>",
  "tick": 123
}

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Query Parameters

chain
enum<string>
default:arbitrum
required
Available options:
arbitrum,
base,
ethereum
token_in
string
default:USDC
required

The symbol or address of a token in the pool

Examples:

"USDC"

"WETH"

"0xA0b86a33E6441ccF30EE5DdEF1E9b652C91ac1c8"

token_out
string
default:USDT
required

The symbol or address of a token in the pool

Examples:

"USDC"

"WETH"

"0xA0b86a33E6441ccF30EE5DdEF1E9b652C91ac1c8"

fee
enum<string>
default:0.01
required

The fee of the pool

Available options:
0.01,
0.05,
0.3,
1.0

Response

Successful Response

token_in
string
required

The first token in the pool

token_out
string
required

The second token in the pool

price
string
required

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
integer
required

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.