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

# Get Quote

> API reference for GET /quote

<Info>
  We recommend using the [`/order`](/resources/trading-api/order/order) endpoint for new
  integrations. This endpoint is still available but `/order` is the preferred
  approach. For a code example, see the
  [Spot Quickstart](/spot/recipes/quickstart).
</Info>


## OpenAPI

````yaml GET /quote
openapi: 3.1.0
info:
  title: DFlow Aggregator
  description: DFlow Aggregator API
  license:
    name: BUSL-1.1
  version: 0.1.0
servers:
  - url: https://quote-api.dflow.net
security:
  - api_key: []
tags:
  - name: order
    description: Order API endpoints
  - name: swap
    description: Swap API endpoints
  - name: intent
    description: Intent trading endpoints
  - name: prediction_market
    description: Prediction market endpoints
  - name: venues
    description: Venue endpoints
  - name: tokens
    description: Token endpoints
paths:
  /quote:
    get:
      tags:
        - swap
      summary: Returns a quote for an imperative swap
      operationId: quote_handler
      parameters:
        - name: inputMint
          in: query
          description: Base58-encoded input mint address
          required: true
          schema:
            type: string
        - name: outputMint
          in: query
          description: Base58-encoded output mint address
          required: true
          schema:
            type: string
        - name: amount
          in: query
          description: Input amount as a scaled integer. For example, 1 SOL is 1000000000.
          required: true
          schema:
            type: integer
            format: int64
            minimum: 0
        - name: slippageBps
          in: query
          description: >-
            Max allowed slippage for the swap. Allowed values are:

            - a u16 which specifies the maximum allowed slippage in basis points

            - the string value "auto", where the server determines the maximum
            allowed slippage
              automatically
          required: false
          schema:
            $ref: '#/components/schemas/SlippageTolerance'
        - name: priceImpactTolerancePct
          in: query
          description: >-
            If specified, the API will return an error if the price impact of
            the route is greater than

            the specified percentage. If unspecified, the server will determine
            the threshold. For

            example, 10 is 10% and 100 is 100%.
          required: false
          schema:
            type: integer
            format: int32
            minimum: 0
        - name: dexes
          in: query
          description: >-
            Comma-separated list of DEXes to include. If not specified, all
            DEXes will be included.
          required: false
          schema:
            type: string
        - name: excludeDexes
          in: query
          description: >-
            Comma-separated list of DEXes to exclude. If not specified, all
            DEXes will be included.
          required: false
          schema:
            type: string
        - name: platformFeeBps
          in: query
          description: >-
            Optional platform fee in basis points. This should only be nonzero
            if the swap will collect

            the platform fee. The swap must specify a valid fee account and that
            fee account must be

            able to collect the fee mint at execution time.
          required: false
          schema:
            type: integer
            format: int32
            minimum: 0
        - name: platformFeeMode
          in: query
          description: >-
            Optional platform fee mode. If not specified, the default is
            `outputMint`.
          required: false
          schema:
            $ref: '#/components/schemas/PlatformFeeMode'
        - name: sponsoredSwap
          in: query
          description: >-
            This should be specified as true if and only if the quote will be
            used for a sponsored swap.

            If true, then the quote will account for any additional token 2022
            transfer fees that apply

            to the input and output mints for a sponsored swap.
          required: false
          schema:
            type: boolean
        - name: sponsorExec
          in: query
          description: >-
            The execution mode that will be used for the sponsored swap. This
            parameter is only relevant

            when `sponsoredSwap` is true. True indicates that the sponsor will
            be the executor of the

            swap. False indicates that the user will be the executor of the
            swap. Default is true.
          required: false
          schema:
            type: boolean
        - name: destinationSwap
          in: query
          description: >-
            This should be specified as true if and only if the quote will be
            used for a destination

            token account swap. If true, then the quote will account for any
            additional token 2022

            transfer fees that apply to the output mint for a destination token
            account swap.
          required: false
          schema:
            type: boolean
        - name: onlyDirectRoutes
          in: query
          description: If true, only use single-leg routes
          required: false
          schema:
            type: boolean
        - name: maxRouteLength
          in: query
          description: >-
            If specified, the route will be limited to the specified number of
            legs. Ignored if

            `only_direct_routes` is true.
          required: false
          schema:
            type: integer
            format: int32
            minimum: 0
        - name: onlyJitRoutes
          in: query
          description: >-
            If true, only use JIT routes. Every leg in the route will use the
            JIT router.
          required: false
          schema:
            type: boolean
        - name: forJitoBundle
          in: query
          description: >-
            If true, only use routes that are compatible with Jito bundles. This
            should only be

            specified as true if the swap will be executed in a Jito bundle.
            Default is false.
          required: false
          schema:
            type: boolean
        - name: skipPumpfunCashbackClaim
          in: query
          description: >-
            If true, Pump.fun cashback will not be claimed for cashback-eligible
            coins. When set, sell

            quotes include the full creator fee, and execution skips Pump.fun
            cashback claiming. Default

            is false. Cannot be used with sponsor-executed swaps (`sponsorExec`
            is true or defaulted to

            true).
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: Imperative swap quote
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuoteResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuoteBadRequestResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuoteInternalServerErrorResponse'
        '503':
          description: Service unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuoteServiceUnavailableResponse'
