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

# Compare DEX Quotes

> Find the top pools by reserve for a token pair, quote each one individually, and return results sorted by output amount descending. Also includes the AKKA aggregator's exact quote for comparison. Useful for demonstrating the value of aggregated routing vs. single-DEX swaps.

<Info>
  This endpoint is useful for demonstrating the value of AKKA's aggregated routing compared to swapping through a single DEX pool.
</Info>

## How it works

1. Finds the top pools by reserve for the given token pair
2. Quotes each pool individually
3. Returns results sorted by output amount (descending)
4. Includes the AKKA aggregator's exact quote (`akkaQuote`) for comparison

The `akkaQuote` will typically be higher than any individual pool because AKKA splits the swap across multiple pools for better pricing.


## OpenAPI

````yaml GET /swap/v1/{chainId}/dex-compare
openapi: 3.0.3
info:
  title: AKKA Finance API
  version: 1.0.0
  description: >-
    AKKA Finance liquidity aggregation API. Find the best swap routes across
    multiple DEXes and execute token swaps with optimal pricing.
  contact:
    name: AKKA Finance
    url: https://akka.finance
    email: support@akka.finance
servers:
  - url: https://api.akka.finance
    description: Production
security:
  - apiKey: []
paths:
  /swap/v1/{chainId}/dex-compare:
    get:
      tags:
        - Quote & Swap
      summary: Compare quotes across individual DEX pools
      description: >-
        Find the top pools by reserve for a token pair, quote each one
        individually, and return results sorted by output amount descending.
        Also includes the AKKA aggregator's exact quote for comparison. Useful
        for demonstrating the value of aggregated routing vs. single-DEX swaps.
      operationId: getDexComparison
      parameters:
        - name: chainId
          in: path
          required: true
          description: Blockchain chain ID
          schema:
            type: integer
            enum:
              - 999
            example: 999
        - name: src
          in: query
          required: true
          description: >-
            Source token contract address. Use
            `0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee` for the native token.
          schema:
            type: string
            pattern: ^0x[a-fA-F0-9]{40}$
            example: '0x5555555555555555555555555555555555555555'
        - name: dst
          in: query
          required: true
          description: Destination token contract address.
          schema:
            type: string
            pattern: ^0x[a-fA-F0-9]{40}$
            example: '0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb'
        - name: amount
          in: query
          required: true
          description: Amount to swap in the smallest unit (wei).
          schema:
            type: string
            example: '1000000000000000000'
      responses:
        '200':
          description: DEX comparison results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DexCompareResponse'
              example:
                akkaQuote: '205340622987446484992'
                decimalsOut: 18
                pools:
                  - poolAddress: '0x1234567890abcdef1234567890abcdef12345678'
                    poolType: uni_v3
                    amountOut: '204200000000000000000'
                    decimalsOut: 18
                  - poolAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcd'
                    poolType: algebra_v4
                    amountOut: '203800000000000000000'
                    decimalsOut: 18
        '400':
          description: Bad request — invalid parameters or no pools found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    DexCompareResponse:
      type: object
      required:
        - akkaQuote
        - decimalsOut
        - pools
      properties:
        akkaQuote:
          type: string
          description: AKKA aggregator's exact quote for the same pair and amount
          example: '205340622987446484992'
        decimalsOut:
          type: integer
          description: Decimals of the output token
          example: 18
        pools:
          type: array
          description: Individual pool quotes sorted by output amount (descending)
          items:
            $ref: '#/components/schemas/DexQuote'
    ErrorResponse:
      type: object
      required:
        - statusCode
        - message
        - error
        - timestamp
        - path
      properties:
        statusCode:
          type: integer
          description: HTTP status code
          example: 400
        message:
          type: string
          description: Human-readable error description
          example: No route found for the given token pair
        error:
          type: string
          description: Error type
          example: Bad Request
        timestamp:
          type: string
          format: date-time
          description: When the error occurred
          example: '2025-01-15T12:00:00.000Z'
        path:
          type: string
          description: API endpoint path that produced the error
          example: /swap/v1/999/quote
    DexQuote:
      type: object
      required:
        - poolAddress
        - poolType
        - amountOut
        - decimalsOut
      properties:
        poolAddress:
          type: string
          description: Pool contract address
          example: '0x1234567890abcdef1234567890abcdef12345678'
        poolType:
          type: string
          description: Pool type identifier
          example: uni_v3
        amountOut:
          type: string
          description: Output amount from this pool (in wei)
          example: '204200000000000000000'
        decimalsOut:
          type: integer
          description: Decimals of the output token
          example: 18
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: apikey
      description: API key for authentication. Contact AKKA on Telegram to obtain your key.

````