# DEX & DEX Aggregators

Provides connectivity across the various **decentralized exchanges** available on the EVM and Non-EVM chains.&#x20;

Below are descriptions of the endpoints we support for DEXs and DEX Aggregators:&#x20;

<table><thead><tr><th width="245">Name</th><th>Description</th></tr></thead><tbody><tr><td>getprice <code>GET</code></td><td>Returns the swap quotation for the given token pairs for the specified DEX.</td></tr><tr><td>getuserliquidity <code>GET</code></td><td>Returns the balance of a particular token pair of an account.</td></tr><tr><td>getpoolliquidity <code>GET</code></td><td>Returns the total liquidity for a specified pool.</td></tr><tr><td>gettokenliquidity <code>GET</code></td><td>Returns the individual token liquidity within the specified liquidity pool.</td></tr><tr><td>getliquidityholders <code>GET</code></td><td>Returns the total number of liquidity holders in the specified pool.</td></tr><tr><td>getindividualposition <code>GET</code></td><td>Returns the liquidity position for a specified user address across all the pools for a specified DEX.</td></tr><tr><td>getliquiditysources <code>GET</code></td><td>Get the liquidity sources for the specified dex aggregator(on the basis of chain), supported by expand.network.</td></tr><tr><td><a href="#getpools"><mark style="color:blue;">getpools</mark></a> <code>GET</code></td><td>Returns a list of all the quotes for a pool on different DEXs.</td></tr><tr><td>gethistoricaltimeseries <code>GET</code></td><td>Get the historical time series transactions for a specific pool address.</td></tr><tr><td>gethistoricaltransactions <code>GET</code></td><td>Get the historical transactions focusing on swaps associated with a specific pool address.</td></tr><tr><td><a href="#gethistoricalpoolchartdata">gethistoricalpoolchartdata </a> <code>GET</code></td><td>Source OHCLV (Open, High, Close, Low, Volume) data for a specified pool address for a particular time interval (15, 30, 60, or 90 minutes). Available for Uniswap <a href="uniswap-v2#gethistoricalpoolchartdata">V2</a> and <a href="uniswap-v3#gethistoricalpoolchartdata">V3</a>, <a href="balancer-v2#gethistoricalpoolchartdata">Balancer</a>, <a href="curve-v2#gethistoricalpoolchartdata">Curve V2</a>, and <a href="sushiswap-v2#gethistoricalpoolchartdata">Sushiswap</a>.</td></tr><tr><td>getpooltradedata <code>GET</code></td><td>Get the trade data from the pool within a specified block range, for the specified event type.</td></tr><tr><td>getpoolindividualliquidity  <code>GET</code></td><td>Get all user addresses, block numbers, and token position details for a specified pool address. Available for Uniswap V2,V3 and Sushiswap only.</td></tr><tr><td><a href="#getwalletposition"><mark style="color:blue;">getwalletposition</mark></a> <code>GET</code></td><td>Get detailed information for user transactions on various DEXs, including transaction type, block-related details, decoded parameters and many more.</td></tr><tr><td><a href="#quoteaggregator"><mark style="color:blue;">quoteaggregator</mark></a> <code>GET</code></td><td>Retrieves quotes from various DEXs &#x26; aggregators in a unified manner. For a specified pair address, this endpoint will return the respective quotes for each DEX in which the pair address is present.</td></tr><tr><td>swap <code>POST</code></td><td>Initiate a swap transaction on a specified DEX.</td></tr><tr><td>addliquidity <code>POST</code></td><td>Add liquidity to a specified pool in a specified DEX.</td></tr><tr><td>removeliquidity <code>POST</code></td><td>Remove liquidity from a specified pool for a specified DEX.</td></tr><tr><td><a href="#swapaggregator"><mark style="color:blue;">swapaggregator</mark></a> <code>POST</code></td><td>Returns the aggregated prepared swap quotes for every DEX, in which the pair address is present.</td></tr><tr><td><a href="#dex-screen">dex/screen</a> <code>GET</code></td><td>This endpoint provides data on top activity pools across multiple DEXs (Uni V2, Uni V3, and Sushiswap V2) on Ethereum, offering key metrics like transactions, makers, buyers, sellers, volume, market cap, and liquidity with time intervals from 5 minutes to 24 hours.</td></tr><tr><td><a href="#swapwithapproval"><mark style="color:blue;">swapwithapproval</mark></a> <code>POST</code></td><td>Returns the approve and swap transaction on a DEX supported by Expand.</td></tr><tr><td><a href="#getliquiditybytick">getliquiditybytick</a></td><td>This endpoint provides the amount of liquidity distributed across different ticks for UniswapV3, TraderJoe and PancakeswapV3. Currently available for Ethereum,Avalanche, Binance and Polygon</td></tr><tr><td>getusertokenids</td><td>This endpoint provides the token IDs of all the active position NFTs the user holds.</td></tr></tbody></table>

