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

# Fetch any-token-to-any-token quotes

> Returns one or more solver quotes for an exact-input cross-chain swap between any supported source token and any supported destination token, via api.eco.com.



## OpenAPI

````yaml eco-swap-quote-api.openapi.yaml POST /quotes/v3/quotes/exactIn/swap
openapi: 3.1.0
info:
  title: Eco Protocol Any-Token Swap Quote API
  version: 0.2.0
  description: |
    General-purpose quote endpoint that returns solver quotes for
    an exact-input cross-chain swap between **any** supported source token
    and **any** supported destination token.

    Solvers are matched by chain pair (no registered token route required),
    and only solvers granted the `SWAPS` capability by an Eco admin receive
    swap quote requests.

    Authentication: every request must include an `x-api-key` header with a
    valid Eco API key.
servers:
  - url: https://api.eco.com
    description: Eco production
security:
  - ApiKeyAuth: []
paths:
  /quotes/v3/quotes/exactIn/swap:
    post:
      summary: Fetch any-token-to-any-token exact-input quotes
      description: |
        Returns an array of solver quotes for swapping `sourceAmount` of
        `sourceToken` on `sourceChainID` into `destinationToken` on
        `destinationChainID`.

        Slippage tolerance is applied to each swap leg (source and/or
        destination), so worst-case slippage is approximately
        `slippage × numSwaps`. Only solvers that an admin has granted the
        `SWAPS` capability receive swap quote requests.
      operationId: getExactInSwapQuotes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QuoteRequestEnvelope'
            examples:
              baseUsdcToSolanaUsdc:
                summary: Cross-chain swap with explicit slippage
                value:
                  dAppID: your-app-id
                  quoteRequest:
                    sourceChainID: 8453
                    destinationChainID: 1399811149
                    sourceToken: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
                    destinationToken: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                    sourceAmount: '20000000'
                    funder: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
                    recipient: H3AXGKhZQ9KCHkJFYRm14ccjHYc2bkU1DfEXpoX5awwW
                    slippage: 0.5
              arbUsdcToOpUsdtWithRelatedIntents:
                summary: Opting in to relatedIntents
                value:
                  dAppID: your-app-id
                  quoteRequest:
                    sourceChainID: 42161
                    destinationChainID: 10
                    sourceToken: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831'
                    destinationToken: '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58'
                    sourceAmount: '20000000'
                    funder: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
                    recipient: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
                    metadata:
                      includeRelatedIntents: true
      responses:
        '201':
          description: One or more solver quotes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuoteSuccessResponse'
              examples:
                baseUsdcToArbUsdt:
                  summary: Real quote (USDC on Base -> USDT on Arbitrum)
                  value:
                    data:
                      - quoteID: quote:3ec76cbf-a73d-47f9-bc62-86f36eba6be1
                        quoteResponseID: quoteResponse:f958e148-dd70-431e-95ad-eaf0bde4fad1
                        solverID: '0xd3EAAe58F060737fd1D9A435ce26d8deC05E3697'
                        receiveSignedIntentUrl: https://solver-yellow.eco.com/api/v1/quotes
                        quoteData:
                          contracts:
                            sourcePortal: '0xEC000064576f9C95a8623Bc0eff3db6d296ea6df'
                            destinationPortal: '0xEC000064576f9C95a8623Bc0eff3db6d296ea6df'
                            prover: '0xeC0008acc34d3D0CAa6758Ce788091e473812e28'
                          quoteResponse:
                            intentExecutionType: SELF_PUBLISH
                            sourceChainID: 8453
                            destinationChainID: 42161
                            finalDestinationChainID: 42161
                            sourceToken: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
                            destinationToken: '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9'
                            sourceAmount: '20000000'
                            destinationAmount: '19930000'
                            minimumDestinationAmount: '19930000'
                            funder: '0x000000000000000000000000000000000000dEaD'
                            refundRecipient: '0x000000000000000000000000000000000000dEaD'
                            recipient: '0x000000000000000000000000000000000000dEaD'
                            fees:
                              - name: Eco Protocol Fee
                                description: >-
                                  Protocol fee for fulfilling intent on chain
                                  42161
                                token:
                                  address: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
                                  symbol: USDC
                                  decimals: 6
                                amount: '70000'
                            deadline: 1784839631
                            quoteExpiry: 1784839001
                            estimatedFulfillTimeSec: 7
                            encodedRoute: 0x...
        '400':
          description: |
            Request rejected. Returned when no solver can serve the request,
            when solver liquidity is temporarily unavailable, or when the
            request body fails validation (for example, unknown `metadata`
            keys).
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - $ref: '#/components/schemas/ValidationErrorResponse'
              examples:
                noSolverLiquidity:
                  summary: >-
                    No solver liquidity for the requested route or amount
                    (transient — retry)
                  value:
                    statusCode: 400
                    createdBy: HttpExceptionFilter
                    details:
                      errorCode: 1024
                      errorDesc: FetchQuotesFailed
                      cause: FetchQuotesFailed
                fetchQuotesTimedOut:
                  summary: Solver RFQ fan-out timed out (transient — retry)
                  value:
                    statusCode: 400
                    createdBy: HttpExceptionFilter
                    details:
                      errorCode: 1025
                      errorDesc: FetchQuotesTimedOut
                      cause: FetchQuotesTimedOut
                noMatchingSolversForRoute:
                  summary: No solver supports this route at all (permanent)
                  value:
                    statusCode: 400
                    createdBy: HttpExceptionFilter
                    details:
                      errorCode: 1017
                      errorDesc: NoMatchingSolversForRoute
                      cause: NoMatchingSolversForRoute
                noMatchingSolvers:
                  summary: |
                    Solvers match the route but none can serve the request —
                    including when none have the SWAPS capability
                  value:
                    statusCode: 400
                    createdBy: HttpExceptionFilter
                    details:
                      errorCode: 1018
                      errorDesc: NoMatchingSolvers
                      cause: NoMatchingSolvers
                validationError:
                  summary: Request body failed validation (e.g. unknown metadata key)
                  value:
                    statusCode: 400
                    createdBy: ValidationFilter
                    validationErrors:
                      quoteRequest:
                        metadata: >-
                          metadata contains unknown keys; allowed keys:
                          visibility, includeRelatedIntents
        '403':
          description: |
            Missing or invalid `x-api-key`. The API Gateway responds
            `{"message": "Forbidden"}`.
        '429':
          description: Rate limited. Retry after a short delay.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    QuoteRequestEnvelope:
      type: object
      required:
        - dAppID
        - quoteRequest
      properties:
        dAppID:
          type: string
          description: Caller-supplied identifier for your app.
          example: your-app-id
        intentExecutionTypes:
          type: array
          description: |
            Intent execution types to fetch quotes for. Defaults to
            `["SELF_PUBLISH"]` (on-chain publish-and-fund). Use `GASLESS`
            for the gasless flow, where the signed intent is posted to the
            solver's `receiveSignedIntentUrl`.
          items:
            type: string
            enum:
              - SELF_PUBLISH
              - GASLESS
          default:
            - SELF_PUBLISH
        slippageBps:
          type: integer
          minimum: 1
          maximum: 10000
          deprecated: true
          description: |
            DEPRECATED — use `quoteRequest.slippage` (percent) instead,
            which takes precedence when both are set. Slippage tolerance in
            basis points, forwarded to solvers and applied to each swap
            leg.
          example: 50
        quoteRequest:
          $ref: '#/components/schemas/QuoteRequest'
    QuoteSuccessResponse:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          minItems: 1
          description: |
            One or more solver quotes. Pick the quote with the highest
            `quoteData.quoteResponse.destinationAmount`.
          items:
            $ref: '#/components/schemas/SolverQuote'
    ErrorResponse:
      type: object
      required:
        - statusCode
        - createdBy
        - details
      properties:
        statusCode:
          type: integer
          description: Mirrors the HTTP status code.
          example: 400
        createdBy:
          type: string
          example: HttpExceptionFilter
        details:
          $ref: '#/components/schemas/ErrorDetails'
    ValidationErrorResponse:
      type: object
      required:
        - statusCode
        - createdBy
        - validationErrors
      description: |
        Returned when the request body fails validation. `validationErrors`
        mirrors the request structure, with a message per invalid field.
      properties:
        statusCode:
          type: integer
          example: 400
        createdBy:
          type: string
          example: ValidationFilter
        validationErrors:
          type: object
          description: Per-field validation messages, nested to match the request body.
    QuoteRequest:
      type: object
      required:
        - sourceChainID
        - destinationChainID
        - sourceToken
        - destinationToken
        - sourceAmount
        - funder
        - recipient
      properties:
        sourceChainID:
          $ref: '#/components/schemas/ChainID'
        destinationChainID:
          $ref: '#/components/schemas/ChainID'
        sourceToken:
          $ref: '#/components/schemas/TokenAddress'
          description: Token contract address on the source chain.
        destinationToken:
          $ref: '#/components/schemas/TokenAddress'
          description: |
            Token contract address on the destination chain. Use
            `0x0000000000000000000000000000000000000000` for native EVM
            assets and `So11111111111111111111111111111111111111112` (the
            wrapped-SOL mint) for native SOL.
        sourceAmount:
          $ref: '#/components/schemas/SmallestUnitAmount'
          description: Input amount in `sourceToken` smallest units.
        funder:
          $ref: '#/components/schemas/WalletAddress'
          description: |
            Sender wallet that will provide the tokens and fund the intent.
        refundRecipient:
          $ref: '#/components/schemas/WalletAddress'
          description: |
            Wallet to receive refunds if the intent fails. Defaults to
            `funder` when omitted.
        recipient:
          $ref: '#/components/schemas/WalletAddress'
          description: |
            Recipient wallet on the destination chain. Use an EVM `0x...`
            address for EVM destinations and a Solana base58 address for
            Solana destinations.
        slippage:
          type: number
          minimum: 0.01
          maximum: 100
          description: |
            Slippage tolerance as a percent (e.g. `1` = 1%, `0.5` = 0.5%).
            Canonical slippage field; takes precedence over the deprecated
            top-level `slippageBps`. Applied to each swap leg, so
            worst-case slippage is approximately `slippage × numSwaps`.
            Omit to use the solver's configured default.
          example: 0.5
        metadata:
          $ref: '#/components/schemas/QuoteRequestMetadata'
    SolverQuote:
      type: object
      required:
        - quoteID
        - solverID
        - receiveSignedIntentUrl
        - quoteData
      properties:
        quoteID:
          type: string
          description: Quote identifier in the format `quote:<uuid>`.
          example: quote:295a3e87-1c2a-4b5d-9f10-7e6a3f8c1b22
        quoteResponseID:
          type: string
          description: >-
            Identifier of this solver's response, in the format
            `quoteResponse:<uuid>`.
          example: quoteResponse:f958e148-dd70-431e-95ad-eaf0bde4fad1
        solverID:
          type: string
          description: Solver identifier (EVM `0x...` address).
          example: '0xd3EAAe585b97D1A60d1A0D2fF1A4F0D8B6d2fE71'
        receiveSignedIntentUrl:
          type: string
          format: uri
          description: |
            URL on the solver to which a signed gasless intent should be
            posted when using the gasless flow.
          example: >-
            https://solver-magenta.eco.com/api/v1/intentInitiation/initiateGaslessIntent
        quoteData:
          $ref: '#/components/schemas/QuoteData'
    ErrorDetails:
      type: object
      required:
        - errorCode
        - errorDesc
        - cause
      properties:
        errorCode:
          type: integer
          description: |
            Eco-specific numeric code.
          example: 1024
        errorDesc:
          type: string
          example: FetchQuotesFailed
        cause:
          type: string
          example: FetchQuotesFailed
    ChainID:
      type: integer
      format: int64
      description: |
        Numeric chain ID
      example: 8453
    TokenAddress:
      type: string
      description: |
        Token contract address. EVM addresses are `0x`-prefixed 20-byte
        hex strings; Solana mint addresses are base58 strings.
      example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
    SmallestUnitAmount:
      type: string
      pattern: ^[0-9]+$
      description: |
        Non-negative integer amount in token smallest units, encoded as a
        base-10 string. For example, `"20000000"` is $20 USDC (6 decimals).
      example: '20000000'
    WalletAddress:
      type: string
      description: |
        Wallet address. EVM addresses are `0x`-prefixed 20-byte hex
        strings; Solana addresses are base58 strings.
      example: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
    QuoteRequestMetadata:
      type: object
      description: |
        Strict envelope — only the keys below are accepted; requests with
        unknown `metadata` keys are rejected with a 400.
      properties:
        visibility:
          type: string
          enum:
            - public
            - private
          description: |
            Intent visibility. `private` requests publish-free off-chain
            dispatch for any-to-any flows.
          example: private
        includeRelatedIntents:
          type: boolean
          description: |
            Opt-in: when `true`, each quote entry includes a
            `relatedIntents` array describing every intent in the
            any-to-any flow (decoded route and reward), so the full flow
            can be validated before funding.
          example: true
    QuoteData:
      type: object
      required:
        - contracts
        - quoteResponse
      properties:
        contracts:
          $ref: '#/components/schemas/Contracts'
        quoteResponse:
          $ref: '#/components/schemas/QuoteResponse'
    Contracts:
      type: object
      required:
        - sourcePortal
        - prover
        - destinationPortal
      description: |
        Contract addresses returned with the quote. Always read the Portal
        address from `sourcePortal` here — never hardcode it.
      properties:
        sourcePortal:
          type: string
          description: >-
            Portal contract on the source chain. Approve `sourceToken` to this
            address (EVM) before calling `publishAndFund`.
          example: '0x399Dbd5DF04f83103F77A58cBa2B7c4d3cdede97'
        prover:
          type: string
          description: Prover contract used to verify fulfillment back on the source chain.
          example: '0xC972B26C1E208845Ca8C18c6B83466bFCeED8c2F'
        destinationPortal:
          type: string
          description: Portal contract on the destination chain.
          example: '0x399Dbd5DF04f83103F77A58cBa2B7c4d3cdede97'
    QuoteResponse:
      type: object
      required:
        - intentExecutionType
        - sourceChainID
        - destinationChainID
        - sourceToken
        - destinationToken
        - sourceAmount
        - destinationAmount
        - funder
        - refundRecipient
        - recipient
        - fees
        - deadline
        - estimatedFulfillTimeSec
        - encodedRoute
      properties:
        intentExecutionType:
          type: string
          enum:
            - SELF_PUBLISH
            - GASLESS
          description: Execution type for this quote entry.
          example: SELF_PUBLISH
        sourceChainID:
          $ref: '#/components/schemas/ChainID'
        destinationChainID:
          $ref: '#/components/schemas/ChainID'
          description: |
            Chain where the intent is published and funded. For any-to-any
            local intents (a source swap stitched to a cross-chain leg)
            this equals the source chain — use `finalDestinationChainID`
            for the chain where the recipient receives tokens.
        finalDestinationChainID:
          $ref: '#/components/schemas/ChainID'
          description: |
            Chain where the recipient receives tokens (the requested
            destination). Equals `destinationChainID` for standard
            cross-chain quotes; differs for any-to-any local intents where
            `destinationChainID` is the source/publish chain.
        sourceToken:
          $ref: '#/components/schemas/TokenAddress'
        destinationToken:
          $ref: '#/components/schemas/TokenAddress'
        sourceAmount:
          $ref: '#/components/schemas/SmallestUnitAmount'
        destinationAmount:
          $ref: '#/components/schemas/SmallestUnitAmount'
          description: |
            Quoted amount delivered to `recipient` on the destination chain
            in `destinationToken` smallest units. Subject to slippage —
            actual fill is guaranteed to be at least
            `minimumDestinationAmount`.
        minimumDestinationAmount:
          $ref: '#/components/schemas/SmallestUnitAmount'
          description: |
            Minimum amount the solver guarantees to deliver, in
            `destinationToken` smallest units. Present when the quote
            involves a swap leg; absent on 1:1 transfer quotes, where
            `destinationAmount` is exact.
        slippage:
          type: number
          description: |
            Slippage tolerance applied to the destination swap as a
            percent (e.g. `0.5` = 0.5%). Only present when a destination
            swap occurred.
          example: 0.5
        slippageBps:
          type: integer
          deprecated: true
          description: |
            DEPRECATED — use `slippage` (percent) instead. Slippage
            tolerance applied to the destination swap in basis points.
            Only present when a destination swap occurred.
          example: 50
        funder:
          $ref: '#/components/schemas/WalletAddress'
        refundRecipient:
          $ref: '#/components/schemas/WalletAddress'
          description: Wallet that receives refunds if the intent fails.
        recipient:
          $ref: '#/components/schemas/WalletAddress'
        fees:
          type: array
          description: Fee breakdown returned by the solver.
          items:
            $ref: '#/components/schemas/Fee'
        deadline:
          type: integer
          format: int64
          description: |
            Reward/refund deadline as a Unix epoch in seconds. Can be later
            than `quoteExpiry` — use `quoteExpiry` for quote freshness.
          example: 1777577761
        quoteExpiry:
          type: integer
          format: int64
          description: |
            Unix epoch in seconds after which this quote expires and can no
            longer be filled. Matches the encoded route deadline and is
            earlier than (or equal to) `deadline`. Solvers are rolling this
            field out — treat it as authoritative when present.
          example: 1777577161
        estimatedFulfillTimeSec:
          type: integer
          description: Provider-reported expected fulfillment latency in seconds.
          example: 15
        encodedRoute:
          type: string
          description: |
            Hex-encoded route payload — the authoritative execution route
            for the quote. For EVM source chains, pass this verbatim to
            `publishAndFund()` on the source Portal. For Solana source
            chains, hash this with `keccak256` to derive `routeHash`.
          example: 0x...
        relatedIntents:
          type: array
          description: |
            Decoded route/reward of every intent in the any-to-any flow for
            this quote. Only present when the request opted in via
            `quoteRequest.metadata.includeRelatedIntents`.
          items:
            $ref: '#/components/schemas/RelatedIntent'
    Fee:
      type: object
      required:
        - name
        - description
        - token
        - amount
      properties:
        name:
          type: string
          example: Eco Protocol Fee
        description:
          type: string
        token:
          $ref: '#/components/schemas/FeeToken'
        amount:
          $ref: '#/components/schemas/SmallestUnitAmount'
          description: Total fee in `token` smallest units.
          example: '31318'
        breakdown:
          type: object
          description: Optional itemized fee breakdown. May be empty.
    RelatedIntent:
      type: object
      required:
        - role
        - sourceChainID
        - destinationChainID
        - route
        - reward
      description: |
        One intent within an any-to-any flow. Role-discriminated:
        `local` and `bucket-candidate` entries are concrete (the intent
        exists or is queued to publish at quote time, `intentHash`
        present); `cross-chain-child` entries are projected (`projected:
        true`, no `intentHash` yet — the gateway publishes them after the
        source swap settles, patching amounts from the realized swap
        output).
      properties:
        role:
          type: string
          enum:
            - local
            - bucket-candidate
            - cross-chain-child
          description: Role of this intent within the any-to-any flow.
          example: local
        intentHash:
          type: string
          description: |
            Hash of this intent. Present for the concrete roles (`local`,
            `bucket-candidate`); absent for `cross-chain-child`, which has
            no hash until the gateway publishes it.
        projected:
          type: boolean
          description: |
            Present (and always `true`) only when `role` is
            `cross-chain-child` — the intent does not exist yet at quote
            time.
        routeHash:
          type: string
          description: |
            Hash of the route for this intent. Only present for the
            concrete roles.
        bucketIndex:
          type: integer
          description: |
            Index of this intent within its bucket, when applicable. Only
            present for the concrete roles.
        sourceChainID:
          $ref: '#/components/schemas/ChainID'
        destinationChainID:
          $ref: '#/components/schemas/ChainID'
        route:
          type: object
          required:
            - salt
            - deadline
            - portal
            - nativeAmount
            - tokens
            - calls
          description: |
            Decoded route data. For a projected `cross-chain-child` entry,
            amounts are pre-settlement estimates.
          properties:
            salt:
              type: string
            deadline:
              type: string
              description: >-
                Unix seconds (string) after which the route can no longer be
                fulfilled.
            portal:
              type: string
              description: Portal contract on the route chain.
            nativeAmount:
              $ref: '#/components/schemas/SmallestUnitAmount'
            tokens:
              type: array
              items:
                $ref: '#/components/schemas/TokenAmount'
            calls:
              type: array
              items:
                type: object
                required:
                  - target
                  - data
                  - value
                properties:
                  target:
                    type: string
                  data:
                    type: string
                  value:
                    $ref: '#/components/schemas/SmallestUnitAmount'
        reward:
          type: object
          required:
            - deadline
            - creator
            - prover
            - nativeAmount
            - tokens
          description: |
            Decoded reward data. For a projected `cross-chain-child` entry,
            amounts are pre-settlement estimates.
          properties:
            deadline:
              type: string
              description: Unix seconds (string) for the reward/refund deadline.
            creator:
              type: string
            prover:
              type: string
            nativeAmount:
              $ref: '#/components/schemas/SmallestUnitAmount'
            tokens:
              type: array
              items:
                $ref: '#/components/schemas/TokenAmount'
    FeeToken:
      type: object
      required:
        - symbol
        - decimals
      properties:
        address:
          $ref: '#/components/schemas/TokenAddress'
          description: Contract address of the fee token.
        symbol:
          type: string
          example: USDC
        decimals:
          type: integer
          example: 6
    TokenAmount:
      type: object
      required:
        - token
        - amount
      properties:
        token:
          type: string
          description: Token address.
        amount:
          $ref: '#/components/schemas/SmallestUnitAmount'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````