# 1inch (Aggregator)

### Geofencing Notice

**Important:** This API is geofenced and **cannot** be accessed within the United States. Any requests originating from the U.S. will be denied.&#x20;

### /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](https://docs.expand.network/integrations/dex-and-dex-aggregators/broken-reference) page for details. |
| path<mark style="color:red;">\*</mark>     | String | Comma separated values of token addresses/token symbol whose price is to be fetched.                                       |
| amountIn<mark style="color:red;">\*</mark> | String | Amount of token.                                                                                                           |
| slippage                                   | String | <p>Percentage of total swap value. <br>By default, 1.</p>                                                                  |

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

```url
https://api.expand.network/dex/getprice?path=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE%2C0x6B175474E89094C44Da98b954EedeAC495271d0F&amountIn=1000000000000000000&dexId=1700
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "amountIn": "1000000000000000000",
        "path": [
            "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
            "0x6B175474E89094C44Da98b954EedeAC495271d0F"
        ],
        "amountsOut": [
            "1000000000000000000",
            "1987156918504513709869"
        ]
    }
}
```

{% 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](https://docs.expand.network/integrations/dex-and-dex-aggregators/broken-reference) page for details. |

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

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

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": [
        "Aave",
        "Curve",
        "Curve V2",
        "Kyber DMM",
        "1inch Limit Order Protocol V2",
        "1inch Limit Order Protocol V3",
        "SushiSwap",
        "Baguette",
        "Canary",
        "ELK",
        "Lydia",
        "OliveSwap",
        "Pangolin",
        "TraderJoe",
        "Yetti",
        "Thorus",
        "Hakuswap",
        "Platypus",
        "WOOFi",
        "Axial",
        "ElasticSwap",
        "GMX",
        "Nerve Finance",
        "RadioShack",
        "KyberSwap Elastic",
        "SwapSicle",
        "Kyber DMM Static",
        "Aave V3",
        "TraderJoe V2",
        "DODO",
        "WOOFi V2",
        "Trident",
        "TraderJoe V2.1",
        "Nomiswap-epcs",
        "Uniswap V3",
        "Balancer V2",
        "PMM11",
        "Wombat"
    ]
}
```

{% 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](https://docs.expand.network/integrations/dex-and-dex-aggregators/broken-reference) page for details. |
| path<mark style="color:red;">\*</mark>     | Array  | Comma-separated values of token addresses/token symbol, inside an array, to swap.                                          |
| amountIn<mark style="color:red;">\*</mark> | String | Amount of token to be swapped.                                                                                             |
| 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": "1700",
    "amountIn": "100000000000000",
    "path": [
        "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
        "0x6B175474E89094C44Da98b954EedeAC495271d0F"
    ],
    "gas": "873376",
    "from": "0x40B38765696e3d5d8d9d834D8AaD4bB6e418E489"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "from": "0x40b38765696e3d5d8d9d834d8aad4bb6e418e489",
        "to": "0x1111111254eeb25477b68fb85ed929f73a960582",
        "data": "0x12aa3caf0000000000000000000000005f515f6c524b18ca30f7783fb58dd4be2e9904ec000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000005f515f6c524b18ca30f7783fb58dd4be2e9904ec00000000000000000000000040b38765696e3d5d8d9d834d8aad4bb6e418e48900000000000000000000000000000000000000000000000000005af3107a4000000000000000000000000000000000000000000000000000039164fbfd8245ff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e88cb415be2ce6ff09e7176ae5fde019288fbde721069e3a897cbe8d2cc23f1d83997ffcdd16ec52e55ff223cf826bd494b3ad1c071b475bc4de0981357f66c4ad00000000000000000000000000000000000000000000000000028a00001a4041c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2d0e30db05120111111125421ca6dc452d289314280a0f8842a65c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2012456a75868b57787bba02b068946e2017d3a92507dbf742e481eb758b0c85fd519fb0ff56c000000000000000000000000807cf9a772d5a3f9cefbc1192e939d62f0d9bd3800000000000000000000000000000000000000000000000000000000000000000000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000039aa200f6ca6b6b00000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000079f60066c6164b0000000000000000000000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000041fae29d60889c1159afef38d10abaef184765ce9eb84db06cd92e291bfa224adf084269d9405b5332b862d7d84cfa5942d4270c28b93b85b2c4f56ab8b4fdba5b1c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000141111111254eeb25477b68fb85ed929f73a960582000000000000000000000000000000000000000000000000000000000000000000000000caefa361",
        "value": "100000000000000",
        "gas": "873376",
        "referenceId": "7a3b7da5567e44fd98e994455e2495b7"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "dexId": "1700",
    "amountIn": "100000000000000",
    "path": [
        "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
        "0x6B175474E89094C44Da98b954EedeAC495271d0F"
    ],
    "gas": "873376",
    "gasPriority": "medium",
    "from": "0x40B38765696e3d5d8d9d834D8AaD4bB6e418E489"
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "from": "0x40b38765696e3d5d8d9d834d8aad4bb6e418e489",
        "to": "0x1111111254eeb25477b68fb85ed929f73a960582",
        "data": "0x12aa3caf0000000000000000000000005f515f6c524b18ca30f7783fb58dd4be2e9904ec000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000005f515f6c524b18ca30f7783fb58dd4be2e9904ec00000000000000000000000040b38765696e3d5d8d9d834d8aad4bb6e418e48900000000000000000000000000000000000000000000000000005af3107a4000000000000000000000000000000000000000000000000000039174a36690ff3d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e87c4f3de1e1b531d2694b248a9a2c18defbb8e5a8d36b60862fed57aa03ef0d52d2bc09b3a9b8054238a4a7fab88ebd9b9c41e1c8c7499afb142dfba8e02d0b0700000000000000000000000000000000000000000000000000028a00001a4041c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2d0e30db05120111111125421ca6dc452d289314280a0f8842a65c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2012456a75868bdc25da3cdc5082cfce528ee2aa8ad73c072eb768b944b1bc2f444b3fc4c44c5000000000000000000000000807cf9a772d5a3f9cefbc1192e939d62f0d9bd3800000000000000000000000000000000000000000000000000000000000000000000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000039ab0857164e13100000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000079980066c6163d000000000000000000000000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004130fab8662e997b495cc61d08b680bbc62ca39a3868953b37dd96bdb6994f24966e44c01baf018e604e86610b2a62c4bd984a6557e78e9e5f02967f8f9c2a910a1b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000141111111254eeb25477b68fb85ed929f73a960582000000000000000000000000000000000000000000000000000000000000000000000000caefa361",
        "value": "100000000000000",
        "gas": "873376",
        "gasPrice": "3326221197",
        "referenceId": "4a22968761294d13a7ca158709cbfd2f"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "dexId": "1700",
    "amountIn": "100000000000000",
    "path": [
        "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
        "0x6B175474E89094C44Da98b954EedeAC495271d0F"
    ],
    "gas": "873376",
    "gasPriority": "medium",
    "from": "0x40B38765696e3d5d8d9d834D8AaD4bB6e418E489",
    "slippage": "10"
}
```

