> ## Documentation Index
> Fetch the complete documentation index at: https://condor.hummingbot.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Swap Quote

> Get a price quote for a swap.

Example:
    connector: 'jupiter' (or typed: 'jupiter/router', 'meteora/clmm', 'raydium/amm')
    network: 'solana-mainnet-beta'
    trading_pair: 'SOL-USDC'
    side: 'BUY'
    amount: 1
    slippage_pct: 1  (optional; omit to use the connector's configured slippagePct)
    extra_params: {"approximateIfNoExactOut": false}  # Solana routers

Returns:
    Quote with price, expected output amount, and execution-safety fields



## OpenAPI

````yaml /api-reference/openapi.json post /gateway/swap/quote
openapi: 3.1.0
info:
  title: Hummingbot API
  description: API for managing Hummingbot trading instances
  version: 1.0.1
servers:
  - url: http://localhost:8000
    description: Local development server
security: []
paths:
  /gateway/swap/quote:
    post:
      tags:
        - Gateway Swaps
      summary: Get Swap Quote
      description: |-
        Get a price quote for a swap.

        Example:
            connector: 'jupiter' (or typed: 'jupiter/router', 'meteora/clmm', 'raydium/amm')
            network: 'solana-mainnet-beta'
            trading_pair: 'SOL-USDC'
            side: 'BUY'
            amount: 1
            slippage_pct: 1  (optional; omit to use the connector's configured slippagePct)
            extra_params: {"approximateIfNoExactOut": false}  # Solana routers

        Returns:
            Quote with price, expected output amount, and execution-safety fields
      operationId: get_swap_quote_gateway_swap_quote_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SwapQuoteRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SwapQuoteResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBasic: []
components:
  schemas:
    SwapQuoteRequest:
      properties:
        connector:
          type: string
          title: Connector
          description: DEX router connector (e.g., 'jupiter', '0x')
        network:
          type: string
          title: Network
          description: >-
            Network ID in 'chain-network' format (e.g., 'solana-mainnet-beta',
            'ethereum-mainnet')
        trading_pair:
          type: string
          title: Trading Pair
          description: Trading pair in BASE-QUOTE format (e.g., 'SOL-USDC')
        side:
          type: string
          title: Side
          description: 'Trade side: ''BUY'' or ''SELL'''
        amount:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
          description: >-
            Amount denominated in the BASE token (SELL: base to sell; BUY: base
            to receive — Gateway quotes BUY as ExactOut)
        slippage_pct:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Slippage Pct
          description: >-
            Maximum slippage percentage; omit to use the connector's configured
            slippagePct
        extra_params:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Extra Params
          description: >-
            Connector-specific params passed through to Gateway under its own
            names: approximateIfNoExactOut (Solana routers). Unknown keys are
            rejected.
      type: object
      required:
        - connector
        - network
        - trading_pair
        - side
        - amount
      title: SwapQuoteRequest
      description: Request for swap price quote
    SwapQuoteResponse:
      properties:
        base:
          type: string
          title: Base
          description: Base token symbol
        quote:
          type: string
          title: Quote
          description: Quote token symbol
        price:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Price
          description: Quoted price (base/quote)
        amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
          description: >-
            Amount specified in request (BUY: base amount to receive, SELL: base
            amount to sell)
        amount_in:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Amount In
          description: 'Actual input amount (BUY: quote to spend, SELL: base to sell)'
        amount_out:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Amount Out
          description: 'Actual output amount (BUY: base to receive, SELL: quote to receive)'
        min_amount_out:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Min Amount Out
          description: Minimum output the transaction will accept after slippage
        max_amount_in:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Max Amount In
          description: Maximum input the transaction will spend after slippage
        price_impact_pct:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Price Impact Pct
          description: Price impact of this trade size on the route
        pool_address:
          anyOf:
            - type: string
            - type: 'null'
          title: Pool Address
          description: Pool the quote was priced against
        route_path:
          anyOf:
            - type: string
            - type: 'null'
          title: Route Path
          description: Route taken (router connectors)
        slippage_pct:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Slippage Pct
          description: >-
            Slippage percentage Gateway applied to the quote (the request value
            when Gateway omits it)
        quote_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Quote Id
          description: >-
            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:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Approximation
          description: >-
            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.
      type: object
      required:
        - base
        - quote
        - price
        - amount
      title: SwapQuoteResponse
      description: >-
        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.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBasic:
      type: http
      scheme: basic

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.