POST
/
v0
/
uniswap
/
quote
/
sell_exactly
/
get
curl --request POST \
  --url https://api.compasslabs.ai/v0/uniswap/quote/sell_exactly/get \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "chain": "arbitrum:mainnet",
  "token_in": "USDC",
  "token_out": "USDT",
  "fee": "0.01",
  "amount_in": 1
}'
{
  "amount_out": "<string>",
  "price_after": "<string>"
}

Authorizations

x-api-key
string
header
required

Your Compass API key. Get your key here.

Body

application/json
chain
enum<string>
required

The chain to use.

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

The symbol of the token to swap from Note the supported tokens per chain.

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

The symbol of the token to swap to Note the supported tokens per chain.

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

The fee to pay for the swap

Available options:
0.01,
0.05,
0.3,
1.0
amount_in
required

The amount of the token to swap from

Required range: x > 0
Example:

1.5

Response

200
application/json
Successful Response
amount_out
string
required

The amount of token_out you would receive from the pool.

price_after
string
required

The price of the pool after this trade would happen. (How much token0 you need to buy 1 token1.)