# Trader Joe

### /getprice

Returns the 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 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=2100&path=0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7%2C0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB&amountIn=1000000000000000000
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "amountIn": "1000000000000000000",
        "path": [
            "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
            "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB"
        ],
        "amountsOut": "57798768565384314383"
    }
}
```

{% endtab %}
{% endtabs %}

### /getuserliquidity

Returns the balance of a particular token pair of an account.

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

#### Query Parameters

| Name                                      | Type   | Description                                                                                                           |
| ----------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------- |
| rpc                                       | String | Remote procedural call URL.                                                                                           |
| tokenA<mark style="color:red;">\*</mark>  | String | Token Address of first token.                                                                                         |
| dexId<mark style="color:red;">\*</mark>   | String | Refer to [DexId](https://docs.expand.network/integrations/dex-and-dex-aggregators/broken-reference) page for details. |
| tokenB<mark style="color:red;">\*</mark>  | String | Token Address of second token.                                                                                        |
| address<mark style="color:red;">\*</mark> | String | User public address.                                                                                                  |
| id<mark style="color:red;">\*</mark>      | String | Bin ID whose liquidity is to be fetched.                                                                              |

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

```url
https://api.expand.network/dex/getuserliquidity?tokenA=0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7&tokenB=0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E&address=0x41917217DD34CEAd24Daa02b4Ca07bDE9E5FcD1d&dexId=2100&id=8376649
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "pairAddress": "0xD446eb1660F766d533BeCeEf890Df7A69d26f7d1",
        "liquidity": "0",
        "tokenA": "0",
        "tokenB": "0"
    }
}
```

{% endtab %}
{% endtabs %}

### /getpoolliquidity

Returns the total liquidity for a specified pool.

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

#### Query Parameters

| Name                                          | Type   | Description                                                                                                            |
| --------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------- |
| rpc                                           | String | Remote procedural call URL.                                                                                            |
| poolAddress<mark style="color:red;">\*</mark> | String | Pool address whose liquidity is to be fetched.                                                                         |
| dexId<mark style="color:red;">\*</mark>       | String | Refer to [DEX ID](https://docs.expand.network/integrations/dex-and-dex-aggregators/broken-reference) page for details. |
| id<mark style="color:red;">\*</mark>          | String | Bin ID whose liquidity is to be fetched.                                                                               |

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

```url
https://api.expand.network/dex/getpoolliquidity?dexId=2100&poolAddress=0xD446eb1660F766d533BeCeEf890Df7A69d26f7d1&id=8376653
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "totalLiquidity": "18984902854076810313408139190182580659015940571489"
    }
}
```

{% endtab %}
{% endtabs %}

### /gettokenliquidity

Returns the individual token liquidity within the specified liquidity pool.

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

#### Query Parameters

| Name                                          | Type   | Description                                                                                                            |
| --------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------- |
| rpc                                           | String | Remote procedural call URL.                                                                                            |
| poolAddress<mark style="color:red;">\*</mark> | String | The pool address.                                                                                                      |
| dexId<mark style="color:red;">\*</mark>       | String | Refer to [DEX ID](https://docs.expand.network/integrations/dex-and-dex-aggregators/broken-reference) page for details. |

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

```
https://api.expand.network/dex/gettokenliquidity?dexId=2100&poolAddress=0x9f8973FB86b35C307324eC31fd81Cf565E2F4a63
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "JOE": "3227032040427534312517737",
        "WAVAX": "41007188287627115196537"
    }
}
```

{% endtab %}
{% endtabs %}

### /swap

Initiate a swap transaction on a specified DEX.

<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, inside an array, to swap.                                                       |
| amountIn<mark style="color:red;">\*</mark> | String | Amount of token to be swapped.                                                                                             |
| amountOutMin                               | String | Minimum amount accepted as a result of swap.                                                                               |
| to<mark style="color:red;">\*</mark>       | String | Address of the recipient of the token.                                                                                     |
| 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.                                                                                                |
| gasPriority                                | String | low, medium, or high.                                                                                                      |
| slippage                                   | String | <p>Percentage of total swap value. <br>By default, 1.</p><p>0 <= slippage  value <= 100</p>                                |
| deadline<mark style="color:red;">\*</mark> | String | Deadline for the transaction to be executed (UNIX Timestamp).                                                              |

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

```json
{
    "dexId": "2100",
    "amountIn": "10000000000",
    "amountOutMin": "100",
    "path": [
        "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
        "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"
    ],
    "to": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
    "deadline": "1753156839",
    "from": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
    "gas": "100000"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "43114",
        "from": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
        "to": "0xb4315e873dBcf96Ffd0acd8EA43f689D8c20fB30",
        "value": "0",
        "gas": "100000",
        "data": "0x2a443fae00000000000000000000000000000000000000000000000000000002540be400000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e599400000000000000000000000000000000000000000000000000000000687f0ce7000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000b31f66aa3c1e785363f0875a1b74e27b85fd66c7000000000000000000000000b97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",
        "referenceId": "5c9704299e964d74acb0aaa16d9bbc77"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "dexId": "2100",
    "amountIn": "10000000000",
    "amountOutMin": "100",
    "path": [
        "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
        "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"
    ],
    "to": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
    "deadline": "1753156839",
    "from": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
    "gas": "100000",
    "gasPriority": "high"
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "43114",
        "from": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
        "to": "0xb4315e873dBcf96Ffd0acd8EA43f689D8c20fB30",
        "value": "0",
        "gas": "100000",
        "data": "0x2a443fae00000000000000000000000000000000000000000000000000000002540be400000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e599400000000000000000000000000000000000000000000000000000000687f0ce7000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000b31f66aa3c1e785363f0875a1b74e27b85fd66c7000000000000000000000000b97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",
        "gasPrice": "37500000000",
        "referenceId": "093c99284535404195176f1481d280f2"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "dexId": "2100",
    "amountIn": "10000000000",
    "amountOutMin": "100",
    "path": [
        "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
        "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"
    ],
    "to": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
    "deadline": "1753156839",
    "from": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
    "gas": "100000",
    "slippage": "6"
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "43114",
        "from": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
        "to": "0xb4315e873dBcf96Ffd0acd8EA43f689D8c20fB30",
        "value": "0",
        "gas": "100000",
        "data": "0x2a443fae00000000000000000000000000000000000000000000000000000002540be400000000000000000000000000000000000000000000000000000000000000005e00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e599400000000000000000000000000000000000000000000000000000000687f0ce7000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000b31f66aa3c1e785363f0875a1b74e27b85fd66c7000000000000000000000000b97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",
        "referenceId": "ff871910a2734625bced6749f1d4954f"
    }
}
```

{% endtab %}
{% endtabs %}

### /addliquidity

Add liquidity to a specified pool in a specified DEX.

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

#### 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. |
| tokenA<mark style="color:red;">\*</mark>     | String | Address of the first token being added.                                                                                    |
| tokenB<mark style="color:red;">\*</mark>     | String | Address of the second token being added.                                                                                   |
| amountA<mark style="color:red;">\*</mark>    | String | Desired amount of token A.                                                                                                 |
| amountB<mark style="color:red;">\*</mark>    | String | Desired amount of token B.                                                                                                 |
| amountAMin<mark style="color:red;">\*</mark> | String | Minimum amount of token A.                                                                                                 |
| amountBMin<mark style="color:red;">\*</mark> | String | Minimum amount of token B.                                                                                                 |
| deadline<mark style="color:red;">\*</mark>   | String | Deadline for the transaction to be executed (UNIX Timestamp).                                                              |
| to<mark style="color:red;">\*</mark>         | String | Address of the recipient of the token.                                                                                     |
| 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.                                                                                                |
| gasPriority                                  | String | low, medium, or high.                                                                                                      |
| slippage                                     | String | <p>Percentage of total value.<br>By default, 1.</p><p>0 <= slippage  value <= 100</p>                                      |
| strategy                                     | String | <p>spotUniform, curve or bidask.</p><p>By default, spotUniform.</p>                                                        |

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

```json
{
    "dexId": "2100",
    "tokenA": "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
    "tokenB": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
    "amountA": "10000000000000000",
    "amountB": "1000",
    "amountAMin": "1000000000",
    "amountBMin": "100",
    "to": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
    "deadline": "1706678170",
    "from": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
    "gas": "530000",
    "strategy": "bidask"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "43114",
        "from": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
        "to": "0xb4315e873dBcf96Ffd0acd8EA43f689D8c20fB30",
        "value": "0",
        "gas": "530000",
        "data": "0xa3c7271a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b31f66aa3c1e785363f0875a1b74e27b85fd66c7000000000000000000000000b97ef9ef8734c71904d8002f8b6bc66dd9c48a6e0000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000000000000000003e8000000000000000000000000000000000000000000000000000000003b9aca00000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000007f4753000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000004e0000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e5994000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e59940000000000000000000000000000000000000000000000000000000065b9d79a000000000000000000000000000000000000000000000000000000000000000bfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008e1bc9bf04000000000000000000000000000000000000000000000000000001aa535d3d0c000000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000000000000000000000000000002c68af0bb1400000000000000000000000000000000000000000000000000000354a6ba7a1800000000000000000000000000000000000000000000000000000354a6ba7a180000000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000000000000000000000000000000354a6ba7a1800000000000000000000000000000000000000000000000000000354a6ba7a18000000000000000000000000000000000000000000000000000002c68af0bb14000000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000000000000000000000000000001aa535d3d0c0000000000000000000000000000000000000000000000000000008e1bc9bf04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "referenceId": "c1e2bf7f2f034181b6f273eeab4f912f"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "dexId": "2100",
    "tokenA": "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
    "tokenB": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
    "amountA": "10000000000000000",
    "amountB": "1000",
    "amountAMin": "1000000000",
    "amountBMin": "100",
    "to": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
    "deadline": "1706678170",
    "from": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
    "gas": "530000",
    "strategy": "bidask",
    "gasPriority": "medium"
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "43114",
        "from": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
        "to": "0xb4315e873dBcf96Ffd0acd8EA43f689D8c20fB30",
        "value": "0",
        "gas": "530000",
        "data": "0xa3c7271a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b31f66aa3c1e785363f0875a1b74e27b85fd66c7000000000000000000000000b97ef9ef8734c71904d8002f8b6bc66dd9c48a6e0000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000000000000000003e8000000000000000000000000000000000000000000000000000000003b9aca00000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000007f4753000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000004e0000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e5994000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e59940000000000000000000000000000000000000000000000000000000065b9d79a000000000000000000000000000000000000000000000000000000000000000bfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008e1bc9bf04000000000000000000000000000000000000000000000000000001aa535d3d0c000000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000000000000000000000000000002c68af0bb1400000000000000000000000000000000000000000000000000000354a6ba7a1800000000000000000000000000000000000000000000000000000354a6ba7a180000000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000000000000000000000000000000354a6ba7a1800000000000000000000000000000000000000000000000000000354a6ba7a18000000000000000000000000000000000000000000000000000002c68af0bb14000000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000000000000000000000000000001aa535d3d0c0000000000000000000000000000000000000000000000000000008e1bc9bf04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "gasPrice": "30000000000",
        "referenceId": "d9f09ae10abe4b2a86760b6a2982a742"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "dexId": "2100",
    "tokenA": "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
    "tokenB": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
    "amountA": "10000000000000000",
    "amountB": "1000",
    "amountAMin": "1000000000",
    "amountBMin": "100",
    "to": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
    "deadline": "1706678170",
    "from": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
    "gas": "530000",
    "strategy": "bidask",
    "slippage": "5"
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "43114",
        "from": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
        "to": "0xb4315e873dBcf96Ffd0acd8EA43f689D8c20fB30",
        "value": "0",
        "gas": "530000",
        "data": "0xa3c7271a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b31f66aa3c1e785363f0875a1b74e27b85fd66c7000000000000000000000000b97ef9ef8734c71904d8002f8b6bc66dd9c48a6e0000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000389fd980000000000000000000000000000000000000000000000000000000000000005f00000000000000000000000000000000000000000000000000000000007f4753000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000004e0000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e5994000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e59940000000000000000000000000000000000000000000000000000000065b9d79a000000000000000000000000000000000000000000000000000000000000000bfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008e1bc9bf04000000000000000000000000000000000000000000000000000001aa535d3d0c000000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000000000000000000000000000002c68af0bb1400000000000000000000000000000000000000000000000000000354a6ba7a1800000000000000000000000000000000000000000000000000000354a6ba7a180000000000000000000000000000000000000000000000000000000000000000000b0000000000000000000000000000000000000000000000000354a6ba7a1800000000000000000000000000000000000000000000000000000354a6ba7a18000000000000000000000000000000000000000000000000000002c68af0bb14000000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000000000000000000000000000001aa535d3d0c0000000000000000000000000000000000000000000000000000008e1bc9bf04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "referenceId": "0433a8cfb259438fbac866db02b37c31"
    }
}
```

{% endtab %}
{% endtabs %}

### /removeliquidity

Remove liquidity from a specified pool for a specified DEX.

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

#### 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. |
| amountAMin<mark style="color:red;">\*</mark> | String | Minimum amount of Token A.                                                                                                 |
| deadline<mark style="color:red;">\*</mark>   | String | Deadline for the transaction to be executed (UNIX Timestamp).                                                              |
| 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.                                                                                                |
| tokenA<mark style="color:red;">\*</mark>     | String | Address of the first token being removed.                                                                                  |
| tokenB<mark style="color:red;">\*</mark>     | String | Address of the second token being removed.                                                                                 |
| amountBMin<mark style="color:red;">\*</mark> | String | Minimum amount of Token B.                                                                                                 |
| gasPriority                                  | String | low, medium, or high.                                                                                                      |
| binStep<mark style="color:red;">\*</mark>    | String | Difference between two consecutive bins.                                                                                   |
| ids<mark style="color:red;">\*</mark>        | Array  | Bin IDs that liquidity should be removed from.                                                                             |
| amounts<mark style="color:red;">\*</mark>    | Array  | LBToken(Liquidity Book Token) amount that should be removed.                                                               |
| to<mark style="color:red;">\*</mark>         | String | Address of the recipient of the token.                                                                                     |
| slippage                                     | String | <p>Percentage of total swap value. <br>By default, 1.</p><p>0 <= slippage  value <= 100</p>                                |

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

```json
{
    "dexId": "2100",
    "tokenA": "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
    "tokenB": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
    "amountBMin": "150",
    "amountAMin": "9140195223753",
    "to": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
    "deadline": "1705994811",
    "from": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
    "gas": "0",
    "binStep": "20",
    "ids": [
        "8375816",
        "8375817",
        "8375818",
        "8375819",
        "8375820",
        "8375821",
        "8375822",
        "8375823",
        "8375824",
        "8375825",
        "8375826"
    ],
    "amounts": [
        "6125082604576892342340742933771827806208",
        "6125082604576892342340742933771827806208",
        "6125082604576892342340742933771827806208",
        "6125082604576892342340742933771827806208",
        "6092234575456602778057561670181153099728",
        "27680318192948304012362129290692653566283",
        "49451196782276463859932823798226771515026",
        "49649387794231952910105025177550757137373",
        "49747539066384995844387966236176975326734",
        "49845022333457547462772063936365946907208",
        "49759874534344782452838208519883050222759"
    ]
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "43114",
        "from": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
        "to": "0xb4315e873dBcf96Ffd0acd8EA43f689D8c20fB30",
        "value": "0",
        "gas": "0",
        "data": "0xc22159b6000000000000000000000000b31f66aa3c1e785363f0875a1b74e27b85fd66c7000000000000000000000000b97ef9ef8734c71904d8002f8b6bc66dd9c48a6e0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000008501e16e8c90000000000000000000000000000000000000000000000000000000000000096000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e59940000000000000000000000000000000000000000000000000000000065af6a3b000000000000000000000000000000000000000000000000000000000000000b00000000000000000000000000000000000000000000000000000000007fce0800000000000000000000000000000000000000000000000000000000007fce0900000000000000000000000000000000000000000000000000000000007fce0a00000000000000000000000000000000000000000000000000000000007fce0b00000000000000000000000000000000000000000000000000000000007fce0c00000000000000000000000000000000000000000000000000000000007fce0d00000000000000000000000000000000000000000000000000000000007fce0e00000000000000000000000000000000000000000000000000000000007fce0f00000000000000000000000000000000000000000000000000000000007fce1000000000000000000000000000000000000000000000000000000000007fce1100000000000000000000000000000000000000000000000000000000007fce12000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000011e749b320370f2ffb725d59b83e134fd000000000000000000000000000000051585b5e27eade350ea520385aa349494b0000000000000000000000000000009152f2111edd2c814572e815769b40169200000000000000000000000000000091e80c44706e125e67a2ac3942edf58bdd0000000000000000000000000000009231e383c6d15f59c343db6e36486aee0e000000000000000000000000000000927b3a1bebb9d6fdc33c4f660035ceaa48000000000000000000000000000000923b2b3d4d8e1fe24bae173e9ca7a884a7",
        "referenceId": "8d0e630e55fd476fb691758eb231a1b6"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "dexId": "2100",
    "tokenA": "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
    "tokenB": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
    "amountBMin": "150",
    "amountAMin": "9140195223753",
    "to": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
    "deadline": "1705994811",
    "from": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
    "gas": "0",
    "gasPriority": "high",
    "binStep": "20",
    "ids": [
        "8375816",
        "8375817",
        "8375818",
        "8375819",
        "8375820",
        "8375821",
        "8375822",
        "8375823",
        "8375824",
        "8375825",
        "8375826"
    ],
    "amounts": [
        "6125082604576892342340742933771827806208",
        "6125082604576892342340742933771827806208",
        "6125082604576892342340742933771827806208",
        "6125082604576892342340742933771827806208",
        "6092234575456602778057561670181153099728",
        "27680318192948304012362129290692653566283",
        "49451196782276463859932823798226771515026",
        "49649387794231952910105025177550757137373",
        "49747539066384995844387966236176975326734",
        "49845022333457547462772063936365946907208",
        "49759874534344782452838208519883050222759"
    ]
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "43114",
        "from": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
        "to": "0xb4315e873dBcf96Ffd0acd8EA43f689D8c20fB30",
        "value": "0",
        "gas": "0",
        "data": "0xc22159b6000000000000000000000000b31f66aa3c1e785363f0875a1b74e27b85fd66c7000000000000000000000000b97ef9ef8734c71904d8002f8b6bc66dd9c48a6e0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000008501e16e8c90000000000000000000000000000000000000000000000000000000000000096000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e59940000000000000000000000000000000000000000000000000000000065af6a3b000000000000000000000000000000000000000000000000000000000000000b00000000000000000000000000000000000000000000000000000000007fce0800000000000000000000000000000000000000000000000000000000007fce0900000000000000000000000000000000000000000000000000000000007fce0a00000000000000000000000000000000000000000000000000000000007fce0b00000000000000000000000000000000000000000000000000000000007fce0c00000000000000000000000000000000000000000000000000000000007fce0d00000000000000000000000000000000000000000000000000000000007fce0e00000000000000000000000000000000000000000000000000000000007fce0f00000000000000000000000000000000000000000000000000000000007fce1000000000000000000000000000000000000000000000000000000000007fce1100000000000000000000000000000000000000000000000000000000007fce12000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000011e749b320370f2ffb725d59b83e134fd000000000000000000000000000000051585b5e27eade350ea520385aa349494b0000000000000000000000000000009152f2111edd2c814572e815769b40169200000000000000000000000000000091e80c44706e125e67a2ac3942edf58bdd0000000000000000000000000000009231e383c6d15f59c343db6e36486aee0e000000000000000000000000000000927b3a1bebb9d6fdc33c4f660035ceaa48000000000000000000000000000000923b2b3d4d8e1fe24bae173e9ca7a884a7",
        "gasPrice": "37500000000",
        "referenceId": "353043762845429e9edf7da9605c3531"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "dexId": "2100",
    "tokenA": "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
    "tokenB": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
    "amountBMin": "150",
    "amountAMin": "9140195223753",
    "to": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
    "slippage": "7",
    "deadline": "1705994811",
    "from": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
    "gas": "0",
    "binStep": "20",
    "ids": [
        "8375816",
        "8375817",
        "8375818",
        "8375819",
        "8375820",
        "8375821",
        "8375822",
        "8375823",
        "8375824",
        "8375825",
        "8375826"
    ],
    "amounts": [
        "6125082604576892342340742933771827806208",
        "6125082604576892342340742933771827806208",
        "6125082604576892342340742933771827806208",
        "6125082604576892342340742933771827806208",
        "6092234575456602778057561670181153099728",
        "27680318192948304012362129290692653566283",
        "49451196782276463859932823798226771515026",
        "49649387794231952910105025177550757137373",
        "49747539066384995844387966236176975326734",
        "49845022333457547462772063936365946907208",
        "49759874534344782452838208519883050222759"
    ]
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "43114",
        "from": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
        "to": "0xb4315e873dBcf96Ffd0acd8EA43f689D8c20fB30",
        "value": "0",
        "gas": "0",
        "data": "0xc22159b6000000000000000000000000b31f66aa3c1e785363f0875a1b74e27b85fd66c7000000000000000000000000b97ef9ef8734c71904d8002f8b6bc66dd9c48a6e0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000007bb2639254a000000000000000000000000000000000000000000000000000000000000008c000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e59940000000000000000000000000000000000000000000000000000000065af6a3b000000000000000000000000000000000000000000000000000000000000000b00000000000000000000000000000000000000000000000000000000007fce0800000000000000000000000000000000000000000000000000000000007fce0900000000000000000000000000000000000000000000000000000000007fce0a00000000000000000000000000000000000000000000000000000000007fce0b00000000000000000000000000000000000000000000000000000000007fce0c00000000000000000000000000000000000000000000000000000000007fce0d00000000000000000000000000000000000000000000000000000000007fce0e00000000000000000000000000000000000000000000000000000000007fce0f00000000000000000000000000000000000000000000000000000000007fce1000000000000000000000000000000000000000000000000000000000007fce1100000000000000000000000000000000000000000000000000000000007fce12000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000011e749b320370f2ffb725d59b83e134fd000000000000000000000000000000051585b5e27eade350ea520385aa349494b0000000000000000000000000000009152f2111edd2c814572e815769b40169200000000000000000000000000000091e80c44706e125e67a2ac3942edf58bdd0000000000000000000000000000009231e383c6d15f59c343db6e36486aee0e000000000000000000000000000000927b3a1bebb9d6fdc33c4f660035ceaa48000000000000000000000000000000923b2b3d4d8e1fe24bae173e9ca7a884a7",
        "referenceId": "fa40a832c4f947c5aef87e58b579a77a"
    }
}
```

{% endtab %}
{% endtabs %}
