Skip to main content
GET
Python (SDK)

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Query Parameters

chain
enum<string>
default:base
required

Target blockchain network.

Available options:
arbitrum,
base,
bsc,
ethereum,
hyperevm,
tempo
token_in
string
default:WETH
required

Token to sell (input). A token symbol (e.g. 'WETH') or any token address.

token_out
string
default:USDC

Token to buy (output). A token symbol (e.g. 'USDC') or any token address.

sy_address
string | null

Optional Pendle SY (Standardized Yield) address. When provided, token_in is overridden with the token the PT actually redeems into on withdrawal (the SY asset if it is a valid token-out, else the SY yield token) — use this to gauge a Pendle position's real exit liquidity rather than the reported underlying.

amount_in
default:1
required

Human-readable amount of token_in to quote (token units, not wei).

Required range: x > 0
slippage
default:1.0

Maximum slippage tolerance as a percentage (e.g., 1 = 1%).

Required range: x >= 0

Response

Successful Response

Estimated output of a read-only swap quote.

amount_out
string
required

Estimated amount of token_out received, in human-readable units. On the market route, zero when no route / insufficient liquidity exists for the pair (a definitive answer). On the firm route (HyperEVM) a missing or short price book is a 409 instead, never a zero: unlike a missing route it is transient, so retry.

token_in
string
required

The token address actually quoted as input. Usually the requested token_in; for Pendle (when sy_address is supplied) it is the resolved redeem token, which callers should use to value the input.

token_out
string
required

The token address quoted as output — what amount_out is denominated in (the resolved token_out from the request).

swap_provider
enum<string>
default:market

Which route priced the estimate. 'market': the market aggregator's price-only quote. 'firm': an INDICATIVE price from the firm provider's live levels (HyperEVM), computed without spending a quote; the executable build fetches the firm quote itself. When those levels cannot price amount_in the endpoint answers 409 rather than a zero amount_out.

Available options:
market,
firm