# Transit Swap TRON

TRON V2

## Query Swap Info and Build Tron Transaction Contract data

<mark style="color:blue;">`GET`</mark> `https://aggserver.transit.finance/v3/transit/swap`

#### Query Parameters

| Name                                           | Type    | Description                                               |
| ---------------------------------------------- | ------- | --------------------------------------------------------- |
| token0<mark style="color:red;">\*</mark>       | string  | contract address of a token to sell                       |
| token1<mark style="color:red;">\*</mark>       | string  | contract address of a token to buy                        |
| decimal0<mark style="color:red;">\*</mark>     | integer | Decimals of a token to sell                               |
| decimal1<mark style="color:red;">\*</mark>     | integer | Decimals of a token to buy                                |
| impact<mark style="color:red;">\*</mark>       | integer | Slippage Tolerance. 0 - 10000                             |
| part<mark style="color:red;">\*</mark>         | integer | The scale of amountIn. 1 - 100                            |
| amountIn<mark style="color:red;">\*</mark>     | integer | Amount of a token to sell                                 |
| amountOutMin<mark style="color:red;">\*</mark> | integer | Minimum received                                          |
| to<mark style="color:red;">\*</mark>           | string  | Recipient of desToken                                     |
| issuer<mark style="color:red;">\*</mark>       | string  | Sender of transaction push                                |
| chain<mark style="color:red;">\*</mark>        | string  | chain flag                                                |
| channel                                        | string  | <p>"default"、"web"、"android"、"ios"、</p><p>"extension"</p> |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "result": 0,
    "message": "success",
    "data": {
        "srcToken": "T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb",
        "dstToken": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
        "to": "TGdHpDYJFZXmmQMTRskp54MzjTvWwrUobQ",
        "amountIn": "100000000",
        "totalAmountOut": "6177355",
        "totalAmountOutMin": "5559619",
        "dexPath": [
            "JustSwap:100"
        ],
        "impact": "0.003000",
        "channel": "web",
        "dexs": [],
        "amounts": [
            {
                "exchange": "SunSwapV1",
                "amountOut": "6177355",
                "icon_url": "https://tp-statics.tokenpocket.pro/logo/dapp/sunswap.png"
            }
        ],
        "aggregator": "TKqQ7zuL7yKp1NWuhGpoXTDiE3j2qiAbRE",
        "data": {
            "contract": "TKqQ7zuL7yKp1NWuhGpoXTDiE3j2qiAbRE",
            "fun": "swap((uint8,address,address,address,address,uint256,uint256,string,uint256,address),(uint8,address,bytes))",
            "options": {
                "callValue": "100000000",
                "feeLimit": 100000000
            },
            "parameter": [
                {
                    "type": "tuple(uint8,address,address,address,address,uint256,uint256,string,uint256,address)",
                    "value": [
                        0,
                        "0x0000000000000000000000000000000000000000",
                        "0xa614f803b6fd780986a42c78ec9c7f77e6ded13c",
                        "0x87d5ef4c42a78f85dd1ca399fa0c99f9ab0875d9",
                        "0x490494393fb90599365c1303e486afe52bbab866",
                        "100000000",
                        "5559619",
                        "web",
                        0,
                        "0x891cdb91d149f23b1a45d9c5ca78a88d0cb44c18"
                    ]
                },
                {
                    "type": "tuple(uint8,address,bytes)",
                    "value": [
                        0,
                        "0x0000000000000000000000000000000000000000",
                        "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c000000000000000000000000490494393fb90599365c1303e486afe52bbab86600000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000005f14d20000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a2726afbecbd8e936000ed684cef5e2f5cf4300800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000064ce22f858000000000000000000000000000000000000000000000000000000000054d5430000000000000000000000000000000000000000000000000000000063627e88000000000000000000000000490494393fb90599365c1303e486afe52bbab86600000000000000000000000000000000000000000000000000000000"
                    ]
                }
            ],
            "issuer": "TGdHpDYJFZXmmQMTRskp54MzjTvWwrUobQ"
        },
        "feeRate": 0.003,
        "fee": "300000",
        "normalFee": "300000",
        "upgradeAmountOutMin": false,
        "usedAmountIn": "99700000"
    }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.transit.finance/reference/api-reference/transit-swap-tron.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