{% endtab %}

{% tab title="Sample Response" %}
**With Slippage:**&#x20;

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "from": "0x40b38765696e3d5d8d9d834d8aad4bb6e418e489",
        "to": "0x1111111254eeb25477b68fb85ed929f73a960582",
        "data": "0x12aa3caf0000000000000000000000005f515f6c524b18ca30f7783fb58dd4be2e9904ec000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000005f515f6c524b18ca30f7783fb58dd4be2e9904ec00000000000000000000000040b38765696e3d5d8d9d834d8aad4bb6e418e48900000000000000000000000000000000000000000000000000005af3107a4000000000000000000000000000000000000000000000000000033df12c28500230000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e8e591f2e5b6078cad23a2522e756fdecc707dac0f9b985ae57a8eec5aecb2fd7b466e3df49f7200bec4fd17e3d7b98de3910660d562f6fe2a697c7dd2643a25af00000000000000000000000000000000000000000000000000028a00001a4041c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2d0e30db05120111111125421ca6dc452d289314280a0f8842a65c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2012456a75868fc1ccf3f71e7a9fc426cfe0307966f5ed9d5cb4e9babd3d7dd3c7b39efba04ca000000000000000000000000807cf9a772d5a3f9cefbc1192e939d62f0d9bd3800000000000000000000000000000000000000000000000000000000000000000000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000039a4583c1c8b16100000000000000000000000000000000000000000000000000005af3107a40000000000000000000000000000000007bae0066c61687000000000000000000000000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004101823d3b448d60ddcf478cb1d3ca76419dcf9fa35b6e925d82af4c4cc1e8c8a02b67466eec93d4020233daf56a2eca81a42d0659a2d1901dd61cd2350ce94eb11c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000141111111254eeb25477b68fb85ed929f73a960582000000000000000000000000000000000000000000000000000000000000000000000000caefa361",
        "value": "100000000000000",
        "gas": "873376",
        "gasPrice": "3626907305",
        "referenceId": "c2dca9d78e904f6bb220a0c58aaebd45"
    }
}
```

{% endtab %}
{% endtabs %}
