Skip to main content
POST
Get Swap Quote

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json

Request for swap price quote

connector
string
required

DEX router connector (e.g., 'jupiter', '0x')

network
string
required

Network ID in 'chain-network' format (e.g., 'solana-mainnet-beta', 'ethereum-mainnet')

trading_pair
string
required

Trading pair in BASE-QUOTE format (e.g., 'SOL-USDC')

side
string
required

Trade side: 'BUY' or 'SELL'

amount
required

Amount denominated in the BASE token (SELL: base to sell; BUY: base to receive — Gateway quotes BUY as ExactOut)

slippage_pct

Maximum slippage percentage; omit to use the connector's configured slippagePct

extra_params
Extra Params · object | null

Connector-specific params passed through to Gateway under its own names: approximateIfNoExactOut (Solana routers). Unknown keys are rejected.

Response

Successful Response

Swap quote, re-framed from Gateway's token-flow response into trading-pair terms.

Gateway's quote-swap routes speak tokenIn/tokenOut; this keeps the base/quote + side framing bots use and passes Gateway's execution-safety fields through in snake_case. No gas estimate: Gateway's quote does not return one.

base
string
required

Base token symbol

quote
string
required

Quote token symbol

price
string
required

Quoted price (base/quote)

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
amount
string
required

Amount specified in request (BUY: base amount to receive, SELL: base amount to sell)

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
amount_in
string | null

Actual input amount (BUY: quote to spend, SELL: base to sell)

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
amount_out
string | null

Actual output amount (BUY: base to receive, SELL: quote to receive)

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
min_amount_out
string | null

Minimum output the transaction will accept after slippage

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
max_amount_in
string | null

Maximum input the transaction will spend after slippage

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
price_impact_pct
string | null

Price impact of this trade size on the route

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
pool_address
string | null

Pool the quote was priced against

route_path
string | null

Route taken (router connectors)

slippage_pct
string | null

Slippage percentage Gateway applied to the quote (the request value when Gateway omits it)

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
quote_id
string | null

Identifier for this quote, on the router connectors that hold a price. Pass it to /swap/execute-quote to execute THIS quote instead of re-pricing. Absent on pool-scoped connectors, which price against the pool at execution time.

approximation
boolean | null

True when amount_out is an ESTIMATE rather than the exact-out amount asked for. A BUY is an ExactOut order, and many thin tokens have no ExactOut route, so Gateway falls back to quoting the sell leg and then quoting that input forward — which pays the pool fee and crosses the spread twice. Measured at a near-constant ~2.5% across eleven pools spanning $17 to $1,963 of liquidity, and it is reached for ONLY on the thin, high-fee pools where it hurts most. The caller is not overcharged; the order is silently resized, which is what matters to a strategy that asked for a specific quantity. Set extra_params={'approximateIfNoExactOut': false} to require an exact route.