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

# Get api quote

> GET quote for aggregation swap



## OpenAPI

````yaml /openapi-tron.json get /api/{blockchain}/quote
openapi: 3.1.0
info:
  title: ggp-tron-swap
  description: ''
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://swap.ggp.gg
security: []
tags:
  - name: swap
    description: Swap API endpoints
  - name: approve
    description: TRC-20 approve endpoints
  - name: tokens
    description: Tokens API endpoints
  - name: healthcheck
    description: Health Check API endpoints
paths:
  /api/{blockchain}/quote:
    get:
      tags:
        - tron
      description: GET quote for aggregation swap
      operationId: get_quote
      parameters:
        - name: blockchain
          in: path
          required: true
          schema:
            type: string
            description: Blockchain served by this service.
            enum:
              - tron
        - name: addressTokenIn
          in: query
          description: |-
            Source token address (base58 `T...` or hex). Native TRX:
            `T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb`.
          required: true
          schema:
            type: string
          style: form
        - name: addressTokenOut
          in: query
          description: Destination token address (base58 `T...` or hex).
          required: true
          schema:
            type: string
          style: form
        - name: amountIn
          in: query
          description: >-
            Amount of source token to swap (in token's normalized unit, e.g.
            `1.5` TRX).

            Ignored when `amountInWei` is provided.
          required: false
          schema:
            type: string
          style: form
        - name: amountInWei
          in: query
          description: >-
            Amount of source token in the smallest unit (SUN for TRX). Takes
            precedence

            over `amountIn`.
          required: false
          schema:
            type: string
          style: form
        - name: slippageBps
          in: query
          description: >-
            Slippage in bps for `amountOutMin` (not below the service minimum,
            50 bps).
          required: false
          schema:
            type: integer
            format: int32
            minimum: 0
          style: form
      responses:
        '200':
          description: Quote for swap through POST /{blockchain}/swap
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TronQuoteResponse'
        '400':
          description: Bad request
components:
  schemas:
    TronQuoteResponse:
      type: object
      required:
        - data
        - aggregatorAddress
      properties:
        aggregatorAddress:
          type: string
          description: >-
            Contract the swap transaction calls (`to` of `POST
            /{blockchain}/swap`).
        data:
          $ref: '#/components/schemas/ResultPath'
        tokenApprovalAddress:
          type:
            - string
            - 'null'
          description: >-
            Address that the user must approve for TRC-20 spending before
            calling

            /swap. Null when the input token is native TRX or for TRX <-> WTRX.
    ResultPath:
      type: object
      required:
        - addressTokenIn
        - addressTokenOut
        - amountIn
        - steps
        - totalAmountOut
        - totalPriceImpact
        - feeAmount
        - amountInAfterFee
        - amountOutMin
        - slippageBps
      properties:
        addressTokenIn:
          type: string
          description: Source token address
        addressTokenOut:
          type: string
          description: Destination token address
        amountIn:
          type: string
          description: >-
            Amount of source token to swap (in token's smallest unit), fee
            included.
        amountInAfterFee:
          type: string
          description: Input amount actually swapped after the fee is deducted.
        amountOutMin:
          type: string
          description: >-
            Minimum acceptable output after slippage; the swap reverts below
            this.
        feeAmount:
          type: string
          description: Fee taken on the input amount (in input token's smallest unit).
        slippageBps:
          type: integer
          format: int32
          description: Slippage tolerance applied, in bps.
          minimum: 0
        steps:
          type: array
          items:
            type: array
            items:
              $ref: '#/components/schemas/ResultPathStep'
          description: 'Route: one inner list per hop, executed in order.'
        totalAmountOut:
          type: string
          description: >-
            Expected amount of destination token to receive (in token's smallest
            unit).
        totalPriceImpact:
          type: integer
          format: int32
          description: Price impact of the quote in bps
          minimum: 0
    ResultPathStep:
      allOf:
        - $ref: '#/components/schemas/Action'
        - type: object
          required:
            - tokenIn
            - tokenOut
            - percentBps
            - amountIn
            - amountOut
          properties:
            amountIn:
              type: string
              description: Input amount for this step (in the token's smallest unit)
            amountOut:
              type: string
              description: >-
                Expected output amount for this step (in the token's smallest
                unit)
            percentBps:
              type: integer
              format: int32
              description: Percentage of the input allocated to this route in bps
              minimum: 0
            priceImpact:
              type:
                - integer
                - 'null'
              format: int32
              description: Price impact of the step in bps
              minimum: 0
            tokenIn:
              type: string
              description: Input token address for this step
            tokenOut:
              type: string
              description: Output token address for this step
    Action:
      oneOf:
        - type: object
          required:
            - exchanger
          properties:
            exchanger:
              $ref: '#/components/schemas/ExchangerData'
        - type: object
          required:
            - wrap
          properties:
            wrap:
              $ref: '#/components/schemas/WrapData'
    ExchangerData:
      type: object
      required:
        - name
        - address
        - poolType
      properties:
        address:
          type: string
          description: Pool contract address
        fee:
          type:
            - integer
            - 'null'
          format: int32
          description: Fee of the pool in bps. Absent for Curve pools.
          minimum: 0
        name:
          type: string
          description: Name of the pool
        poolType:
          $ref: '#/components/schemas/PoolType'
          description: Type of the pool
    WrapData:
      type: object
      required:
        - isWrap
        - wrapperType
        - name
      properties:
        isWrap:
          type: boolean
          description: Whether the action is a wrap
        name:
          type: string
          description: Name of the wrap token
        wrapperType:
          $ref: '#/components/schemas/WrappedType'
          description: Type of the wrap token
    PoolType:
      type: string
      enum:
        - SunSwapV2
        - SunSwapV3
        - Curve
    WrappedType:
      type: string
      enum:
        - WTRX

````

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