GET
/
v0
/
uniswap
/
quote
/
buy_exactly
/
get
from compass_api_sdk import CompassAPI, models


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

    res = compass_api.uniswap_v3.quote_buy_exactly(chain=models.UniswapQuoteBuyExactlyChain.ARBITRUM_MAINNET, token_in=models.UniswapQuoteBuyExactlyTokenInToken.USDC, token_out=models.UniswapQuoteBuyExactlyTokenOutToken.USDT, fee=models.UniswapQuoteBuyExactlyFeeEnum.ZERO_DOT_01, amount_out="<value>")

    # Handle response
    print(res)
{
  "amount_in": "<string>",
  "price_after": "<string>"
}

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Query Parameters

chain
enum<string>
default:arbitrum:mainnet
required

The chain to use.

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

The symbol of the token to swap from.

Available options:
1INCH,
AAVE,
BAL,
cbBTC,
cbETH,
CRV,
crvUSD,
DAI,
ENS,
ETHx,
FRAX,
FXS,
GHO,
KNC,
LDO,
LINK,
LUSD,
MKR,
osETH,
PYUSD,
rETH,
RPL,
rsETH,
sDAI,
SNX,
STG,
sUSDe,
tBTC,
UNI,
USDC,
USDe,
USDS,
USDT,
WBTC,
weETH,
WETH,
wstETH,
ARB,
EURS,
MAI,
USDCe,
AERO,
EUR,
VIRTUAL
token_out
enum<string>
default:USDT
required

The symbol of the token to swap to.

Available options:
1INCH,
AAVE,
BAL,
cbBTC,
cbETH,
CRV,
crvUSD,
DAI,
ENS,
ETHx,
FRAX,
FXS,
GHO,
KNC,
LDO,
LINK,
LUSD,
MKR,
osETH,
PYUSD,
rETH,
RPL,
rsETH,
sDAI,
SNX,
STG,
sUSDe,
tBTC,
UNI,
USDC,
USDe,
USDS,
USDT,
WBTC,
weETH,
WETH,
wstETH,
ARB,
EURS,
MAI,
USDCe,
AERO,
EUR,
VIRTUAL
fee
enum<string>
default:0.01
required

The fee to pay for the swap

Available options:
0.01,
0.05,
0.3,
1.0
amount_out
default:1
required

The amount of the token to swap to

Required range: x > 0

Response

200
application/json

Successful Response

The response is of type object.