GET
/
v1
/
uniswap
/
quote
/
buy_exactly
Typescript (SDK)
import { CompassApiSDK } from "@compass-labs/api-sdk";

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

async function run() {
  const result = await compassApiSDK.uniswapV3.uniswapQuoteBuyExactly({
    amountOut: 9572.21,
  });

  console.log(result);
}

run();
{
  "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
required
Available options:
arbitrum,
base,
ethereum
token_in
enum<string>
default:USDC
required

The symbol of the token to swap from.

Available options:
1INCH,
AAVE,
AERO,
ARB,
BAL,
BNKR,
cbBTC,
cbETH,
CLANKER,
COPI,
CRV,
crvUSD,
CYBER,
DAI,
DOGINME,
eBTC,
ENS,
ETH,
ETHFI,
ETHx,
EURC,
EUR,
EURS,
eUSDe,
ezETH,
FBTC,
FRAX,
FXS,
GHO,
KNC,
LBTC,
LDO,
LINK,
LsETH,
LUSD,
MAI,
MKR,
osETH,
PT-eUSDE-14AUG2025,
PT-eUSDE-29MAY2025,
PT-sUSDE-25SEP2025,
PT-sUSDE-31JUL2025,
PT-USDe-31JUL2025,
PYUSD,
rETH,
RLUSD,
RPL,
rsETH,
sDAI,
SNX,
STG,
sUSDe,
tBTC,
UNI,
USDbC,
USDCe,
USDC,
USDe,
USDS,
USDtb,
USDT,
VIRTUAL,
WBTC,
weETH,
WELL,
WETH,
wrsETH,
wstETH
token_out
enum<string>
default:USDT
required

The symbol of the token to swap to.

Available options:
1INCH,
AAVE,
AERO,
ARB,
BAL,
BNKR,
cbBTC,
cbETH,
CLANKER,
COPI,
CRV,
crvUSD,
CYBER,
DAI,
DOGINME,
eBTC,
ENS,
ETH,
ETHFI,
ETHx,
EURC,
EUR,
EURS,
eUSDe,
ezETH,
FBTC,
FRAX,
FXS,
GHO,
KNC,
LBTC,
LDO,
LINK,
LsETH,
LUSD,
MAI,
MKR,
osETH,
PT-eUSDE-14AUG2025,
PT-eUSDE-29MAY2025,
PT-sUSDE-25SEP2025,
PT-sUSDE-31JUL2025,
PT-USDe-31JUL2025,
PYUSD,
rETH,
RLUSD,
RPL,
rsETH,
sDAI,
SNX,
STG,
sUSDe,
tBTC,
UNI,
USDbC,
USDCe,
USDC,
USDe,
USDS,
USDtb,
USDT,
VIRTUAL,
WBTC,
weETH,
WELL,
WETH,
wrsETH,
wstETH
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.