# PancakeSwap V2

## Supported Chains

Available on **Aptos, Binance Mainnet, and Binance Testnet.**

## 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.
* [<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;">/</mark>](#getprice)[<mark style="color:blue;">getliquidityholders</mark>](#getliquidityholders) <mark style="color:blue;">`GET`</mark> - Returns the swap quotation for a given token pair. - Returns the total number of liquidity holders in the specified pool. Currently Available on **Binance.**
* [<mark style="color:blue;">/</mark>](#getprice)[<mark style="color:blue;">getindividualposition</mark>](#getindividualposition) <mark style="color:blue;">`GET`</mark> - Returns the swap quotation for a given token pair. - Returns the total number of liquidity holders in the specified pool. Currently Available on **Binance.**
* [<mark style="color:blue;">/</mark>](#getprice)[<mark style="color:blue;">getpoolindividualliquidity</mark>](#getpoolindividualliquidity) <mark style="color:blue;">`GET`</mark> - Returns all user addresses, block numbers, and token position details for a specified pool address. Currently Available on **Binance.**
* [<mark style="color:blue;">/</mark>](#getprice)[<mark style="color:blue;">gethistoricaltimeseries</mark> ](#gethistoricaltimeseries)<mark style="color:blue;">`GET`</mark> - Returns the swap quotation for a given token pair. - Returns the total number of liquidity holders in the specified pool. Currently Available on **Binance.**
* [<mark style="color:blue;">/</mark>](#getprice)[<mark style="color:blue;">gethistoricaltransactions</mark>](#gethistoricaltransactions) <mark style="color:blue;">`GET`</mark> - Returns the swap quotation for a given token pair. - Returns the total number of liquidity holders in the specified pool. Currently Available on **Binance.**
* [<mark style="color:blue;">/</mark>](#getprice)[<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;">/</mark>](#getprice)[<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;">/</mark>](#getprice)[<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/ids/dex-ids) for a complete DEX ID list and more information.

| DEX Name       | Chain                       | DEX ID |
| -------------- | --------------------------- | ------ |
| PancakeSwap V2 | Binance Smart Chain         | 1200   |
| PancakeSwap V2 | Binance Smart Chain Testnet | 1201   |
| PancakeSwap V2 | Aptos                       | 2900   |
| PancakeSwap V2 | Aptos Testnet               | 2901   |

## Endpoint Details

### /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=1200&path=0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c,0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82&amountIn=10000000000000000000
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "amountIn": "10000000000000000000",
        "path": [
            "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
            "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82"
        ],
        "amountsOut": [
            "10000000000000000000",
            "771915564765835452853"
        ]
    }
}
```

{% 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 | Address of token.                                                                                                           |
| address<mark style="color:red;">\*</mark> | String | Public address of liquidity provider.                                                                                       |
| 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. |
| tokenB<mark style="color:red;">\*</mark>  | String | Address of token                                                                                                            |

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

```url
https://api.expand.network/dex/getuserliquidity?address=0x6fb447ae94f5180254d436a693907a1f57696900&dexId=1200&tokenA=0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c&tokenB=0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82
```

{% endtab %}

{% tab title="Sample Response" %}

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

{% endtab %}
{% endtabs %}

#### Query Parameters for APTOS

| Name                                          | Type   | Description                                                                                                                 |
| --------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------- |
| rpc                                           | String | Remote procedural call URL.                                                                                                 |
| poolAddress<mark style="color:red;">\*</mark> | String | Address of token.                                                                                                           |
| address<mark style="color:red;">\*</mark>     | String | Public address of liquidity provider.                                                                                       |
| 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" %}

```
https://api.expand.network/dex/getuserliquidity?dexId=2901&poolAddress=0xc7efb4076dbe143cbcd98cfaaa929ecfc8f299203dfff63b95ccb6bfe19850fa%3A%3Aswap%3A%3ALPToken%3C0x1%3A%3Aaptos_coin%3A%3AAptosCoin%2C0x8c805723ebc0a7fc5b7d3e7b75d567918e806b3461cb9fa21941a9edc0220bf%3A%3Adevnet_coins%3A%3ADevnetBNB%3E&address=0xa182b65f4bf10be7ef870496893c170af3079a2540c63b470445417fcfb21c5b
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "pairAddress": "0xc7efb4076dbe143cbcd98cfaaa929ecfc8f299203dfff63b95ccb6bfe19850fa::swap::LPToken<0x1::aptos_coin::AptosCoin,0x8c805723ebc0a7fc5b7d3e7b75d567918e806b3461cb9fa21941a9edc0220bf::devnet_coins::DevnetBNB>",
        "liquidity": "3000",
        "tokenA": "2138066",
        "tokenB": "20"
    }
}
```

{% 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. |

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

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

{% endtab %}

{% tab title="Sample Response" %}

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

{% 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=1200&poolAddress=0x460b4193Ec4C1a17372Aa5FDcd44c520ba658646
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "CTK": "73040589498",
        "WBNB": "163589136764841979343"
    }
}
```

{% endtab %}
{% endtabs %}

### /getindividualposition

#### Returns the liquidity position for a specified user address across all the pools for the DEX. Currently available on **Binance**

<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.               |
| poolSize                                  | String | <p>The number of pools for which the user intends to fetch the individual position. <br><em>By default: 50, Maximum: 9,950</em> </p> |
| 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?poolAddresses=0xC05654C66756eBB82c518598c5f1ea1a0199a563&address=0x8f295a22a4a5ef346192d2b2d4c483d9f76b2a67&poolSize=1000&dexId=1200
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "aggregatedLiquidity": "0",
        "poolAddresses": {
            "USTmAMZN": {
                "0xC05654C66756eBB82c518598c5f1ea1a0199a563": "0"
            }
        }
    }
}
```

{% endtab %}
{% endtabs %}

### /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=0xc736ca3d9b1e90af4230bd8f9626528b3d4e0ee0&dexId=1200&startBlock=44752009&endBlock=44753009
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": [
        {
            "userAddress": "0x24397a020cc26ba3084e3f8106f3e597f962c034",
            "liquidityData": [
                {
                    "blockNumber": "44753009",
                    "transactionHash": "0x7f4353626685cd1d13f3f6add484eacc2cc8c6fea64cb6c28937a7d2975fa586",
                    "assets": {
                        "WBNB": "3729419725858309",
                        "BabyDoge": "445796452803705450"
                    }
                }
            ]
        },
        {
            "userAddress": "0xf4c21a1cb819e5f7abe6defde3d118d8f3d61fa7",
            "liquidityData": [
                {
                    "blockNumber": "44752833",
                    "transactionHash": "0xb854f4a4ba18144d9f6d485ddaae36f4441882a4fb6dca646c6d8bdfcb367983",
                    "assets": {
                        "WBNB": "997500000028",
                        "BabyDoge": "118695543460105"
                    }
                }
            ]
        }
    ]
}
```

