> For the complete documentation index, see [llms.txt](https://docs.expand.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.expand.network/integrations/dex-and-dex-aggregators/0x-aggregator.md).

# 0x (Aggregator)

### /getprice

Returns the best swap quotation for the given token pair.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/dex/getprice`

#### Query Parameters

| Name                                       | Type   | Description                                                                  |
| ------------------------------------------ | ------ | ---------------------------------------------------------------------------- |
| rpc                                        | String | Remote procedural call URL.                                                  |
| dexId<mark style="color:red;">\*</mark>    | String | Refer to the [DEX ID](broken://pages/8x8qwIu19Aq8uFsjOXvI) page for details. |
| path<mark style="color:red;">\*</mark>     | String | Comma separated values of token addresses whose price is to be fetched.      |
| amountIn<mark style="color:red;">\*</mark> | String | Amount of token.                                                             |

{% tabs %}
{% tab title="Sample Request" %}

```url
https://api.expand.network/dex/getprice?dexId=1600&path=0xdac17f958d2ee523a2206206994597c13d831ec7%2C0x6B175474E89094C44Da98b954EedeAC495271d0F&amountIn=10000000000000
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "amountIn": "10000000000000",
        "path": [
            "0xdac17f958d2ee523a2206206994597c13d831ec7",
            "0x6B175474E89094C44Da98b954EedeAC495271d0F"
        ],
        "amountsOut": [
            "10000000000000",
            "9980737729411015490500127"
        ]
    }
}
```

{% endtab %}
{% endtabs %}

### /getliquiditysources

Get the liquidity sources for the specified dex aggregator(on the basis of chain), supported by expand.network.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/dex/getliquiditysources`

#### Query Parameters