Please see the attached document for information about error messages you may encounter when transacting using these endpoints:<https://docs.google.com/document/d/1SuBJwPOmvJtUUf-9QJiBcTr0l2zbWlusMTUOGfC8S50/edit?usp=sharing>

### /getpools

Returns a list of all the quotes for a pool on different DEXs.

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

#### Query Parameters

| Name                                       | Type   | Description                                                                                                                          |
| ------------------------------------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------ |
| dexId<mark style="color:red;">\*</mark>    | String | Comma-separated values of Dex Id. Refer to the [DEX ID](https://docs.expand.network/integrations/broken-reference) page for details. |
| path<mark style="color:red;">\*</mark>     | String | Comma-separated values of token pair.                                                                                                |
| amountIn<mark style="color:red;">\*</mark> | String | Amount of token.                                                                                                                     |

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

```url
https://api.expand.network/dex/getpools?dexId=1500,1400,1300&path=0x6b175474e89094c44da98b954eedeac495271d0f,0xdac17f958d2ee523a2206206994597c13d831ec7&amountIn=100000000000000000
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": [
        {
            "dexId": "1300",
            "value": "99431"
        },
        {
            "dexId": "1400",
            "value": "130999"
        },
        {
            "dexId": "1500",
            "value": "99977"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### /gethistoricalpoolchartdata

Source OHCLV (Open, High, Close, Low, Volume) data for a specified pool address for a particular time interval (15, 30, 60, or 90 minutes). Available for Uniswap [V2](https://docs.expand.network/integrations/uniswap-v2#gethistoricalpoolchartdata) and [V3](https://docs.expand.network/integrations/uniswap-v3#gethistoricalpoolchartdata), [Balancer](https://docs.expand.network/integrations/balancer-v2#gethistoricalpoolchartdata), [Curve V2](https://docs.expand.network/integrations/curve-v2#gethistoricalpoolchartdata), and [Sushiswap](https://docs.expand.network/integrations/sushiswap-v2#gethistoricalpoolchartdata).

### /quoteaggregator

Returns a list of all the quotes for a pool on different DEXs.\
Available on EVM and Non-EVM chains

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

#### Query Parameters

| Name                                       | Type   | Description                                                                          |
| ------------------------------------------ | ------ | ------------------------------------------------------------------------------------ |
| chainId                                    | String | Refer to the [Chain ID ](https://docs.expand.network/ids/chain-ids)page for details. |
| path<mark style="color:red;">\*</mark>     | String | Comma-separated values of token pair.                                                |
| amountIn<mark style="color:red;">\*</mark> | String | Amount of token.                                                                     |
| chainSymbol                                | String | Refer to the [Chain ID ](https://docs.expand.network/ids/chain-ids)page for details. |
| excludedDexes                              | String | Comma-separated values of dexes to exclude.                                          |
| 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/quoteaggregator?amountIn=1000000000000000000&chainId=56&path=0xa2b726b1145a4773f68593cf171187d8ebe4d495%2C0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c&poolFees=10000
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": [
        {
            "dexId": "2201",
            "dexName": "Kyberswap",
            "amountIn": "1000000000000000000",
            "path": [
                "0xa2b726b1145a4773f68593cf171187d8ebe4d495",
                "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"
            ],
            "amountsOut": [
                "1000000000000000000",
                "14798692142552944"
            ]
        },
        {
            "dexId": "1200",
            "dexName": "PancakeV2",
            "amountIn": "1000000000000000000",
            "path": [
                "0xa2b726b1145a4773f68593cf171187d8ebe4d495",
                "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"
            ],
            "amountsOut": [
                "1000000000000000000",
                "14798544157111373"
            ]
        },
        {
            "bridgeId": "600",
            "bridgeName": "SquidRouterV2",
            "path": [
                "0xa2b726b1145a4773f68593cf171187d8ebe4d495",
                "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"
            ],
            "amountIn": "1000000000000000000",
            "amountsOut": [
                "1000000000000000000",
                "14798544157111373"
            ]
        },
        {
            "dexId": "1604",
            "dexName": "0x",
            "amountIn": "1000000000000000000",
            "path": [
                "0xa2b726b1145a4773f68593cf171187d8ebe4d495",
                "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"
            ],
            "amountsOut": [
                "1000000000000000000",
                "14776346340875706"
            ]
        },
        {
            "dexId": "1306",
            "dexName": "UniswapV3",
            "amountIn": "1000000000000000000",
            "path": [
                "0xa2b726b1145a4773f68593cf171187d8ebe4d495",
                "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"
            ],
            "amountsOut": [
                "1000000000000000000",
                "14668717523072865"
            ]
        },
        {
            "dexId": "2800",
            "dexName": "PancakeV3",
            "amountIn": "1000000000000000000",
            "path": [
                "0xa2b726b1145a4773f68593cf171187d8ebe4d495",
                "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"
            ],
            "amountsOut": [
                "1000000000000000000",
                "14620841622715545"
            ]
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### /getwalletposition

Get the detailed DEXs positions for a wallet address. \
Available for Uniswap V2, Uniswap V3, Pancakeswap V2, Pancakeswap V3 and SushiSwap V2. \
Available on Ethereum only.

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

#### Query Parameters

| Name                                      | Type   | Description                 |
| ----------------------------------------- | ------ | --------------------------- |
| address<mark style="color:red;">\*</mark> | String | Public address of the user. |

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

```url
https://historicallp.api.expand.network/dex/getwalletposition?address=0x28A5eC068ae7500cbf21B989D62C7a81e2665B18
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
  "status": 200,
  "msg": "success",
  "data": [
    {
      "protocol_name": "Uniswap v2",
      "protocol_id": "uniswap-v2",
      "protocol_url": "https://app.uniswap.org/pools/v2",
      "account_data": {},
      "total_projected_earnings_usd": {
        "daily": null,
        "weekly": null,
        "monthly": null,
        "yearly": null
      },
      "position": {
        "label": "liquidity",
        "tokens": [
          {
            "token_type": "supplied",
            "name": "Ocean Token",
            "symbol": "OCEAN",
            "contract_address": "0x7afebbb46fdb47ed17b22ed075cde2447694fb9e",
            "decimals": "18",
            "balance": "1.6081842334083308815902940220990230780999386e+23",
            "usd_price": 0.3606446348915287
          },
          {
            "token_type": "supplied",
            "name": "Wrapped Ether",
            "symbol": "WETH",
            "contract_address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
            "decimals": "18",
            "balance": "164740674239285818005.81690560285198009496",
            "usd_price": 3711.793202043769
          },
          {
            "token_type": "defi-token",
            "name": "Uniswap V2",
            "symbol": "UNI-V2",
            "contract_address": "0xf063806d07fe742b031a543145fb46d1bc670fe8",
            "decimals": "18",
            "balance": "4814188687222267334774",
            "usd_price": null
          }
        ],
        "address": "0xf063806d07fe742b031a543145fb46d1bc670fe8",
        "balance_usd": 669481.6163110741,
        "total_unclaimed_usd_value": null,
        "position_details": {
          "reserve0": "160818.42334083308815902940220990230780999386",
          "reserve1": "164.74067423928581800581690560285198009496",
          "factory": "0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f",
          "pair": "0xf063806d07fe742b031a543145fb46d1bc670fe8",
          "share_of_pool": 26.97033761448816
        }
      }
    },
    {
      "protocol_name": "Uniswap v3",
      "protocol_id": "uniswap-v3",
      "protocol_url": "https://app.uniswap.org",
      "account_data": {},
      "total_projected_earnings_usd": {
        "daily": null,
        "weekly": null,
        "monthly": null,
        "yearly": null
      },
      "position": {
        "label": "Liquidity",
        "balance_usd": 92.79077171190019,
        "total_unclaimed_usd_value": 0,
        "tokens": [
          {
            "token_type": "supplied",
            "name": "USD Coin",
            "symbol": "USDC",
            "contract_address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
            "decimals": "6",
            "balance": "0",
            "usd_price": 0.9984084045632092
          },
          {
            "token_type": "supplied",
            "name": "Wrapped Ether",
            "symbol": "WETH",
            "contract_address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
            "decimals": "18",
            "balance": "24998906636503404",
            "usd_price": 3711.793202043769
          },
          {
            "token_type": "reward",
            "name": "USD Coin",
            "symbol": "USDC",
            "contract_address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
            "decimals": "6",
            "balance": "0",
            "usd_price": 0.9984084045632092
          },
          {
            "token_type": "reward",
            "name": "Wrapped Ether",
            "symbol": "WETH",
            "contract_address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
            "decimals": "18",
            "balance": "0",
            "usd_price": 3711.793202043769
          }
        ]
      }
    }
  ]
}
```

{% endtab %}
{% endtabs %}

### /swapaggregator

Returns the aggregated prepared swap quotes for every DEX, in which the pair address is present.\
Available on EVM and Non-EVM chains.

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

#### Request Body

<table><thead><tr><th width="175">Name</th><th width="93">Type</th><th>Description</th></tr></thead><tbody><tr><td>chainId</td><td>String</td><td>Refer to the <a href="../ids/chain-ids">Chain ID </a>page for details. </td></tr><tr><td>path<mark style="color:red;">*</mark></td><td>String</td><td>Comma-separated values of token pair.</td></tr><tr><td>amountIn<mark style="color:red;">*</mark></td><td>String</td><td>Amount of token.</td></tr><tr><td>chainSymbol</td><td>String</td><td>Refer to the <a href="../ids/chain-ids">Chain ID </a>page for details. </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>to<mark style="color:red;">*</mark></td><td>String</td><td>Address of the recipient of the token.</td></tr><tr><td>poolFees</td><td>String</td><td>Different pool based on the fees. <br>By default, it is selected as 3000.</td></tr><tr><td>excludedDexes</td><td>String</td><td>Comma-separated values of dexes to exclude.</td></tr><tr><td>bestNetPrice</td><td>Boolean</td><td>If true, the endpoint will sort the prepared transactions by amountsOut minus the amount of gas in descending order.<br><br><em>Note: If you select "true" for the "</em>bestQuote<em>", "</em>lowestGas<em>" and "</em>bestNetPrice" <em>parameters, the "</em>bestNetPrice<em>" parameter will apply.</em></td></tr><tr><td>bestQuote</td><td>Boolean</td><td>If true, the endpoint will sort the prepared transactions by amountsOut (the best quote) in descending order<br><br><em>Note: If you select "true" for the "</em>bestQuote<em>", "</em>lowestGas<em>" and "</em>bestNetPrice" <em>parameters, the "</em>bestNetPrice<em>" parameter will apply.</em></td></tr><tr><td>lowestGas</td><td>Boolean</td><td>If true, the endpoint will sort the prepared transactions by amount of gas in ascending order<br><br><em>Note: If you select "true" for the "</em>bestQuote<em>", "</em>lowestGas<em>" and "</em>bestNetPrice" <em>parameters, the "</em>bestNetPrice<em>" parameter will apply.</em></td></tr><tr><td>gasPriority</td><td>String</td><td>low, medium, or high.</td></tr></tbody></table>

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

```json
{
    "path": [
        "0x3845badAde8e6dFF049820680d1F14bD3903a5d0",
        "0xD533a949740bb3306d119CC777fa900bA034cd52"
    ],
    "amountIn": "1000000000000000000",
    "gas": "800000",
    "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
    "to": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
    "cheapestSwap": true,
    "gasPriority": "high",
    "bestSwap": true,
    "chainId": "1"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": [
        {
            "dexName": "0x",
            "amountsOut": "454801638754490972",
            "chainId": "1",
            "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
            "to": "0x0d0e364aa7852291883c162b22d6d81f6355428f",
            "value": "0",
            "gas": "800000",
            "data": "0x1fff991f000000000000000000000000dae2f6eddda6fb4fb60cc02633de27e2b431b402000000000000000000000000d533a949740bb3306d119cc777fa900ba034cd520000000000000000000000000000000000000000000000000652f1e901757fa800000000000000000000000000000000000000000000000000000000000000a0899632752e346c5953838114a1a078000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000aa000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000005e000000000000000000000000000000000000000000000000000000000000007a000000000000000000000000000000000000000000000000000000000000008a0000000000000000000000000000000000000000000000000000000000000094000000000000000000000000000000000000000000000000000000000000000c4103b48be0000000000000000000000000d0e364aa7852291883c162b22d6d81f6355428f0000000000000000000000003845badade8e6dff049820680d1f14bd3903a5d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003dd49f67e9d5bc4c5e6634b3f70bfd9dc1b6bd740000000000000000000000000000000000000000000000000000000000001e0100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003c438c9c147000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000002710000000000000000000000000ba12222222228d8ba445958a75a0704d566bf2c800000000000000000000000000000000000000000000000000000000000001c400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000002e4945bcec90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000d0e364aa7852291883c162b22d6d81f6355428f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d0e364aa7852291883c162b22d6d81f6355428f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000068065e6100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020d4e2af4507b6b89333441c0c398edffb40f86f4d0001000000000000000002ab0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000009c571960824400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c59900000000000000000000000000000000000000000000000000000000000000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018438c9c1470000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c5990000000000000000000000000000000000000000000000000000000000002710000000000000000000000000d51a44d3fae010294c616388b506acda1bfaae46000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a45b41b90800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c4103b48be0000000000000000000000000d0e364aa7852291883c162b22d6d81f6355428f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000027100000000000000000000000003eed0af1c5f350c6571525d9e3eeea7d2608af810000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064c876d21d000000000000000000000000f5c4f3dc02c3fb9279495a8fef7b0741da956157000000000000000000000000d533a949740bb3306d119cc777fa900ba034cd5200000000000000000000000000000000000000000000000007e22d73e992e52000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012438c9c147000000000000000000000000d533a949740bb3306d119cc777fa900ba034cd52000000000000000000000000000000000000000000000000000000000000000f000000000000000000000000d533a949740bb3306d119cc777fa900ba034cd52000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000ad01c20d5886137e056775af56915de824c8fce500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffc1fb425e0000000000000000000000003dd49f67e9d5bc4c5e6634b3f70bfd9dc1b6bd740000000000000000000000003845badade8e6dff049820680d1f14bd3903a5d00000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000006e898131631616b1779bad70bc0b0000000000000000000000000000000000000000000000000000000068065e6100000000000000000000000000000000000000000000000000000000000000c0",
            "gasPrice": "1842544458",
            "estimationCheck": true,
            "referenceId": "01cefc4e5022465db668aacd284a7556"
        },
        {
            "dexName": "Kyberswap",
            "amountsOut": "454005990268643116",
            "chainId": "1",
            "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
            "to": "0x6131B5fae19EA4f9D964eAc0408E4408b66337b5",
            "value": "0",
            "gas": "800000",
            "data": "0x8af033fb0000000000000000000000000f4a1d7fdf4890be35e71f3e0bbc4a0ec377eca30000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000007c00000000000000000000000003845badade8e6dff049820680d1f14bd3903a5d0000000000000000000000000d533a949740bb3306d119cc777fa900ba034cd520000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000dae2f6eddda6fb4fb60cc02633de27e2b431b4020000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000004fe1aac18cb03a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000520000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000680661e300000000000000000000000000000000000000000000000000000000000004c000000000000000000000000000000000000000000000000000000000000000010000000000000000000000003dd49f67e9d5bc4c5e6634b3f70bfd9dc1b6bd7400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000040593611990000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000001000000000000000000000000003dd49f67e9d5bc4c5e6634b3f70bfd9dc1b6bd740000000000000000000000003845badade8e6dff049820680d1f14bd3903a5d0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000004811c9384bc8447945806a2319159054b228fda70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000040593611990000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000001000000000000000000000000004811c9384bc8447945806a2319159054b228fda7000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000d533a949740bb3306d119cc777fa900ba034cd520000000000000000000000000f4a1d7fdf4890be35e71f3e0bbc4a0ec377eca30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000020000000000000000000000069b4dda37c0000000000000000064cf40aefdca72c00000000000000000000000000000000000000000000000000000000000002617b22536f75726365223a22657870616e64222c22416d6f756e74496e555344223a22302e32383231323337353035303836303235222c22416d6f756e744f7574555344223a22302e303134303034393235313134393531323635222c22526566657272616c223a22222c22466c616773223a302c22416d6f756e744f7574223a223232373030323939353133343332313932222c2254696d657374616d70223a313734353234373533392c22526f7574654944223a2263383139636533312d346461352d343338342d616334642d656462326533313736303837222c22496e74656772697479496e666f223a7b224b65794944223a2231222c225369676e6174757265223a2248386b705a32725651386463415776706b32697a454b2b6d44614156574164472b633734414d71632b495a65552f464737702f367a5a536766562b414b384d4c7a57536d424c3376366b2b70476c33353457724c417532794a4c39585159694f73715367512b5330724861446e464c6833662f74793678527a4b7862504337352b5a416b73753534496164684c41792f6e413448355873752b6459737446615935614c64486d4c724d53713969722b6b50434d362f4a6f51696444485a79352f612f7a493241535634436d74697754544e64566f473561465070436e4e445463356c6835485979745451597166575a55684a38422b73614132725835766d4b5832664d784865547a326a7962524c6c38644250496a6d335939304d4c3330373837765a6d7a4d6a34566b6b3576664564797051734f72455344774a483564504f6c67794b776c57556377676578535442396e4c6d44773d3d227d7d00000000000000000000000000000000000000000000000000000000000000",
            "gasPrice": "1767093228",
            "estimationCheck": true,
            "referenceId": "01cefc4e5022465db668aacd284a7556"
        },
        {
            "bridgeName": "SquidRouterV2",
            "amountsOut": "450958152289981823",
            "chainId": "1",
            "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
            "to": "0xce16F69375520ab01377ce7B88f5BA8C48F8D666",
            "value": "0",
            "gas": "800000",
            "data": "0x58181a800000000000000000000000003845badade8e6dff049820680d1f14bd3903a5d00000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000004800000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000082000000000000000000000000000000000000000000000000000000000000009a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003845badade8e6dff049820680d1f14bd3903a5d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000003845badade8e6dff049820680d1f14bd3903a5d0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000010438ed17390000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000009bbf02e7f9c800000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000ad6cea45f98444a922a2b4fe96b8c90f0862d2f40000000000000000000000000000000000000000000000000000019658eb567200000000000000000000000000000000000000000000000000000000000000020000000000000000000000003845badade8e6dff049820680d1f14bd3903a5d0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000003845badade8e6dff049820680d1f14bd3903a5d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000044095ea7b300000000000000000000000068b3465833fb72a70ecdf485e0e4c7bd8665fc45ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000068b3465833fb72a70ecdf485e0e4c7bd8665fc45000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000000e404e45aaf000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000001f4000000000000000000000000ad6cea45f98444a922a2b4fe96b8c90f0862d2f400000000000000000000000000000000000000000000000000009c57196082440000000000000000000000000000000000000000000000000000000000043eab0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000044095ea7b300000000000000000000000068b3465833fb72a70ecdf485e0e4c7bd8665fc45ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000068b3465833fb72a70ecdf485e0e4c7bd8665fc45000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000000e404e45aaf000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000d533a949740bb3306d119cc777fa900ba034cd520000000000000000000000000000000000000000000000000000000000002710000000000000000000000000dae2f6eddda6fb4fb60cc02633de27e2b431b40200000000000000000000000000000000000000000000000000000000000445570000000000000000000000000000000000000000000000000630ab23d13bed520000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000000425a473416484f5a441fb360166313286",
            "gasPrice": "1767093228",
            "estimationCheck": true,
            "referenceId": "01cefc4e5022465db668aacd284a7556"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

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

```json
{
  "path": [
    "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
    "0x6B175474E89094C44Da98b954EedeAC495271d0F"
  ],
  "amountIn": "1000000",
  "gas": "800000",
  "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
  "to": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
  "cheapestSwap": true,
  "bestSwap": true,
  "chainId": "1",
  "gasPriority": "medium"
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": [
        {
            "dexName": "1inch",
            "amountsOut": "2722973476",
            "from": "0xdae2f6eddda6fb4fb60cc02633de27e2b431b402",
            "to": "0x1111111254eeb25477b68fb85ed929f73a960582",
            "data": "0x0502b1c5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000a1e3e3cb0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000180000000000000003b6d034060a26d69263ef43e9a68964ba141263f19d71d51caefa361",
            "value": "1000000",
            "gas": "135556",
            "gasPrice": "2537407307",
            "estimationCheck": true,
            "referenceId": "7e54a22466b34205895563f636a5e59a"
        },
        {
            "dexName": "SushiswapV2",
            "amountsOut": "2727068499",
            "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
            "to": "0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F",
            "value": "1000000",
            "gas": "140987",
            "data": "0x7ff36ab500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dae2f6eddda6fb4fb60cc02633de27e2b431b40200000000000000000000000000000000000000000000000000000191509586350000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f",
            "gasPrice": "2533607308",
            "estimationCheck": true,
            "referenceId": "7e54a22466b34205895563f636a5e59a"
        },
        {
            "dexName": "UniswapV2",
            "amountsOut": "2727068867",
            "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
            "to": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
            "value": "1000000",
            "gas": "152687",
            "data": "0x7ff36ab500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dae2f6eddda6fb4fb60cc02633de27e2b431b40200000000000000000000000000000000000000000000000000000191509586350000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f",
            "gasPrice": "2533607308",
            "estimationCheck": true,
            "referenceId": "7e54a22466b34205895563f636a5e59a"
        },
        {
            "dexName": "UniswapV3",
            "amountsOut": "2727666213",
            "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
            "to": "0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45",
            "value": "1000000",
            "gas": "157484",
            "data": "0xac9650d8000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000e404e45aaf000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000000000000000000000000000000000000000000bb8000000000000000000000000dae2f6eddda6fb4fb60cc02633de27e2b431b40200000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000412210e8a00000000000000000000000000000000000000000000000000000000",
            "gasPrice": "2533607308",
            "estimationCheck": true,
            "referenceId": "7e54a22466b34205895563f636a5e59a"
        },
        {
            "dexName": "0x",
            "amountsOut": "2723019170",
            "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
            "to": "0xdef1c0ded9bec7f1a1670819833240f027b25eff",
            "value": "1000000",
            "gas": "332516",
            "data": "0x415565b0000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000a0addb8100000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000004c000000000000000000000000000000000000000000000000000000000000005c0000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000000210000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000002556e697377617056320000000000000000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000a0eba6a2000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f164fc0ec4e93095b804a4795bbe1e041497b92a00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000000000003dcb21000000000000000000000000ad01c20d5886137e056775af56915de824c8fce5000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000000000000000000869584cd000000000000000000000000100000000000000000000000000000000000001100000000000000000000000000000000000000000d1887adb5ec883592cc6d8e",
            "gasPrice": "2533607308",
            "estimationCheck": true,
            "referenceId": "7e54a22466b34205895563f636a5e59a"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### /swapwithapproval

Returns the approve and swap transaction on a DEX supported by Expand.

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

#### Request Body

<table data-full-width="false"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>dexId</td><td>String</td><td>Refer to the <a href="../ids/dex-ids">Dex ID</a><a href="../ids/chain-ids"> </a>page for details. </td></tr><tr><td>path<mark style="color:red;">*</mark></td><td>String</td><td>Comma-separated values of token pair.</td></tr><tr><td>amountIn<mark style="color:red;">*</mark></td><td>String</td><td>Amount of 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>slippage</td><td>String</td><td><p>Percentage of total swap value. By default, 1.</p><p>0 &#x3C;= slippage value &#x3C;= 10</p></td></tr><tr><td><em><strong>swap parameters for the dex specified</strong></em></td><td>-</td><td>Refer specified dex swap page for parametes</td></tr></tbody></table>

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

```json
{
    "dexId":"1000",
    "amountIn": "1000000000000000",
    "amountOutMin": "0",
    "path": ["0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2","0x6B175474E89094C44Da98b954EedeAC495271d0F"],
    "to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "deadline": "1665990894",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "173376"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": [
        {
            "chainId": "1",
            "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
            "to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
            "value": "0",
            "gas": "173376",
            "data": "0x095ea7b30000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d00000000000000000000000000000000000000000000000000038d7ea4c68000",
            "nonce": 0,
            "referenceId": "497ef8cb1f224ab3ac8ee68211237298"
        },
        {
            "chainId": "1",
            "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
            "to": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
            "value": "0",
            "gas": "173376",
            "data": "0x38ed173900000000000000000000000000000000000000000000000000038d7ea4c68000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000063056e00436da25bcf48a40dfbbdcc708935100600000000000000000000000000000000000000000000000000000000634d00ee0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f",
            "nonce": 1,
            "referenceId": "497ef8cb1f224ab3ac8ee68211237298"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### /getliquiditybytick

This endpoint provides the amount of liquidity distributed across different ticks for UniswapV3, TraderJoe, and PancakeswapV3. It is currently available for Ethereum, Avalanche, Binance, Base, and Polygon. The response includes the liquidity for the ticks.

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

#### Request Body

<table data-full-width="false"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>dexId</td><td>String</td><td>Refer to the <a href="../ids/dex-ids">DexID</a><a href="../ids/chain-ids"> </a>page for details. </td></tr><tr><td>poolAddress<mark style="color:red;">*</mark></td><td>String</td><td>Address of Pool</td></tr><tr><td>tickRange</td><td>String</td><td>Range of tick from 0 to 10. By default 10</td></tr></tbody></table>

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

```
https://historicallp.api.expand.network/dex/getliquiditybytick?dexId=1300&poolAddress=0xCBCdF9626bC03E24f779434178A73a0B4bad62eD&tickRange=10
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
  "status": 200,
  "msg": "success",
  "data": [
    {
      "tick": "262560",
      "statePrice": "25.250257597994153",
      "liquidityGross": "2044167987239799",
      "liquidityNet": "1163227399916217"
    },
    {
      "tick": "262620",
      "statePrice": "25.40220693843807",
      "liquidityGross": "2411973804718984",
      "liquidityNet": "-2411973804718984"
    },
    {
      "tick": "262680",
      "statePrice": "25.555070669635104",
      "liquidityGross": "2022304232475786",
      "liquidityNet": "-2008684309586072"
    },
    {
      "tick": "262740",
      "statePrice": "25.70885429414582",
      "liquidityGross": "761547836646808",
      "liquidityNet": "-616354343979458"
    },
    {
      "tick": "262800",
      "statePrice": "25.86356334764374",
      "liquidityGross": "6751078345053776",
      "liquidityNet": "-5770617130112686"
    },
    {
      "tick": "262860",
      "statePrice": "26.019203399114584",
      "liquidityGross": "10654503170437388",
      "liquidityNet": "9856004978433476"
    },
    {
      "tick": "262920",
      "statePrice": "26.175780051056766",
      "liquidityGross": "1626629983560750",
      "liquidityNet": "-1157703736282660"
    },
    {
      "tick": "262980",
      "statePrice": "26.333298939683043",
      "liquidityGross": "9243301499770587",
      "liquidityNet": "-9243301499770587"
    },
    {
      "tick": "263040",
      "statePrice": "26.49176573512339",
      "liquidityGross": "51050167223971",
      "liquidityNet": "-30118033626473"
    },
    {
      "tick": "263100",
      "statePrice": "26.651186141629125",
      "liquidityGross": "356436151693028",
      "liquidityNet": "-356436151693028"
    },
    {
      "tick": "263160",
      "statePrice": "26.81156589777824",
      "liquidityGross": "2860950064302042",
      "liquidityNet": "1502877954331514"
    },
    {
      "tick": "263220",
      "statePrice": "26.972910776681964",
      "liquidityGross": "79578452045188695",
      "liquidityNet": "70503716513247725"
    },
    {
      "tick": "263280",
      "statePrice": "27.135226586192555",
      "liquidityGross": "77253816342785751",
      "liquidityNet": "76835065928144335"
    },
    {
      "tick": "263340",
      "statePrice": "27.298519169112417",
      "liquidityGross": "4558359682524738",
      "liquidityNet": "4503266701174838"
    },
    {
      "tick": "263400",
      "statePrice": "27.462794403404356",
      "liquidityGross": "4802857523418237",
      "liquidityNet": "4085134427468871"
    },
    {
      "tick": "263460",
      "statePrice": "27.62805820240321",
      "liquidityGross": "3793081726775488",
      "liquidityNet": "-3235086979619026"
    },
    {
      "tick": "263520",
      "statePrice": "27.7943165150287",
      "liquidityGross": "724722108326432",
      "liquidityNet": "-724722108326432"
    },
    {
      "tick": "263580",
      "statePrice": "27.961575325999544",
      "liquidityGross": "241718641241365",
      "liquidityNet": "-241718641241365"
    },
    {
      "tick": "263640",
      "statePrice": "28.129840656048927",
      "liquidityGross": "3332273190612355",
      "liquidityNet": "-1871247095585359"
    },
    {
      "tick": "263700",
      "statePrice": "28.299118562141224",
      "liquidityGross": "116198079424872",
      "liquidityNet": "-65857887407734"
    },
    {
      "tick": "263760",
      "statePrice": "28.46941513768995",
      "liquidityGross": "936122685327105",
      "liquidityNet": "-936122685327105"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

### /getusertokenids

This endpoint provides the token IDs of all current positional NFTs held by a given wallet.

Currently Available on :

| Dex Name      | Chain Name | DEX ID |
| ------------- | ---------- | ------ |
| UniswapV3     | Ethereum   | 1300   |
| UniswapV3     | Avalanche  | 1305   |
| UniswapV3     | Binance    | 1306   |
| UniswapV3     | Polygon    | 1307   |
| UniswapV3     | Arbitrum   | 1308   |
| UniswapV3     | Base       | 1309   |
| PancakeswapV3 | Binance    | 2800   |
| PancakeswapV3 | Arbitrum   | 2808   |
| PancakeswapV3 | Base       | 2809   |

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

#### Request Body

<table data-full-width="false"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>dexId</td><td>String</td><td>Refer to the <a href="../ids/dex-ids">DexID</a><a href="../ids/chain-ids"> </a>page for details. </td></tr><tr><td>address<mark style="color:red;">*</mark></td><td>String</td><td>Address of user</td></tr></tbody></table>

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

```
https://api.expand.network/dex/getusertokenids?dexId=1300&address=0xF802993d29eA093E062658C1B5EC2727DE8a3247
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "tokens": [
            {
                "tokenId": "818396",
                "liquidity": "42704482896171366122"
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

Following is a sequence diagram for swap() process:-

<figure><img src="https://680235803-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaWFVt3vE2Ci7ngiL0xHe%2Fuploads%2F8iYVy1urZXVveB53cIdZ%2FDEX_SWAP%20(2).jpeg?alt=media&#x26;token=23fd2985-230f-42f1-804c-69d4721ddab8" alt=""><figcaption><p>Sequence Diagram for swap</p></figcaption></figure>

Following is a sequence diagram for addLiquidity() process:-

<figure><img src="https://680235803-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaWFVt3vE2Ci7ngiL0xHe%2Fuploads%2FBjLdbQ6khRgTJece5FPj%2FDEX_SWAP%20(4).jpeg?alt=media&#x26;token=ed3bbcd3-0a5a-4705-837b-fbe4032548da" alt=""><figcaption><p>Sequence diagram for addLiquidity</p></figcaption></figure>

Following is a sequence diagram for removeLiquidity() process:-

<figure><img src="https://680235803-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaWFVt3vE2Ci7ngiL0xHe%2Fuploads%2FFrY9gMVy3mNUbIiwJT6U%2FDEX_SWAP%20(3).jpeg?alt=media&#x26;token=015461db-2a40-4ea1-9912-a3d1619527db" alt=""><figcaption><p>Sequence diagram for removeLiquidity</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.expand.network/integrations/dex-and-dex-aggregators.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