{% 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=3600&tokenA=0x4200000000000000000000000000000000000006&tokenB=0xacfE6019Ed1A7Dc6f7B508C02d1b04ec88cC21bf
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": [
        {
            "poolAddress": "0x7eC6C9D993D9832Aa654593f2Dbc21303650Bc6c",
            "tickSpacing": "100",
            "tokensLiquidity": {
                "WETH": "48768555569924423019",
                "VVV": "53838383560167152098431"
            },
            "liquidity": "17265977496275101973877"
        },
        {
            "poolAddress": "0x46D398A5b33709877f50c8918A7eE96F1Be1d7dd",
            "tickSpacing": "200",
            "tokensLiquidity": {
                "WETH": "20559058494109486027",
                "VVV": "32656440862879438912554"
            },
            "liquidity": "53885788767252899437975"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### /gethistoricaltimeseries

#### Get the historical time series transactions for a specific pool address. Currently available on **Binance**

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

#### Query Parameters

| Name                                          | Type   | Description                                                                                                            |
| --------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------- |
| 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.                                                                                           |
| poolAddress<mark style="color:red;">\*</mark> | String | Pool address whose time series is to be fetched.                                                                       |

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

```url
https://historicaltrade.api.expand.network/dex/gethistoricaltimeseries?dexId=1200&poolAddress=0x16b9a82891338f9ba80e2d6970fdda79d1eb0dae&startBlock=18675000&endBlock=18675639
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "pair": "USDT/WBNB",
        "priceData": [
            {
                "hash": "0xa4e7be3c64891136a667454270401c96862b530242a8b66d2935512d26eea240",
                "timestamp": 1655192852,
                "price": "0.004358852942015572"
            },
            {
                "hash": "0xfc445916adc369b5a7717808b2d2380407aa707d7b81bcda9705b9ac0cc43caf",
                "timestamp": 1655192852,
                "price": "0.004337034359420212"
            },
            {
                "hash": "0x05c2f77bc5157eba0db611c967955be3e54c15abf61a6e655010449336291651",
                "timestamp": 1655192852,
                "price": "0.004337047750174369"
            },
            {
                "hash": "0x91adb38cf7f98fc03960c26ec4085c771561475788990af71dfa9012975a4d4d",
                "timestamp": 1655192852,
                "price": "0.004337070125743882"
            },
            {
                "hash": "0xd0e91cd038b18db3ea774d25375143e920613e18229cc6f1a41255b276c54eff",
                "timestamp": 1655192852,
                "price": "0.004358845309343015"
            },
            {
                "hash": "0xbcbd869b9279b615fe448cceb49658effd9a200e277edeb2739744b93f65f23d",
                "timestamp": 1655192849,
                "price": "0.0043588399027473515"
            },
            {
                "hash": "0x454ebac31c3be6ea198b44a50ae2ca51ee6e5c944a2de0602a67b9ec08bcdbd2",
                "timestamp": 1655192849,
                "price": "0.004358806972252251"
            },
            {
                "hash": "0xdf459434fd3742280d7974148d081f6299574b5157f84f157b21c10085fcf8e5",
                "timestamp": 1655192849,
                "price": "0.004358688622314105"
            },
            {
                "hash": "0x8361faaf2587cdec84f2a0ea41242d001b5f929d890051b602d7de4eeb9a497c",
                "timestamp": 1655192849,
                "price": "0.0043368340207808895"
            },
            {
                "hash": "0x0be5699c728432639245b5a6c4695438bfe3224e4eec2b327dab1c45eee6710f",
                "timestamp": 1655192849,
                "price": "0.004336857766910803"
            },
            {
                "hash": "0xc848656fe95f61858d8ff8c4910bc5b69e198653ebc21034b2ae045d65ac0521",
                "timestamp": 1655192846,
                "price": "0.004358629672082426"
            },
            {
                "hash": "0x791aae590fefadb4fb3422a216aed0e55b271df12062291aebc3e53745388f23",
                "timestamp": 1655192846,
                "price": "0.004336885209614627"
            },
            {
                "hash": "0xf948b7e4479f12509de652876faa6ad6ff80e9b93ed7c13d30bb879dbce71095",
                "timestamp": 1655192846,
                "price": "0.00433692364846471"
            },
            {
                "hash": "0x2d15e55b576aa93dc56e2c0cb40f39603ba3bfea7fd8f8127f3703ef19037dbf",
                "timestamp": 1655192846,
                "price": "0.004336941452759448"
            },
            {
                "hash": "0xda519c4ad1ac81eef91d811070c2ce7aaaf73c26130fff0c2d75e4060320219c",
                "timestamp": 1655192846,
                "price": "0.0043369887652104176"
            },
            {
                "hash": "0x23aff53216899aa1487850ea5f5bf612809a0e54f9249038a59d22df5b3479d0",
                "timestamp": 1655192843,
                "price": "0.004337022248686662"
            },
            {
                "hash": "0x6578930cb092f99ebc02e0d953c7af541376bdd032b9ba0f451836c14ae9a052",
                "timestamp": 1655192843,
                "price": "0.004358738297104802"
            },
            {
                "hash": "0x4f7f69ece57edb492c9bc3843b937e5738e6c28b24a2932b7587a2900b2cdb4d",
                "timestamp": 1655192843,
                "price": "0.004358637548123467"
            },
            {
                "hash": "0xd6569ff1abc750321dd683d2b9ce0d7b6f0d1dae7905e206a1d9b75315f425ac",
                "timestamp": 1655192831,
                "price": "0.00435856778887612"
            },
            {
                "hash": "0x798aa48de7896143e1626e60150c67692792f0b55667e697af6df4fdb8f505ab",
                "timestamp": 1655192831,
                "price": "0.004336801456985259"
            },
            {
                "hash": "0x798aa48de7896143e1626e60150c67692792f0b55667e697af6df4fdb8f505ab",
                "timestamp": 1655192831,
                "price": "0.004336801501292449"
            },
            {
                "hash": "0xbb9864acf695370b923afc0129311e66b8acf069bddcd8e9c33b32cefa793a11",
                "timestamp": 1655192831,
                "price": "0.0043368030469385695"
            },
            {
                "hash": "0x1d2889468b253063a8064379b449d4c832dd711643822e00b77c1a7faa6ee12d",
                "timestamp": 1655192831,
                "price": "0.004358566285450221"
            },
            {
                "hash": "0x11c01dafcd48e5dda30fc69a49ec88432a891b195227c32506e9748f7d3bff72",
                "timestamp": 1655192831,
                "price": "0.004336847740684698"
            },
            {
                "hash": "0x487ec3d3d56d518067fe0389bb10ab94f378e78f97919c5d6598a6a68eed8d25",
                "timestamp": 1655192831,
                "price": "0.0043608408925375165"
            },
            {
                "hash": "0xf4ebb66455d4a7cad46aec25fc8685e7910494d46ff6bda3a1951182d879194b",
                "timestamp": 1655192831,
                "price": "0.004336938355279746"
            },
            {
                "hash": "0xdb3670b569d0a9ee510cbcdf7aabc88b600503c094770204ae67e3c3e3b7114a",
                "timestamp": 1655192828,
                "price": "0.0043587619240398195"
            },
            {
                "hash": "0xe127e43a7a0bf909779bf022f271cbce881bde0b91cbec2e2a45580f086c8d17",
                "timestamp": 1655192828,
                "price": "0.004337185440945262"
            },
            {
                "hash": "0xb7e91a51e4e4dbaac8e9c5020a55573b34733d58f94c75c0b558d329553920de",
                "timestamp": 1655192828,
                "price": "0.004337380650207665"
            },
            {
                "hash": "0x239065c70237bdf70c71d8c9f32507ccffd7b8ae6f1307d1767a8f3e5f1c6594",
                "timestamp": 1655192828,
                "price": "0.004337441760628281"
            },
            {
                "hash": "0x485528434a50577fb8edb887581d53a4a31b359cf1b20a8048381911e053608d",
                "timestamp": 1655192828,
                "price": "0.004359260988922678"
            },
            {
                "hash": "0xf44680d3d3dcd9abbeec85d595ba14bb67b79f6c2f72b2fe38e708f756efa81d",
                "timestamp": 1655192828,
                "price": "0.004359242173012291"
            },
            {
                "hash": "0x8c3555fd7abad3acb109716ce549e328693ce357da69e9a54c7a37a0f7c7e927",
                "timestamp": 1655192828,
                "price": "0.004337469152200651"
            },
            {
                "hash": "0x8557537d52021cb4e2ebf0389de962f2affbbd1578e9e9d91674596de84a8b13",
                "timestamp": 1655192825,
                "price": "0.0043374792948373915"
            },
            {
                "hash": "0xd4b5151b9a5a07e49024186dacff0b7a8d23198f917c093cf583c4771ec9d422",
                "timestamp": 1655192825,
                "price": "0.004359240929032785"
            },
            {
                "hash": "0x67604272ca2b8b89e33b1e6a1b9c89db75635e1d78f5cf2c8e49b9f3a21c1b2f",
                "timestamp": 1655192825,
                "price": "0.004337933190955034"
            },
            {
                "hash": "0x865fb5fcb394c48fd40557768f08f3d69bd7c87f607ec44f13b0b2eeada11c80",
                "timestamp": 1655192822,
                "price": "0.004360170392030563"
            },
            {
                "hash": "0xffd100d86343e20788a8abb48660d40b6714b8b20ef1d47a98b8cc99b8257231",
                "timestamp": 1655192822,
                "price": "0.004360163275274439"
            },
            {
                "hash": "0x494090254f82033f54aa5308e5d9a83e3d78a2408eb2538e03ff46397341afd4",
                "timestamp": 1655192822,
                "price": "0.004338392721513588"
            },
            {
                "hash": "0xe6e38a577cef9a729697c8ad08e14de932fd12bc896821d13f5dbb6c6dbf1f33",
                "timestamp": 1655192822,
                "price": "0.004338399897695004"
            },
            {
                "hash": "0x2a649227209c1016e18c5c01019578ae79f00c64aff230fe1e2fcd855662c3f9",
                "timestamp": 1655192822,
                "price": "0.004360024464759858"
            },
            {
                "hash": "0x51bf4d9c11fd14e26ddd84e918dcb015cdc98da31f707ed4ecab24ad0a057da0",
                "timestamp": 1655192822,
                "price": "0.004359871750374781"
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

### /gethistoricaltransactions

#### Get the historical transactions focusing on swaps associated with a specific pool address. Currently available on **Binance**

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

#### Query Parameters

| Name                                          | Type   | Description                                                                                                            |
| --------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------- |
| 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.                                                                                           |
| poolAddress<mark style="color:red;">\*</mark> | String | Pool address whose transactions is to be fetched.                                                                      |

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

```url
https://historicaltrade.api.expand.network/dex/gethistoricaltransactions?poolAddress=0x05616b7b6da03fb4c773b76663816b360ccaede4&dexId=1200&startBlock=34544519&endBlock=34548560
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "pair": "TOKEN/WBNB",
        "transactions": [
            {
                "transactionHash": "0x0e0333c6bcdcf9a09841e815bdaffc55b1a069f78c33541918f8aa800ce5327a",
                "transactionDetails": {
                    "blockHash": "0x3a9f5de42cdaddbeea0f6c40ed4d991dd9fd3aaf0831dfa08719c552c60ba1cf",
                    "blockNumber": "34548096",
                    "from": "0x055a3b37957bfbd3345bed9968e7e8dd56d67066",
                    "gas": "1827825",
                    "gasPrice": "3150000000",
                    "hash": "0x0e0333c6bcdcf9a09841e815bdaffc55b1a069f78c33541918f8aa800ce5327a",
                    "input": "0x5c11d7950000000000000000000000000000000000000000000000000000085413a733ff0000000000000000000000000000000000000000000000000f5980b344c4c06400000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000055a3b37957bfbd3345bed9968e7e8dd56d67066000000000000000000000000000000000000000000000000000000006584352500000000000000000000000000000000000000000000000000000000000000020000000000000000000000004507cef57c46789ef8d1a19ea45f4216bae2b528000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
                    "nonce": "435338",
                    "to": "0x10ed43c718714eb63d5aa57b78b54704e256024e",
                    "transactionIndex": "99",
                    "value": "0",
                    "type": "0",
                    "chainId": "56",
                    "v": "0x94",
                    "r": "0x9c5367e8276ca0c88cd100418d73a4c04adf8e4718a88ee29fac96b695cd504b",
                    "s": "0x664a7ddf2587ec3ea192682053a2502280be34ff5088dce30621655aa27d965f"
                }
            },
            {
                "transactionHash": "0x110647ed390ad69b08e40d1432aa4c402df4506ae5f9f897860ea4e241c78dd6",
                "transactionDetails": {
                    "blockHash": "0xfdc0e116f2a20e13cca8be61c46ee1ad214ae628aca4cbff508f5d6bcf5a663d",
                    "blockNumber": "34548119",
                    "from": "0x055a3b37957bfbd3345bed9968e7e8dd56d67066",
                    "gas": "1827825",
                    "gasPrice": "3150000000",
                    "hash": "0x110647ed390ad69b08e40d1432aa4c402df4506ae5f9f897860ea4e241c78dd6",
                    "input": "0x5c11d795000000000000000000000000000000000000000000000000000007b28e1f777f0000000000000000000000000000000000000000000000000e28e19e4a923e9200000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000055a3b37957bfbd3345bed9968e7e8dd56d67066000000000000000000000000000000000000000000000000000000006584356d00000000000000000000000000000000000000000000000000000000000000020000000000000000000000004507cef57c46789ef8d1a19ea45f4216bae2b528000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
                    "nonce": "435345",
                    "to": "0x10ed43c718714eb63d5aa57b78b54704e256024e",
                    "transactionIndex": "73",
                    "value": "0",
                    "type": "0",
                    "chainId": "56",
                    "v": "0x93",
                    "r": "0x7477029e608e4d564193bb46c7a4044d4ef1a0c3bf7687433fbd181a2131b245",
                    "s": "0x5767ce7bf8f51df4c456045d909af1742d2d0df4d6163a78c4430d1129c9ff26"
                }
            },
            {
                "transactionHash": "0xe769eff1adc2a66523b3d6a05cfd1b21dd94868fdb8877211a885d80bd7bf08b",
                "transactionDetails": {
                    "blockHash": "0xd1a4f2635e456989f625a79c6bff75a4a40820141b66f12f0300764360e24795",
                    "blockNumber": "34548323",
                    "from": "0x055a3b37957bfbd3345bed9968e7e8dd56d67066",
                    "gas": "1827825",
                    "gasPrice": "3150000000",
                    "hash": "0xe769eff1adc2a66523b3d6a05cfd1b21dd94868fdb8877211a885d80bd7bf08b",
                    "input": "0x5c11d795000000000000000000000000000000000000000000000000000012a0a5755eff00000000000000000000000000000000000000000000000022132516d135029700000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000055a3b37957bfbd3345bed9968e7e8dd56d6706600000000000000000000000000000000000000000000000000000000658437d100000000000000000000000000000000000000000000000000000000000000020000000000000000000000004507cef57c46789ef8d1a19ea45f4216bae2b528000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
                    "nonce": "435378",
                    "to": "0x10ed43c718714eb63d5aa57b78b54704e256024e",
                    "transactionIndex": "57",
                    "value": "0",
                    "type": "0",
                    "chainId": "56",
                    "v": "0x94",
                    "r": "0xf6c95a653ee9dd9f04728440793c74b6e3ca49eee205995962b80de99f006e8e",
                    "s": "0x5b635a90c526104ad6d3b472337c0dc44e36318bb51cbd87b918c276e484de5a"
                }
            },
            {
                "transactionHash": "0xa08b6126adc8fdf526282c08c7598cca0d9660cf032bf7e2625dd1d3c3c02646",
                "transactionDetails": {
                    "blockHash": "0x011eb51371dc7fab04aec4747e39f1b19157cedaf7aa46ea359f2b81bc139056",
                    "blockNumber": "34548078",
                    "from": "0x055a3b37957bfbd3345bed9968e7e8dd56d67066",
                    "gas": "1827825",
                    "gasPrice": "3150000000",
                    "hash": "0xa08b6126adc8fdf526282c08c7598cca0d9660cf032bf7e2625dd1d3c3c02646",
                    "input": "0x5c11d7950000000000000000000000000000000000000000000000000000071f616e4fff0000000000000000000000000000000000000000000000000d1d45cca8f0270100000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000055a3b37957bfbd3345bed9968e7e8dd56d6706600000000000000000000000000000000000000000000000000000000658434f200000000000000000000000000000000000000000000000000000000000000020000000000000000000000004507cef57c46789ef8d1a19ea45f4216bae2b528000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
                    "nonce": "435333",
                    "to": "0x10ed43c718714eb63d5aa57b78b54704e256024e",
                    "transactionIndex": "89",
                    "value": "0",
                    "type": "0",
                    "chainId": "56",
                    "v": "0x93",
                    "r": "0xd47769d5b84274a60e08883f55134123c07ba0b49ab6633e6ead301bbfbe3de7",
                    "s": "0x4fae3d9c98bbef24a76cb8827f08fae2d1ea3c647a8f9416cca379e463d0957c"
                }
            },
            {
                "transactionHash": "0x8b8c30a219f64ab57b08795bb42cc31b92e6abb9af1f8f553cbfda629f95643e",
                "transactionDetails": {
                    "blockHash": "0x6f4462177d6bddbc9983699e8c47428378a076a6ac5dd18b991c806361197dad",
                    "blockNumber": "34548558",
                    "from": "0x05d99efbc49b74751521234ce0509c9ffcc6d2b7",
                    "gas": "600000",
                    "gasPrice": "3000000001",
                    "hash": "0x8b8c30a219f64ab57b08795bb42cc31b92e6abb9af1f8f553cbfda629f95643e",
                    "input": "0x95435ac9000000000000000000000000000000000000000000000000000005b0462445570000000000000000000000000000000000000171007ac8f660d8c2f3a24076f60000000000000000000000004507cef57c46789ef8d1a19ea45f4216bae2b5280000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000001847000000000000000000000000005616b7b6da03fb4c773b76663816b360ccaede40000000000000000000000000000000000000000000000000000000065843a88",
                    "nonce": "9739",
                    "to": "0x802b65b5d9016621e66003aed0b16615093f328b",
                    "transactionIndex": "97",
                    "value": "0",
                    "type": "0",
                    "chainId": "56",
                    "v": "0x94",
                    "r": "0x5999271baa6c0d69f286aca11f07f58f1f5d82a4b583a03f705813bba2a4cec0",
                    "s": "0x679efd2ccddd7c6e123062129a2b4f1536a160b506e701282a5b4550fdff61e7"
                }
            }
        ]
    }
}
```

{% 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

<table><thead><tr><th width="235">Name</th><th width="164">Type</th><th>Description</th></tr></thead><tbody><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>deadline<mark style="color:red;">*</mark></td><td>String</td><td>Deadline for the transaction to be executed (UNIX Timestamp). </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>rpc</td><td>String</td><td>Remote procedural call URL.</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><tr><td>gasPriority</td><td>String</td><td>low, medium, or high.</td></tr></tbody></table>

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

```json
{
    "dexId": "1200",
    "amountIn": "120000000",
    "amountOutMin": "0",
    "path": ["0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", "0xCC42724C6683B7E57334c4E856f4c9965ED682bD"],
    "to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "deadline": "1664529286",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "29880"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "56",
        "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
        "to": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
        "value": "0",
        "gas": "29880",
        "data": "0x38ed17390000000000000000000000000000000000000000000000000000000007270e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000063056e00436da25bcf48a40dfbbdcc7089351006000000000000000000000000000000000000000000000000000000006336b3860000000000000000000000000000000000000000000000000000000000000002000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c000000000000000000000000cc42724c6683b7e57334c4e856f4c9965ed682bd",
        "estimationCheck": true,
        "referenceId": "48d6003c0aad431aa571e798bfe102ba"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "dexId": "1200",
    "amountIn": "120000000",
    "amountOutMin": "0",
    "path": [
        "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
        "0xCC42724C6683B7E57334c4E856f4c9965ED682bD"
    ],
    "to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "deadline": "1704529286",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "298800",
    "gasPriority": "medium"
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "56",
        "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
        "to": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
        "value": "0",
        "gas": "298800",
        "data": "0x38ed17390000000000000000000000000000000000000000000000000000000007270e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000063056e00436da25bcf48a40dfbbdcc70893510060000000000000000000000000000000000000000000000000000000065990d860000000000000000000000000000000000000000000000000000000000000002000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c000000000000000000000000cc42724c6683b7e57334c4e856f4c9965ed682bd",
        "gasPrice": "1200000000",
        "estimationCheck": true,
        "referenceId": "d5b4b5fd364e4b39b0f442d50a02981f"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "dexId": "1200",
    "amountIn": "120000000",
    "amountOutMin": "0",
    "path": [
        "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
        "0xCC42724C6683B7E57334c4E856f4c9965ED682bD"
    ],
    "to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "deadline": "1664529286",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "29880",
    "slippage": "8.033543322"
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "56",
        "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
        "to": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
        "value": "0",
        "gas": "29880",
        "data": "0x38ed17390000000000000000000000000000000000000000000000000000000007270e000000000000000000000000000000000000000000000000000000001d4cfff6d600000000000000000000000000000000000000000000000000000000000000a000000000000000000000000063056e00436da25bcf48a40dfbbdcc7089351006000000000000000000000000000000000000000000000000000000006336b3860000000000000000000000000000000000000000000000000000000000000002000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c000000000000000000000000cc42724c6683b7e57334c4e856f4c9965ed682bd",
        "estimationCheck": true,
        "referenceId": "3e1edd8eab9647d2805d390ce581446a"
    }
}
```

{% endtab %}
{% endtabs %}

***

#### Request Body for APTOS

<table><thead><tr><th width="235">Name</th><th width="164">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>from<mark style="color:red;">*</mark></td><td>String</td><td>Address of the sender of the token.</td></tr><tr><td>gas<mark style="color:red;">*</mark></td><td>String</td><td>Maximum gas limit provided by the sender, for the transaction.</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
{
    "amountIn": "100000000",
    "from": "0x1c3266eca38df87026255884192b5979eac24cf0dac7a33cfa7af0d27651fb4c",
    "path": [
        "0x1::aptos_coin::AptosCoin",
        "0xf22bede237a07e121b56d91a491eb7bcdfd1f5907926a9e58338f964a01b17fa::asset::USDC"
    ],
    "slippage": "100",
    "dexId": "2900",
    "gas": "1000"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1400",
        "from": "0x1c3266eca38df87026255884192b5979eac24cf0dac7a33cfa7af0d27651fb4c",
        "to": "0xc7efb4076dbe143cbcd98cfaaa929ecfc8f299203dfff63b95ccb6bfe19850fa",
        "data": "HDJm7KON+HAmJViEGStZeerCTPDax6M8+nrw0nZR+0x0mwAAAAAAAALH77QHbb4UPLzZjPqqkp7PyPKZID3/9juVzLa/4ZhQ+gZyb3V0ZXIQc3dhcF9leGFjdF9pbnB1dAIHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEKYXB0b3NfY29pbglBcHRvc0NvaW4AB/Ir7eI3oH4SG1bZGkket7zf0fWQeSap5YM4+WSgGxf6BWFzc2V0BFVTREMAAggA4fUFAAAAAAgAAAAAAAAAAOgDAAAAAAAAZAAAAAAAAADXZCpnAAAAAAE=",
        "referenceId": "ad8bf08874b74aa3ab28e07d08817833"
    }
}
```