components:
  schemas:
    SlippageTolerance:
      oneOf:
        - type: integer
          format: int32
          description: Slippage tolerance specified in basis points
          minimum: 0
        - type: string
          description: Slippage tolerance will be determined by the server
          enum:
            - auto
    PlatformFeeMode:
      type: string
      enum:
        - outputMint
        - inputMint
    QuoteResponse:
      type: object
      required:
        - inputMint
        - inAmount
        - outputMint
        - outAmount
        - otherAmountThreshold
        - minOutAmount
        - slippageBps
        - priceImpactPct
        - routePlan
        - contextSlot
      properties:
        contextSlot:
          type: integer
          format: int64
          description: Slot at which the request was evaluated
          minimum: 0
        forJitoBundle:
          type: boolean
          description: True if and only if the request was for a Jito bundle
        inAmount:
          type: string
          description: >-
            Maximum input amount as a scaled integer. For example, 1 SOL is
            1000000000.
        inputMint:
          type: string
          description: Base58-encoded input mint address
        minOutAmount:
          type: string
          description: Same as `other_amount_threshold`
        otherAmountThreshold:
          type: string
          description: >-
            Minimum output amount after all fees as a scaled integer. If the
            swap transaction doesn't

            produce at least this amount of the output token, the transaction
            will fail.
        outAmount:
          type: string
          description: >-
            Expected output amount after all fees as a scaled integer. For
            example, 1 SOL is 1000000000.
        outTransferFee:
          type: string
          description: Transfer fee amount that was applied to the quote, if any
        outputMint:
          type: string
          description: Base58-encoded output mint address
        platformFee:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/PlatformFee'
              description: Platform fee that was applied to the quote, if any
        priceImpactPct:
          type: string
          description: >-
            Price impact of the swap. This is an estimate of the percentage
            difference between the

            expected price for the swap and the price for the same swap with the
            smallest input amount

            possible. For example, "0.01" means 1% price impact.
        requestId:
          type: string
          description: Identifier for the request
        routePlan:
          type: array
          items:
            $ref: '#/components/schemas/RoutePlanLeg'
          description: Route that the swap will take
        routingSlot:
          type: integer
          format: int64
          description: Slot of the market state used to compute the quote
          minimum: 0
        simulatedComputeUnits:
          type: integer
          format: int32
          description: Compute units consumed by quote simulation
          minimum: 0
        skipPumpfunCashbackClaim:
          type: boolean
          description: >-
            True if and only if Pump.fun cashback claiming was skipped for this
            quote
        slippageBps:
          type: integer
          format: int32
          description: Max allowed slippage % in basis points
          minimum: 0
    QuoteBadRequestResponse:
      type: object
      required:
        - msg
        - code
      properties:
        code:
          $ref: '#/components/schemas/QuoteBadRequestCode'
        contextSlot:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        msg:
          type: string
        routingSlot:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
      example:
        code: <enum<string>>
        msg: <string>
    QuoteInternalServerErrorResponse:
      type: object
      required:
        - msg
        - code
      properties:
        code:
          $ref: '#/components/schemas/QuoteInternalServerErrorCode'
        contextSlot:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        msg:
          type: string
        routingSlot:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
      example:
        code: <enum<string>>
        msg: <string>
    QuoteServiceUnavailableResponse:
      type: object
      required:
        - msg
        - code
      properties:
        code:
          $ref: '#/components/schemas/QuoteServiceUnavailableCode'
        msg:
          type: string
      example:
        code: <enum<string>>
        msg: <string>
    PlatformFee:
      type: object
      required:
        - amount
        - feeBps
        - mode
      properties:
        amount:
          type: string
          description: >-
            Platform fee as a scaled integer. For example, 1 SOL is 1000000000.
            For output mint fees,

            this is the expected amount that will be paid, but the exact amount
            will vary depending on

            how much output the swap produces. For input mint fees, this is the
            exact amount that will

            be paid.
        feeBps:
          type: integer
          format: int32
          description: Platform fee in basis points
          minimum: 0
        mode:
          $ref: '#/components/schemas/PlatformFeeMode'
          description: Mode for the platform fee
    RoutePlanLeg:
      oneOf:
        - $ref: '#/components/schemas/DynamicRoutePlanLeg'
        - $ref: '#/components/schemas/SingleMarketRoutePlanLeg'
    QuoteBadRequestCode:
      type: string
      enum:
        - requested_input_amount_is_zero
        - invalid_input_mint
        - invalid_output_mint
        - same_input_and_output_mint
        - invalid_slippage_bps
        - invalid_platform_fee_bps
        - invalid_dex
        - invalid_max_route_length_for_jit_route
        - cannot_exclude_jit_router_for_jit_route
        - route_not_found
        - use_order_endpoint_for_prediction_markets
        - price_impact_too_high
        - invalid_price_impact_tolerance_pct
    QuoteInternalServerErrorCode:
      type: string
      enum:
        - failed_to_compute_route
    QuoteServiceUnavailableCode:
      type: string
      enum:
        - amm_map_not_initialized
        - amm_map_lagging
    DynamicRoutePlanLeg:
      type: object
      required:
        - venue
        - marketKey
        - data
        - inputMint
        - outputMint
        - inAmount
        - outAmount
        - inputMintDecimals
        - outputMintDecimals
      properties:
        data:
          type: string
          description: Data for the leg
        inAmount:
          type: string
          description: >-
            Maximum input amount for the leg as a scaled integer. For example, 1
            SOL is 1000000000.
        inputMint:
          type: string
          description: Base58-encoded input mint address
        inputMintDecimals:
          type: integer
          format: int32
          description: Decimals for the input mint
          minimum: 0
        marketKey:
          type: string
          description: Key identifying the market on the venue
        outAmount:
          type: string
          description: >-
            Expected output amount for the leg as a scaled integer. For example,
            1 SOL is 1000000000.
        outputMint:
          type: string
          description: Base58-encoded output mint address
        outputMintDecimals:
          type: integer
          format: int32
          description: Decimals for the output mint
          minimum: 0
        venue:
          type: string
          description: Venue for the leg
    SingleMarketRoutePlanLeg:
      type: object
      required:
        - venue
        - marketKey
        - inputMint
        - outputMint
        - inAmount
        - outAmount
        - inputMintDecimals
        - outputMintDecimals
      properties:
        inAmount:
          type: string
          description: >-
            Maximum input amount for the leg as a scaled integer. For example, 1
            SOL is 1000000000.
        inputMint:
          type: string
          description: Base58-encoded input mint address
        inputMintDecimals:
          type: integer
          format: int32
          description: Decimals for the input mint
          minimum: 0
        marketKey:
          type: string
          description: Key identifying the market on the venue
        outAmount:
          type: string
          description: >-
            Expected output amount for the leg as a scaled integer. For example,
            1 SOL is 1000000000.
        outputMint:
          type: string
          description: Base58-encoded output mint address
        outputMintDecimals:
          type: integer
          format: int32
          description: Decimals for the output mint
          minimum: 0
        venue:
          type: string
          description: Venue for the leg
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. Contact hello@dflow.net to obtain an API
        key.

````