| Name                                    | Type   | Description                                                                  |
| --------------------------------------- | ------ | ---------------------------------------------------------------------------- |
| rpc                                     | String | Remote procedural call URL.                                                  |
| dexId<mark style="color:red;">\*</mark> | String | Refer to the [DEX ID](broken://pages/8x8qwIu19Aq8uFsjOXvI) page for details. |

{% tabs %}
{% tab title="Sample Request" %}

```url
https://api.expand.network/dex/getliquiditysources?dexId=1602
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": [
        "0x_RFQ",
        "ApeSwap",
        "Balancer_V2",
        "Curve",
        "DODO_V2",
        "Dfyn",
        "Meshswap",
        "Polycat",
        "QuickSwap_V2",
        "QuickSwap_V3",
        "Retro",
        "Stepn",
        "SushiSwap",
        "SushiSwap_V3",
        "Synapse",
        "Uniswap_V2",
        "Uniswap_V3",
        "WOOFi_V2",
        "WaultSwap",
        "Wrapped_USDM"
    ]
}
```

{% endtab %}
{% endtabs %}

### /swap

Initiate a swap transaction on the DEX providing best swap quote.

<mark style="color:green;">`POST`</mark> `https://api.expand.network/dex/swap`

#### Request Body

| Name                                       | Type   | Description                                                                                 |
| ------------------------------------------ | ------ | ------------------------------------------------------------------------------------------- |
| dexId<mark style="color:red;">\*</mark>    | String | Refer to the [DEX ID](broken://pages/8x8qwIu19Aq8uFsjOXvI) page for details.                |
| path<mark style="color:red;">\*</mark>     | Array  | Comma-separated values of token addresses, inside an array, to swap.                        |
| amountIn<mark style="color:red;">\*</mark> | String | Amount of token to be swapped.                                                              |
| amountOutMin                               | String | Minimum amount accepted as the result of swap.                                              |
| from<mark style="color:red;">\*</mark>     | String | Address of the sender of the token.                                                         |
| gas                                        | String | Maximum gas limit provided by the sender, for the transaction.                              |
| rpc                                        | String | Remote procedural call URL.                                                                 |
| slippage                                   | String | <p>Percentage of total swap value. <br>By default, 1.</p><p>0 <= slippage  value <= 100</p> |
| gasPriority                                | String | low, medium, or high.                                                                       |

{% tabs %}
{% tab title="Sample Request" %}

```json
{
    "dexId": "1600",
    "amountIn": "1000000000000000000",
    "path": [
        "0x6B175474E89094C44Da98b954EedeAC495271d0F",
        "0xdAC17F958D2ee523a2206206994597C13D831ec7"
    ],
    "to": "0x6AFb0df2F5ab5012568991549544dbC44Dfb6483",
    "from": "0x6AFb0df2F5ab5012568991549544dbC44Dfb6483",
    "gas": "990089"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x6AFb0df2F5ab5012568991549544dbC44Dfb6483",
        "to": "0x70bf6634ee8cb27d04478f184b9b8bb13e5f4710",
        "value": "0",
        "gas": "990089",
        "data": "0x1fff991f0000000000000000000000006afb0df2f5ab5012568991549544dbc44dfb6483000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000f150000000000000000000000000000000000000000000000000000000000000000a02f9702771d7e08c60d140fc3a1a0780000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000004c000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000000c4339a023000000000000000000000000070bf6634ee8cb27d04478f184b9b8bb13e5f4710000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000002710000000000000000000000000f6e72db5454dd049d0788e411b06cfaf16853042000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a4d92aadfb00000000000000000000000070bf6634ee8cb27d04478f184b9b8bb13e5f4710000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000f41c8ae0cd7b8d6179a1b999436fda67d84362e6ba4dfe7ce386e8a5967a333324d41000000000000000000000000000000000000000000000000000000006746fc36000000000000000000000000b02f39e382c90160eb816de5e0e428ac771d77b50000000000000000000000000000000000000000000000000000000000000120000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000000411c0eaf75a50eec050bea87df0f50e8e9045e4ee0e983e6ebec5d37ecd154b1b61d0752a856a866e1872bc913dd8619a88c497b133138503e8b892aa85c4ef822b70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012438c9c147000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000000f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000ad01c20d5886137e056775af56915de824c8fce500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffc1fb425e00000000000000000000000070bf6634ee8cb27d04478f184b9b8bb13e5f47100000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000006e898131631616b1779bad70bc17000000000000000000000000000000000000000000000000000000006746fd2200000000000000000000000000000000000000000000000000000000000000c0",
        "estimationCheck": true,
        "referenceId": "6331a5b9fe3a4360b1dd5a3b0e76fd88"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Sample Request" %}
**With gasPriority:**

```json
{
    "dexId": "1600",
    "amountIn": "1000000000000000000",
    "path": [
        "0x6B175474E89094C44Da98b954EedeAC495271d0F",
        "0xdAC17F958D2ee523a2206206994597C13D831ec7"
    ],
    "to": "0x6AFb0df2F5ab5012568991549544dbC44Dfb6483",
    "from": "0x6AFb0df2F5ab5012568991549544dbC44Dfb6483",
    "gas": "990089",
    "gasPriority": "low"
}
```

{% endtab %}

{% tab title="Sample Response" %}
**With gasPriority:**

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x6AFb0df2F5ab5012568991549544dbC44Dfb6483",
        "to": "0x70bf6634ee8cb27d04478f184b9b8bb13e5f4710",
        "value": "0",
        "gas": "990089",
        "data": "0x1fff991f0000000000000000000000006afb0df2f5ab5012568991549544dbc44dfb6483000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000f149d00000000000000000000000000000000000000000000000000000000000000a05cdc6e9f2b14a0d7cc1b3156a1a0780000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000004c000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000000c4339a023000000000000000000000000070bf6634ee8cb27d04478f184b9b8bb13e5f4710000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000002710000000000000000000000000f6e72db5454dd049d0788e411b06cfaf16853042000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a4d92aadfb00000000000000000000000070bf6634ee8cb27d04478f184b9b8bb13e5f4710000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000f415a852e6ace002d4125cd21e106f3317701d66b58a997a8d61df24002dd60307010000000000000000000000000000000000000000000000000000000006746fc67000000000000000000000000ff8ba4d1fc3762f6154cc942ccf30049a2a0cec60000000000000000000000000000000000000000000000000000000000000120000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000000419ccc5eddb539be5e34b28e24afca89a373efa80b2525595c5acf87c46170ea336d304d3ca5585e7e67ffe5df92ac91c7824d35881492c6c1aecef2518c9e48251c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012438c9c147000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000000f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000ad01c20d5886137e056775af56915de824c8fce500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffc1fb425e00000000000000000000000070bf6634ee8cb27d04478f184b9b8bb13e5f47100000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000006e898131631616b1779bad70bc16000000000000000000000000000000000000000000000000000000006746fd3a00000000000000000000000000000000000000000000000000000000000000c0",
        "gasPrice": "13752602380",
        "estimationCheck": true,
        "referenceId": "5dc5e1e4455d4f978fa9fbb8e353fab0"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Sample Request" %}
**With Slippage:**

```json
{
    "dexId": "1600",
    "amountIn": "1000000000000000",
    "path": [
        "0x6B175474E89094C44Da98b954EedeAC495271d0F",
        "0xdAC17F958D2ee523a2206206994597C13D831ec7"
    ],
    "to": "0x22cf65Ae3fa16d6379E72F4B4c2401c1B7C69731",
    "from": "0x22cf65Ae3fa16d6379E72F4B4c2401c1B7C69731",
    "amountOutMin": "10000000",
    "gas": "990089",
    "gasPriority": "medium",
    "slippage": "8"
}
```

{% endtab %}

{% tab title="Sample Response" %}
**With Slippage:**

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x22cf65Ae3fa16d6379E72F4B4c2401c1B7C69731",
        "to": "0x70bf6634ee8cb27d04478f184b9b8bb13e5f4710",
        "value": "0",
        "gas": "990089",
        "data": "0x1fff991f00000000000000000000000022cf65ae3fa16d6379e72f4b4c2401c1b7c69731000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000039400000000000000000000000000000000000000000000000000000000000000a034705e63360d7c1d5877b9d4a1a07800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000360000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000005a000000000000000000000000000000000000000000000000000000000000000c4339a023000000000000000000000000070bf6634ee8cb27d04478f184b9b8bb13e5f4710000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000002710000000000000000000000000f6e72db5454dd049d0788e411b06cfaf168530420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016438c9c147000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000271000000000000000000000000014100f81e33c33ecc7cdac70181fb45b6e78569f000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000843df021240000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e48d68a15600000000000000000000000070bf6634ee8cb27d04478f184b9b8bb13e5f4710000000000000000000000000000000000000000000000000000000000000138800000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002c73a15fed60bf67631dc6cd7bc5b6e8da8190acf500000bb8dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e48d68a15600000000000000000000000070bf6634ee8cb27d04478f184b9b8bb13e5f4710000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002c73a15fed60bf67631dc6cd7bc5b6e8da8190acf5010001f4dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012438c9c147000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000ad01c20d5886137e056775af56915de824c8fce500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffc1fb425e00000000000000000000000070bf6634ee8cb27d04478f184b9b8bb13e5f47100000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000038d7ea4c680000000000000000000000000000000000000006e898131631616b1779bad70bc24000000000000000000000000000000000000000000000000000000006746fd5200000000000000000000000000000000000000000000000000000000000000c0",
        "gasPrice": "16286719698",
        "estimationCheck": true,
        "referenceId": "34ca65823d7b4668934185e9298123f9"
    }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.expand.network/integrations/dex-and-dex-aggregators/0x-aggregator.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.
