# PancakeSwap V3

### Supported Chains

Available on **Arbitrum, Base, Binance Smart Chain, Ethereum and zkSync Era.**

### Available Endpoints:

*Click on the endpoint to jump to the section with full details*

* [<mark style="color:blue;">/getprice</mark>](#getprice) <mark style="color:blue;">`GET`</mark> - Returns the swap quotation for a given token pair on PancakeSwap V3.
* [<mark style="color:blue;">/getuserliquidity</mark>](#getuserliquidity) <mark style="color:blue;">`GET`</mark> - Returns the balance of a particular token pair of accounts.&#x20;
* [<mark style="color:blue;">/getpoolliquidity</mark>](#getpoolliquidity) <mark style="color:blue;">`GET`</mark> - Returns the total liquidity for a specified pool.
* [<mark style="color:blue;">/gettokenliquidity</mark>](#gettokenliquidity) <mark style="color:blue;">`GET`</mark> - Returns the individual token liquidity within the specified liquidity pool.
* [<mark style="color:blue;">/getindividualposition</mark>](#getindividualposition) <mark style="color:blue;">`GET`</mark> - Returns the liquidity position for a specified user address across all the pools for a given DEX. &#x20;
* [/<mark style="color:blue;">swap</mark>](#swap) <mark style="color:green;">`POST`</mark> - Initiate a swap transaction on a specified DEX.&#x20;
* [/<mark style="color:blue;">addliquidity</mark>](#addliquidity) <mark style="color:green;">`POST`</mark> - Add liquidity to a specified pool in a specified DEX.&#x20;
* [<mark style="color:blue;">/removeliquidity</mark>](#removeliquidity) <mark style="color:green;">`POST`</mark> - Remove liquidity from a specified pool in a specified DEX.&#x20;

### DEX IDs

Many endpoints have a parameter where you can provide a DEX ID.&#x20;

Below is a list of DEX IDs related to PancakeSwap V3. Please see the [DEX ID page](https://docs.expand.network/integrations/dex-and-dex-aggregators/broken-reference) for a complete DEX ID list and more information.

| DEX Name       | Chain               | DEX ID |
| -------------- | ------------------- | ------ |
| PancakeSwap V3 | Arbitrum            | 2808   |
| PancakeSwap V3 | Base                | 2809   |
| PancakeSwap V3 | Binance Smart Chain | 2800   |
| PancakeSwap V3 | Ethereum            | 2810   |
| PancakeSwap V3 | zkSync Era          | 2811   |

## Endpoint Details

### /getprice

Returns the swap quotation for a given token pair on PancakeSwap V3

<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 | See the [DEX ID](#dex-ids) page for a list of all DEX IDs.              |
| 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.                                                        |
| poolFees                                   | String | Different pool based on the fees. By default, it is selected as 3000.   |

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

```url
https://api.expand.network/dex/getprice?path=0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82,0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c&amountIn=100000000&dexId=2800&poolFees=10000
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "amountIn": "100000000",
        "path": [
            "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82",
            "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"
        ],
        "amountsOut": [
            "100000000",
            "306601"
        ]
    }
}
```

{% endtab %}
{% endtabs %}

[<mark style="color:blue;">back to top</mark>](#endpoints-available)

### /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.                                                                                           |
| tokenId<mark style="color:red;">\*</mark> | String | The token ID for PancakeSwap V3 liquidity position.                                                                   |
| dexId<mark style="color:red;">\*</mark>   | String | Refer to [DexId](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/getuserliquidity?dexId=2800&tokenId=1312988
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "liquidity": "0",
        "tokenV3": "0x55d398326f99059fF775485246999027B3197955"
    }
}
```

{% endtab %}
{% endtabs %}

[back to top](#endpoints-available)

### /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. |

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

```url
https://api.expand.network/dex/getpoolliquidity?dexId=2800&poolAddress=0xd710DaC10B7255fCc0eC929a0e742A18F25b6395
```

{% endtab %}

{% tab title="Sample Response" %}

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

{% endtab %}
{% endtabs %}

[back to top](#endpoints-available)

### /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=2800&poolAddress=0xd710DaC10B7255fCc0eC929a0e742A18F25b6395
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "Cake": "590637823886899595162",
        "WBNB": "866859192915598532"
    }
}
```

{% endtab %}
{% endtabs %}

[back to top](#endpoints-available)

### /getpoolindividualliquidity

Returns all user addresses, block numbers, and token position details for a specified pool address.

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

#### 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. |
| endBlock                                      | String | Last block of the range.                                                                                               |
| startBlock                                    | String | Starting block of the range.                                                                                           |

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

```url
https://historicallp.api.expand.network/dex/getpoolindividualliquidity?poolAddress=0x588d7cf062f4edd7c7c7f2d66fd770e03b1ea735&dexId=2800&startBlock=44738053&endBlock=44738153
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": [
        {
            "userAddress": "0xb114dfcce738e7b753a9005a343bf9ca8686c2b4",
            "liquidityData": [
                {
                    "blockNumber": "44738153",
                    "transactionHash": "0x3963520633ef30a4ebb99cdf75e5c921e52cb909051d17efe359244dc8a5f85a",
                    "assets": {
                        "CAT": "2682843343703379432904002",
                        "WBNB": "1000000000000000000"
                    }
                }
            ]
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### /getpool

&#x20;Returns poolAddress, tickSpacing, poolFees, tokensLiquidity and liquidity data based on tokenA and tokenB

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

#### Query Parameters

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

```url
https://api.expand.network/dex/getpool?dexId=2810&tokenA=0x6982508145454Ce325dDbE47a25d4ec3d2311933&tokenB=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": [
        {
            "poolAddress": "0x3202AcfD55232f3706aa81a4F18A98686B5e1d1B",
            "poolFees": "10000",
            "tickSpacing": "200",
            "tokensLiquidity": {
                "PEPE": "319891629108825742546293041",
                "WETH": "1205497090996742820"
            },
            "liquidity": "22964337843205431370008"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### /getindividualposition

Returns the liquidity position for a specified user address across all the pools for a given DEX.&#x20;

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

#### Query Parameters

| Name                                      | Type   | Description                                                                                                            |
| ----------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------- |
| rpc                                       | String | Remote procedural call URL.                                                                                            |
| address<mark style="color:red;">\*</mark> | String | The public address of the liquidity holder.                                                                            |
| 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. |
| poolAddresses                             | String | The pool Addresses whose liquidity is to be fetched. *(Comma-separated vaules)*                                        |

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

```url
https://api.expand.network/dex/getindividualposition?dexId=2800&address=0x1782ceA0D026430ad4b410697c2df05a104EFA9b
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "aggregatedLiquidity": "72444604462753293596618",
        "poolResponse": {
            "TONCOINWBNB": {
                "0x43bEB5b09ac912c4288dB731FE7c30507e252C2A": "15779353064773789"
            },
            "USDTCake-LP": {
                "0xE210A02C2ec1455b2FCcC44DdeC7350069fe82bd": "6297850996707074851911"
            },
            "ETHWBNB": {
                "0x62Fcb3C1794FB95BD8B1A97f6Ad5D8a7e4943a1e": "2493746513801523617"
            },
            "USDTTONCOIN": {
                "0x0C908dd60E9fe25b22fF27a708764b8539f827Ee": "62084827588607788"
            },
            "CakemCake": {
                "0xa9AE342B34f3aB5fF41c6790Cc483B3529DFEFbB": "21419819327158619681573"
            },
            "WBNBPOSEIDON": {
                "0x17D8F66a21646143f409668c73Ee98859F7D7cb7": "956368188650006020443"
            },
            "WBNBTHE": {
                "0x2E2DcA75BBD1a4CE87F59F52f22fd252963eeA03": "30772500373629930566"
            },
            "CakeWBNB": {
                "0xAfB2Da14056725E3BA3a30dD846B6BBbd7886c56": "47259662655317815919"
            },
            "ZROWBNB": {
                "0xC241e8fb314bc3799BE2Db94dCE4d070c29b425d": "252928787577262072535"
            },
            "KASUSDT": {
                "0x92FB8463ac6BC0f700b20cD67CdEE7C753947f66": "6802786118907420"
            },
            "USDTZRO": {
                "0x1437A1f1112E1C342c24E83194A4b2eD06c15794": "524873430052127267391"
            },
            "ULTIUSDT": {
                "0x468Be8C177849E698AF38a153CAb6E7e2684a612": "936065694612754763411"
            },
            "USDTFRAX": {
                "0x062E5A0E976878755311E9254bE65821CEB25adF": "41976087461485927380255"
            }
        }
    }
}
```

{% endtab %}
{% endtabs %}

[back to top](#endpoints-available)

### /swap

Initiate a swap transaction on a specified DEX.

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

#### Request Body

<table><thead><tr><th width="177">Name</th><th width="105">Type</th><th>Description</th></tr></thead><tbody><tr><td>rpc</td><td>String</td><td>Remote procedural call URL.</td></tr><tr><td>dexId<mark style="color:red;">*</mark></td><td>String</td><td>Refer to the <a href="broken-reference">DEX ID</a> page for details. </td></tr><tr><td>path<mark style="color:red;">*</mark></td><td>Array</td><td>Comma-separated values of token addresses, inside an array, to swap.</td></tr><tr><td>amountIn<mark style="color:red;">*</mark></td><td>String</td><td>Amount of token to be swapped.</td></tr><tr><td>amountOutMin</td><td>String</td><td>Minimum amount accepted as a result of swap.</td></tr><tr><td>to<mark style="color:red;">*</mark></td><td>String</td><td>Address of the recipient of the token.</td></tr><tr><td>from<mark style="color:red;">*</mark></td><td>String</td><td>Address of the sender of the token.</td></tr><tr><td>gas</td><td>String</td><td>Maximum gas limit provided by the sender, for the transaction.</td></tr><tr><td>poolFees</td><td>String</td><td>Different pool based on the fees. By default, it is selected as 3000.</td></tr><tr><td>gasPriority</td><td>String</td><td>low, medium, or high.</td></tr><tr><td>slippage</td><td>String</td><td><p>Percentage of total swap value. <br>By default, 1.</p><p>0 &#x3C;= slippage  value &#x3C;= 100</p></td></tr></tbody></table>

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

```json
{
    "dexId": "2800",
    "path": ["0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c", "0x55d398326f99059fF775485246999027B3197955"],
    "amountIn":"1000000000000",
    "gas": "100000",
    "to": "0xf67d5d28614f26f56a73E635197534871D4ACf14",
    "amountOutMin": "100",
    "from": "0xf67d5d28614f26f56a73E635197534871D4ACf14",
    "poolFees": "10000",
    "involveBaseToken": "1",
    "deadline": "19999999999999"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "56",
        "from": "0xf67d5d28614f26f56a73E635197534871D4ACf14",
        "to": "0x1b81D678ffb9C0263b24A97847620C99d213eB14",
        "value": "1000000000000",
        "gas": "100000",
        "data": "0xac9650d800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000104414bf389000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000000000000002710000000000000000000000000f67d5d28614f26f56a73e635197534871d4acf14000000000000000000000000000000000000000000000000000012309ce53fff000000000000000000000000000000000000000000000000000000e8d4a510000000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000412210e8a00000000000000000000000000000000000000000000000000000000",
         "estimationCheck": true,
        "referenceId": "29b6e3b2db4c473faf81a91ff2262071"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "dexId": "2800",
    "path": ["0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c", "0x55d398326f99059fF775485246999027B3197955"],
    "amountIn":"1000000000000",
    "gas": "100000",
    "to": "0xf67d5d28614f26f56a73E635197534871D4ACf14",
    "amountOutMin": "100",
    "from": "0xf67d5d28614f26f56a73E635197534871D4ACf14",
    "poolFees": "10000",
    "involveBaseToken": "1",
    "deadline": "19999999999999",
    "gasPriority": "medium"
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "56",
        "from": "0xf67d5d28614f26f56a73E635197534871D4ACf14",
        "to": "0x1b81D678ffb9C0263b24A97847620C99d213eB14",
        "value": "1000000000000",
        "gas": "100000",
        "data": "0xac9650d800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000104414bf389000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000000000000002710000000000000000000000000f67d5d28614f26f56a73e635197534871d4acf14000000000000000000000000000000000000000000000000000012309ce53fff000000000000000000000000000000000000000000000000000000e8d4a510000000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000412210e8a00000000000000000000000000000000000000000000000000000000",
        "gasPrice": "1200000000",
        "estimationCheck": true,
        "referenceId": "25a2c29b527d429997702dffb45e06c5"
    }
}
```

{% endtab %}
{% endtabs %}

[back to top](#endpoints-available)

### /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.                                                                                   |
| poolFees<mark style="color:red;">\*</mark>       | String | Different pool based on the fees.                                                                                          |
| amountADesired<mark style="color:red;">\*</mark> | String | Desired amount of token A.                                                                                                 |
| amountBDesired<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.                                                                                                |
| tokenId                                          | String | The token ID for PancakeSwap V3 liquidity position.                                                                        |
| gasPriority                                      | String | low, medium, or high.                                                                                                      |
| slippage                                         | String | <p>Percentage of total value. <br>By default, 1.</p><p>0 <= slippage  value <= 100</p>                                     |

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

```json
{
    "dexId": "2800",
    "tokenA": "0x55d398326f99059fF775485246999027B3197955",
    "tokenB": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
    "amountADesired":"1000",
    "amountBDesired": "10",
    "amountAMin": "0",
    "amountBMin": "0",
    "deadline": "19999999999",
    "gas": "10000",
    "to": "0xf67d5d28614f26f56a73E635197534871D4ACf14",
    "amountOutMin": "100",
    "from": "0xf67d5d28614f26f56a73E635197534871D4ACf14",
    "poolFees": "10000"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "56",
        "from": "0xf67d5d28614f26f56a73E635197534871D4ACf14",
        "to": "0x46A15B0b27311cedF172AB29E4f4766fbE7F4364",
        "value": "0",
        "gas": "10000",
        "data": "0xac9650d800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000001648831645600000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c0000000000000000000000000000000000000000000000000000000000002710ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0ab0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0dd000000000000000000000000000000000000000000000000000000000000003e8000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f67d5d28614f26f56a73e635197534871d4acf1400000000000000000000000000000000000000000000000000000004a817c7ff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000412210e8a00000000000000000000000000000000000000000000000000000000",
        "estimationCheck": true,
        "referenceId": "5cc0e39341854b10bffb78b52738e3c2"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "dexId": "2800",
    "tokenA": "0x55d398326f99059fF775485246999027B3197955",
    "tokenB": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
    "amountADesired": "1000",
    "amountBDesired": "10",
    "amountAMin": "0",
    "amountBMin": "0",
    "deadline": "19999999999",
    "gas": "10000",
    "to": "0xf67d5d28614f26f56a73E635197534871D4ACf14",
    "amountOutMin": "100",
    "from": "0xf67d5d28614f26f56a73E635197534871D4ACf14",
    "poolFees": "10000",
    "gasPriority": "medium"
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "56",
        "from": "0xf67d5d28614f26f56a73E635197534871D4ACf14",
        "to": "0x46A15B0b27311cedF172AB29E4f4766fbE7F4364",
        "value": "0",
        "gas": "10000",
        "data": "0xac9650d800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000001648831645600000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c0000000000000000000000000000000000000000000000000000000000002710ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0ab0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0dd000000000000000000000000000000000000000000000000000000000000003e8000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f67d5d28614f26f56a73e635197534871d4acf1400000000000000000000000000000000000000000000000000000004a817c7ff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000412210e8a00000000000000000000000000000000000000000000000000000000",
        "gasPrice": "1200000000",
        "estimationCheck": true,
        "referenceId": "57755b589ac14a23a8a006b83da04eb6"
    }
}
```

{% endtab %}
{% endtabs %}

[back to top](#endpoints-available)

### /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. |
| tokenId<mark style="color:red;">\*</mark>   | String | The token ID for PancakeSwap V3 liquidity position.                                                                        |
| amountAMin                                  | String | Minimum amount of Token A.                                                                                                 |
| amountAMax                                  | String | Maximum amount of Token A.                                                                                                 |
| amountBMax                                  | String | Maximum amount of Token B.                                                                                                 |
| recipient                                   | String | Recipient for sweep tokens.                                                                                                |
| 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                                      | String | Address of the second token being removed.                                                                                 |
| liquidity<mark style="color:red;">\*</mark> | string | The liquidity to be removed.                                                                                               |
| amountBMin                                  | String | Minimum amount of Token B.                                                                                                 |
| gasPriority                                 | String | low, medium, or high.                                                                                                      |
| slippage                                    | String | <p>Percentage of total value. <br>By default, 1.</p><p>0 <= slippage  value <= 100</p>                                     |

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

```json
{
    "dexId": "2800",
    "tokenA": "0x55d398326f99059fF775485246999027B3197955",
    "tokenB": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
    "amountAMax": "1000",
    "amountBMax": "10",
    "amountAMin": "0",
    "amountBMin": "0",
    "deadline": "19999999999",
    "liquidity": "10000",
    "gas": "10000",
    "amountOutMin": "100",
    "from": "0x176a7FCF400d3af85909e5A16ea9D04b4717C529",
    "tokenId": "1312988"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "56",
        "from": "0x176a7FCF400d3af85909e5A16ea9D04b4717C529",
        "to": "0x46A15B0b27311cedF172AB29E4f4766fbE7F4364",
        "value": "0",
        "gas": "10000",
        "data": "0xac9650d80000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000000a40c49ccbe00000000000000000000000000000000000000000000000000000000001408dc00000000000000000000000000000000000000000000000000000000000027100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a817c7ff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084fc6f786500000000000000000000000000000000000000000000000000000000001408dc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e8000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004449404b7c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000176a7fcf400d3af85909e5a16ea9d04b4717c529000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064df2ab5bb00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000000000000000000000000000000000000000000176a7fcf400d3af85909e5a16ea9d04b4717c52900000000000000000000000000000000000000000000000000000000",
        "estimationCheck": true,
        "referenceId": "1d38812d15d749f4834dab14733c502c"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "dexId": "2800",
    "tokenA": "0x55d398326f99059fF775485246999027B3197955",
    "tokenB": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
    "amountAMax": "1000",
    "amountBMax": "10",
    "amountAMin": "0",
    "amountBMin": "0",
    "deadline": "19999999999",
    "liquidity": "10000",
    "gas": "10000",
    "amountOutMin": "100",
    "from": "0x176a7FCF400d3af85909e5A16ea9D04b4717C529",
    "tokenId": "1312988",
    "gasPriority": "medium"
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "56",
        "from": "0x176a7FCF400d3af85909e5A16ea9D04b4717C529",
        "to": "0x46A15B0b27311cedF172AB29E4f4766fbE7F4364",
        "value": "0",
        "gas": "10000",
        "data": "0xac9650d80000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000000a40c49ccbe00000000000000000000000000000000000000000000000000000000001408dc00000000000000000000000000000000000000000000000000000000000027100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a817c7ff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084fc6f786500000000000000000000000000000000000000000000000000000000001408dc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e8000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004449404b7c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000176a7fcf400d3af85909e5a16ea9d04b4717c529000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064df2ab5bb00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000000000000000000000000000000000000000000176a7fcf400d3af85909e5a16ea9d04b4717c52900000000000000000000000000000000000000000000000000000000",
        "gasPrice": "1200000000",
        "estimationCheck": true,
        "referenceId": "0f1162e935ed446baa99cf7f12dfdd03"
    }
}
```

{% endtab %}
{% endtabs %}

[back to top](#endpoints-available)