{% 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.                                                                                   |
| 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.                                                                                                |
| 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": "1200",
    "tokenA": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
    "tokenB": "0xCC42724C6683B7E57334c4E856f4c9965ED682bD",
    "amountADesired": "50000000000000000",
    "amountBDesired": "77926115",
    "amountAMin": "0",
    "amountBMin": "0",
    "to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "deadline": "1663181575",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "2307200"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "56",
        "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
        "to": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
        "value": "0",
        "gas": "2307200",
        "data": "0xe8e33700000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c000000000000000000000000cc42724c6683b7e57334c4e856f4c9965ed682bd00000000000000000000000000000000000000000000000000b1a2bc2ec500000000000000000000000000000000000000000000000000000000000004a50ee30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000063056e00436da25bcf48a40dfbbdcc70893510060000000000000000000000000000000000000000000000000000000063222307",
        "estimationCheck": true,
        "referenceId": "a2e6a4c61ef14fcc9edfe40b28866b2e"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "dexId": "1200",
    "tokenA": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
    "tokenB": "0xCC42724C6683B7E57334c4E856f4c9965ED682bD",
    "amountADesired": "50000000000000000",
    "amountBDesired": "77926115",
    "amountAMin": "0",
    "amountBMin": "0",
    "to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "deadline": "1663181575",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "2307200",
    "gasPriority": "medium"
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "56",
        "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
        "to": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
        "value": "0",
        "gas": "2307200",
        "data": "0xe8e33700000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c000000000000000000000000cc42724c6683b7e57334c4e856f4c9965ed682bd00000000000000000000000000000000000000000000000000b1a2bc2ec500000000000000000000000000000000000000000000000000000000000004a50ee30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000063056e00436da25bcf48a40dfbbdcc70893510060000000000000000000000000000000000000000000000000000000063222307",
        "gasPrice": "1200000000",
        "estimationCheck": true,
        "referenceId": "a156e92fdc4c46b083decc0d54f2d511"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "dexId": "1200",
    "tokenA": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
    "tokenB": "0xCC42724C6683B7E57334c4E856f4c9965ED682bD",
    "amountADesired": "50000000000000000",
    "amountBDesired": "77926115",
    "amountAMin": "10000000000000000",
    "amountBMin": "100000",
    "to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "deadline": "1663181575",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "2307200",
    "slippage": "5"
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "56",
        "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
        "to": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
        "value": "0",
        "gas": "2307200",
        "data": "0xe8e33700000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c000000000000000000000000cc42724c6683b7e57334c4e856f4c9965ed682bd00000000000000000000000000000000000000000000000000b1a2bc2ec500000000000000000000000000000000000000000000000000000000000004a50ee30000000000000000000000000000000000000000000000000021c0331d5dc000000000000000000000000000000000000000000000000000000000000001731800000000000000000000000063056e00436da25bcf48a40dfbbdcc70893510060000000000000000000000000000000000000000000000000000000063222307",
        "estimationCheck": true,
        "referenceId": "b0bede7098564f478dd175b0e469518e"
    }
}
```

{% endtab %}
{% endtabs %}

***

#### Request Body for APTOS

| 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>     | String | Comma-separated values of token addresses, inside an array, to Add Liquidity.                                              |
| amountIn<mark style="color:red;">\*</mark> | String | Comma-separated values of amount for TokenA and TokenB, inside an array.                                                   |
| from<mark style="color:red;">\*</mark>     | String | Address of the user.                                                                                                       |
| gas<mark style="color:red;">\*</mark>      | 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>                                |

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

```json
{
    "amountIn": ["10000000","15299"],
    "from": "0x1c3266eca38df87026255884192b5979eac24cf0dac7a33cfa7af0d27651fb4c",
    "path": [
        "0x1::aptos_coin::AptosCoin",
        "0xf22bede237a07e121b56d91a491eb7bcdfd1f5907926a9e58338f964a01b17fa::asset::USDC"
    ],
    "slippage": "100",
    "dexId": "2900",
    "gas":"1000"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1400",
        "from": "0x1c3266eca38df87026255884192b5979eac24cf0dac7a33cfa7af0d27651fb4c",
        "to": "0xc7efb4076dbe143cbcd98cfaaa929ecfc8f299203dfff63b95ccb6bfe19850fa",
        "data": "HDJm7KON+HAmJViEGStZeerCTPDax6M8+nrw0nZR+0x0mwAAAAAAAALH77QHbb4UPLzZjPqqkp7PyPKZID3/9juVzLa/4ZhQ+gZyb3V0ZXINYWRkX2xpcXVpZGl0eQIHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEKYXB0b3NfY29pbglBcHRvc0NvaW4AB/Ir7eI3oH4SG1bZGkket7zf0fWQeSap5YM4+WSgGxf6BWFzc2V0BFVTREMABAiAlpgAAAAAAAjDOwAAAAAAAAgAAAAAAAAAAAgAAAAAAAAAAOgDAAAAAAAAZAAAAAAAAABGZypnAAAAAAE=",
        "referenceId": "5eda11210b804dceb98d5edc2b95d39f"
    }
}
```

{% 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. |
| 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.                                                                                 |
| liquidity<mark style="color:red;">\*</mark>  | String | Total amount of liquidity to be removed from the given pool.                                                               |
| 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 swap value. <br>By default, 1.</p><p>0 <= slippage  value <= 100</p>                                |

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

```json
{
    "dexId": "1200",
    "tokenA": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
    "tokenB": "0xCC42724C6683B7E57334c4E856f4c9965ED682bD",
    "liquidity": "163742355742154761",
    "amountAMin": "0",
    "amountBMin": "0",
    "to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "deadline": "1663231732",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "842720"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "56",
        "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
        "to": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
        "value": "0",
        "gas": "842720",
        "data": "0xbaa2abde000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c000000000000000000000000cc42724c6683b7e57334c4e856f4c9965ed682bd0000000000000000000000000000000000000000000000000245bace14b260090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000063056e00436da25bcf48a40dfbbdcc7089351006000000000000000000000000000000000000000000000000000000006322e6f4",
        "estimationCheck": true,
        "referenceId": "ae5c692da558439f957a79b02f643ff3"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "dexId": "1200",
    "tokenA": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
    "tokenB": "0xCC42724C6683B7E57334c4E856f4c9965ED682bD",
    "liquidity": "163742355742154761",
    "amountAMin": "0",
    "amountBMin": "0",
    "to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "deadline": "1703231732",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "842720",
    "gasPriority": "medium"
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "56",
        "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
        "to": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
        "value": "0",
        "gas": "842720",
        "data": "0xbaa2abde000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c000000000000000000000000cc42724c6683b7e57334c4e856f4c9965ed682bd0000000000000000000000000000000000000000000000000245bace14b260090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000063056e00436da25bcf48a40dfbbdcc708935100600000000000000000000000000000000000000000000000000000000658540f4",
        "gasPrice": "1200000000",
        "estimationCheck": true,
        "referenceId": "e26f31fe348b4e0f908d43a0bbee737b"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "dexId": "1200",
    "tokenA": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
    "tokenB": "0xCC42724C6683B7E57334c4E856f4c9965ED682bD",
    "liquidity": "163742355742154761",
    "amountAMin": "0",
    "amountBMin": "0",
    "to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "deadline": "1663231732",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "842720",
    "slippage": "5"
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "56",
        "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
        "to": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
        "value": "0",
        "gas": "842720",
        "data": "0xbaa2abde000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c000000000000000000000000cc42724c6683b7e57334c4e856f4c9965ed682bd0000000000000000000000000000000000000000000000000245bace14b260090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000063056e00436da25bcf48a40dfbbdcc7089351006000000000000000000000000000000000000000000000000000000006322e6f4",
        "estimationCheck": true,
        "referenceId": "18db57819cea4d9d9fefa224e866c2a9"
    }
}
```

{% endtab %}
{% endtabs %}

***

#### Request Body for APTOS

| 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, inside an array, to Remove Liquidity.                                           |
| liquidity<mark style="color:red;">\*</mark> | String | Total amount of liquidity to be removed from the given pool.                                                               |
| from<mark style="color:red;">\*</mark>      | String | Address of the sender of the token.                                                                                        |
| gas<mark style="color:red;">\*</mark>       | String | Maximum gas limit provided by the sender, for the transaction.                                                             |
| 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
{
    "liquidity": "1000",
    "from": "0x1c3266eca38df87026255884192b5979eac24cf0dac7a33cfa7af0d27651fb4c",
    "path": [
        "0x1::aptos_coin::AptosCoin",
        "0xf22bede237a07e121b56d91a491eb7bcdfd1f5907926a9e58338f964a01b17fa::asset::USDC"
    ],
    "slippage": "10",
    "dexId": "2900",
    "gas":"1000"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1400",
        "from": "0x1c3266eca38df87026255884192b5979eac24cf0dac7a33cfa7af0d27651fb4c",
        "to": "0xc7efb4076dbe143cbcd98cfaaa929ecfc8f299203dfff63b95ccb6bfe19850fa",
        "data": "HDJm7KON+HAmJViEGStZeerCTPDax6M8+nrw0nZR+0x1mwAAAAAAAALH77QHbb4UPLzZjPqqkp7PyPKZID3/9juVzLa/4ZhQ+gZyb3V0ZXIQcmVtb3ZlX2xpcXVpZGl0eQIHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEKYXB0b3NfY29pbglBcHRvc0NvaW4AB/Ir7eI3oH4SG1bZGkket7zf0fWQeSap5YM4+WSgGxf6BWFzc2V0BFVTREMAAwjoAwAAAAAAAAgAAAAAAAAAAAgAAAAAAAAAAOgDAAAAAAAAZAAAAAAAAACnaCpnAAAAAAE=",
        "referenceId": "74b41523d0d74d21920f02974ece488a"
    }
}
```

{% endtab %}
{% endtabs %}
