# Uniswap V2

### /getprice

## Returns the swap quotation for the given token pairs.

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

#### Query Parameters

| Name                                       | Type   | Description                                                                                      |
| ------------------------------------------ | ------ | ------------------------------------------------------------------------------------------------ |
| rpc                                        | String | Remote procedural call URL.                                                                      |
| dexId                                      | String | Refer to the [DEX ID](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/dex-id.md) 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=1000&path=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,0xdac17f958d2ee523a2206206994597c13d831ec7&amountIn=10000000000000000000
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "amountIn": "10000000000000000000",
        "path": [
            "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
            "0xdac17f958d2ee523a2206206994597c13d831ec7"
        ],
        "amountsOut": [
            "10000000000000000000",
            "15682130807"
        ]
    }
}
```

{% 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                                     | String | Refer to [DEX ID](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/dex-id.md) 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?tokenA=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2&tokenB=0x6b175474e89094c44da98b954eedeac495271d0f&address=0x6fb447ae94f5180254d436a693907a1f57696900&dexId=1000
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "pairAddress": "0xA478c2975Ab1Ea89e8196811F51A7B7Ade33eB11",
        "liquidity": "2087379027763486",
        "tokenA": "91297717639957",
        "tokenB": "153006474077467970"
    }
}
```

{% 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                                         | String | Refer to [DEX ID](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/dex-id.md) page for details. |

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

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

{% endtab %}

{% tab title="Sample Response" %}

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

{% 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                                         | String | Refer to [DEX ID](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/dex-id.md) page for details. |

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

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

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "WETH": "16984981267096993883931",
        "USDT": "31586831096555"
    }
}
```

{% endtab %}
{% endtabs %}

### /getliquidityholders

## Returns the total number of liquidity holders in the specified pool.

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

#### Query Parameters

| Name                                          | Type   | Description                                                                                  |
| --------------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| rpc                                           | String | Remote procedural call URL.                                                                  |
| poolAddress<mark style="color:red;">\*</mark> | String | The pool address.                                                                            |
| dexId                                         | String | Refer to [DEX ID](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/dex-id.md) page for details. |

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

```url
https://api.expand.network/dex/getliquidityholders?poolAddress=0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852&dexId=1000
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "totalTokenHolders": "2572"
    }
}
```

{% endtab %}
{% endtabs %}

### /getindividualposition

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

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

#### Query Parameters

| Name                                      | Type   | Description                                                                                                                          |
| ----------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------ |
| rpc                                       | String | Remote procedural call URL.                                                                                                          |
| address<mark style="color:red;">\*</mark> | String | The public address of the liquidity holder.                                                                                          |
| dexId                                     | String | Refer to [DEX ID](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/dex-id.md) page for details.                                         |
| poolAddresses                             | String | The pool Addresses whose liquidity is to be fetched. *(Comma-separated vaules)*                                                      |
| 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> |

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

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

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "aggregatedLiquidity": "2370404879481514",
        "poolAddresses": {
            "DAIWETH": {
                "0xA478c2975Ab1Ea89e8196811F51A7B7Ade33eB11": "2370404879481514"
            }
        }
    }
}
```

{% 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                                         | String | Refer to [DEX ID](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/dex-id.md) page for details. |
| endPage                                       | String | <p>Index of the last page that user wants to query.</p><p>By default: startPage+9</p>        |
| startPage                                     | String | <p>Index of the start page that user wants to query.</p><p>By default: endPage-9</p>         |

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

```url
https://historicallp.api.expand.network/dex/getpoolindividualliquidity?startPage=211&endPage=212&poolAddress=0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852&dexId=1000
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
  "status": 200,
  "msg": "success",
  "data": {
      "totalPages": "434",
      "currentPages": "211-212",
      "users": [
        {
          "userAddress": "0x5e34e63c37ce88e0d404c3ba149317ddf5f4ecaa",
          "liquidityData": [
              {
                  "blockNumber": "10975329",
                  "assets": {
                      "WETH": "87432734717490961",
                      "USDT": "30000000"
                  }
              }
          ]
      },
      {
          "userAddress": "0xf00a67934445876587ceda02728d493faa980b7a",
          "liquidityData": [
              {
                  "blockNumber": "10975289",
                  "assets": {
                      "WETH": "3494751089343567443",
                      "USDT": "1196562631"
                  }
              }
          ]
      },
      {
          "userAddress": "0xcd9410d3fe8916267f82dc13d7bbdba99e5643f7",
          "liquidityData": [
              {
                  "blockNumber": "10975229",
                  "assets": {
                      "WETH": "125975496436173808",
                      "USDT": "43126850"
                  }
              }
          ]
      },
      {
          "userAddress": "0xbffd0519e7bc626bf6ce4a31503bcb0a4075295b",
          "liquidityData": [
              {
                  "blockNumber": "10975228",
                  "assets": {
                      "WETH": "2999874086297596538",
                      "USDT": "1027021840"
                  }
              }
          ]
      },
      {
          "userAddress": "0x38d744e972419efe95df2aa6c047df9cd01579c5",
          "liquidityData": [
              {
                  "blockNumber": "10975194",
                  "assets": {
                      "WETH": "1425646890758547175",
                      "USDT": "488181735"
                  }
              }
          ]
      },
      {
          "userAddress": "0x40285fc5233fff0da4bf2c5f93e187fb4ab3306a",
          "liquidityData": [
              {
                  "blockNumber": "10975176",
                  "assets": {
                      "WETH": "1152868937561643841",
                      "USDT": "395000000"
                  }
              }
          ]
      }
      ]
  }
}
```

{% endtab %}
{% endtabs %}

### /gethistoricaltimeseries

## Get the historical time series transactions for a specific pool address.

<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](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/dex-id.md) 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?poolAddress=0x517f9dd285e75b599234f7221227339478d0fcc8&dexId=1000
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "pair": "DAI/MKR",
        "priceData": [
            {
                "hash": "0x0700027e70d6d216810815c38a0959fe0635867ea2480ab1f6e20d3c98731ff0",
                "timestamp": 1703748059,
                "price": "0.0006244081987727642"
            },
            {
                "hash": "0x1c3b182bb64097b756b03aaa3717663af8064ecf3e05f02f7b6e339785558f1f",
                "timestamp": 1703747891,
                "price": "0.0006261003865058129"
            },
            {
                "hash": "0xec8964514a2cb94d565c84794cf7125333f2a18e376764fc24c5fd32df09a93e",
                "timestamp": 1703747855,
                "price": "0.0006274642197158615"
            },
            {
                "hash": "0x4ece3e41b95e78c882ce79ec2fa80bd7eef0503a6d7b759bc3336cc9fc40867b",
                "timestamp": 1703747843,
                "price": "0.00062797052848499"
            },
            {
                "hash": "0xf4e8eb0cc1661d952dc0e2d5d5ee2b16dd66b5f8a275fd3d148dd9ce53ed7964",
                "timestamp": 1703746955,
                "price": "0.0006318073557952554"
            },
            {
                "hash": "0xcae75ad1f4b23672972cc793b8dfa97e5c257f368ed3b6d72afb1bcb92444ea5",
                "timestamp": 1703746403,
                "price": "0.0006311921656383271"
            },
            {
                "hash": "0xbf1eef520c783cd699c1b040b8c1274c90ff4cc76b24994fb95123e3a9b360d5",
                "timestamp": 1703746355,
                "price": "0.0006303980131723315"
            },
            {
                "hash": "0xddf411be6d49bcddcc306cae01f4a3d7bbee240a295ba18e1a762e3a3290f302",
                "timestamp": 1703746319,
                "price": "0.000629607991380723"
            },
            {
                "hash": "0x31e8736e4e7eb1f862bfc4a66414859bb49102390bb97736facf4613035a81e5",
                "timestamp": 1703745695,
                "price": "0.0006261412353574351"
            },
            {
                "hash": "0x6dea226fba19c1da6e96feb49511e1fef3a27cbded505e3d597bb9e5f5121e9e",
                "timestamp": 1703745083,
                "price": "0.0006301614630221084"
            },
            {
                "hash": "0xc1ae0d5cb6774c9b76c3f005eb136b9fb5951c0d32f1027806d755ff45760b0d",
                "timestamp": 1703744891,
                "price": "0.000629113433416803"
            },
            {
                "hash": "0x20937932802b6eb955192a589c7e0143127554fa60f05a429dc25f5cc6342f5e",
                "timestamp": 1703743655,
                "price": "0.0006273380063042033"
            },
            {
                "hash": "0xaf2d9bfae18358fb785d4a7ae8b35099c63777c557e92db96c98bc0b41531071",
                "timestamp": 1703743631,
                "price": "0.0006255421068541817"
            },
            {
                "hash": "0x161d09fdd5e30165040ebd65832b35337fd608d47e119a139f608b2045410409",
                "timestamp": 1703742575,
                "price": "0.0006215430273569083"
            },
            {
                "hash": "0xc264388fba6edb499d5846a456217a4ddf0668d156356c8695ab34c6be55ce23",
                "timestamp": 1703742515,
                "price": "0.0006222533452384632"
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

### /gethistoricaltransactions

## Get the historical transactions focusing on swaps associated with a specific pool address.

<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](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/dex-id.md) 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=0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc&dexId=1000
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "pair": "USDC/WETH",
        "transactions": [
            {
                "transactionHash": "0xe02a5ced07a09949bb143486c5d57947d0b904d7ffa620637e2b11a4810ff645",
                "transactionDetails": {
                    "blockHash": "0xa870d68aa85ea355176dd1f49912cb0df145a967a8a6789a2e9a9ca659aabfc5",
                    "blockNumber": "18879055",
                    "from": "0xcc4ea98876f3ee733712ac64137c34e637fc2dae",
                    "gas": "203074",
                    "gasPrice": "30150130093",
                    "maxFeePerGas": "41820000000",
                    "maxPriorityFeePerGas": "110000000",
                    "hash": "0xe02a5ced07a09949bb143486c5d57947d0b904d7ffa620637e2b11a4810ff645",
                    "input": "0xf305d719000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000e210966f48000000000000000000000000000000000000000000000000000000e0ef3985c30000000000000000000000000000000000000000000000164f0244c4ce3dffe6000000000000000000000000cc4ea98876f3ee733712ac64137c34e637fc2dae00000000000000000000000000000000000000000000000000000000658c7c4b",
                    "nonce": "212",
                    "to": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
                    "transactionIndex": "88",
                    "value": "413589505640828440000",
                    "type": "2",
                    "accessList": [],
                    "chainId": "1",
                    "v": "0x0",
                    "r": "0xc01569d522e3ed0c193fbc1e6cf689d61ab1affdcdba0eab79fa09afe441415f",
                    "s": "0x4fe253f33af8c7efa878194c1d074b4b4ff662016eb47a7dd0d1948f30b45e73",
                    "yParity": "0x0"
                }
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

### /getpoolchartdata

## Get the data for the pool and obtain the OHCL (Open, High, Close, Low) prices within the specified time interval.

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

#### Query Parameters

| Name                                          | Type   | Description                                                                                  |
| --------------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| dexId<mark style="color:red;">\*</mark>       | String | Refer to [DEX ID](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/dex-id.md) page for details. |
| interval                                      | String | 15 mins(by default), 30 mins, 60 mins, and 90 mins.                                          |
| 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/getpoolchartdata?dexId=1000&poolAddress=0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc&interval=60
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "pair": "USDC/WETH",
        "chartData": {
            "18882523 to 18882800": [
                {
                    "open_price": "419005433942909",
                    "close_price": "419447697581705",
                    "low_price": "418943818861548",
                    "high_price": "422263827518504",
                    "transactions": [
                        {
                            "blockNumber": "18882529",
                            "price": "418986597113367",
                            "amount": {
                                "token0": "2400000000",
                                "token1": "1005567833072081114"
                            }
                        },
                        {
                            "blockNumber": "18882531",
                            "price": "421498241454276",
                            "amount": {
                                "token0": "679221347",
                                "token1": "286290603318704585"
                            }
                        },
                        {
                            "blockNumber": "18882538",
                            "price": "418975454284176",
                            "amount": {
                                "token0": "376508407",
                                "token1": "157747780864636534"
                            }
                        },
                        {
                            "blockNumber": "18882543",
                            "price": "418968454985399",
                            "amount": {
                                "token0": "513835000",
                                "token1": "215280656067422305"
                            }
                        },
                        {
                            "blockNumber": "18882543",
                            "price": "418963677671102",
                            "amount": {
                                "token0": "93100000",
                                "token1": "39005518391179607"
                            }
                        },
                        {
                            "blockNumber": "18882548",
                            "price": "418960589212921",
                            "amount": {
                                "token0": "300000000",
                                "token1": "125688176763876449"
                            }
                        },
                        {
                            "blockNumber": "18882560",
                            "price": "418954948262823",
                            "amount": {
                                "token0": "417601922",
                                "token1": "174956391625965577"
                            }
                        },
                        {
                            "blockNumber": "18882561",
                            "price": "418947749154645",
                            "amount": {
                                "token0": "498134300",
                                "token1": "208692243761724622"
                            }
                        },
                        {
                            "blockNumber": "18882565",
                            "price": "421805099375960",
                            "amount": {
                                "token0": "42147657986",
                                "token1": "17778097065248708608"
                            }
                        }
                    ]
                }
            ]
        }
    }
}
```

{% endtab %}
{% endtabs %}

### /getpooltradedata

## Get the trade data from the pool within a specified block range, for the specified event type

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

#### Query Parameters

| Name                                          | Type   | Description                                                                                  |
| --------------------------------------------- | ------ | -------------------------------------------------------------------------------------------- |
| dexId<mark style="color:red;">\*</mark>       | String | Refer to [DEX ID](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/dex-id.md) 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 data is to be fetched.                                                    |
| eventType                                     | String | Transfer, Swap, Burn or Mint(by default).                                                    |

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

```url
https://historicaltrade.api.expand.network/dex/getpooltradedata?poolAddress=0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc&dexId=1000&eventType=Burn
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "pair": "USDC/WETH",
        "transactions": [
            {
                "blockNumber": "18880403",
                "transactionHash": "0x47d3993957a8497a7549276c96b3c18987586075f5882124cfd477fd989cd3fd",
                "values": {
                    "0": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
                    "1": "1596637993",
                    "2": "671389840781055738",
                    "3": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
                    "sender": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
                    "amount0": "1596637993",
                    "amount1": "671389840781055738",
                    "to": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D"
                },
                "eventType": "Burn",
                "data": {
                    "data": "0x000000000000000000000000000000000000000000000000000000005f2ac32900000000000000000000000000000000000000000000000009514180c58f96fa",
                    "topics": [
                        "0xdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496",
                        "0x0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d",
                        "0x0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d"
                    ]
                }
            },
            {
                "blockNumber": "18879029",
                "transactionHash": "0x22c9fcffc57264eb4270f2ecf0d4f23b39a3871adcee89414285f3a1e1f152e2",
                "values": {
                    "0": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
                    "1": "970041191908",
                    "2": "413293955455183879313",
                    "3": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
                    "sender": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
                    "amount0": "970041191908",
                    "amount1": "413293955455183879313",
                    "to": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D"
                },
                "eventType": "Burn",
                "data": {
                    "data": "0x000000000000000000000000000000000000000000000000000000e1daf5ede4000000000000000000000000000000000000000000000016679b16c2e259fc91",
                    "topics": [
                        "0xdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496",
                        "0x0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d",
                        "0x0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d"
                    ]
                }
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

### /swap

## Initiate a swap transaction on a specified DEX.

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

#### Request Body

| Name                                           | Type   | Description                                                                                                                                                                                                                                                                                                     |
| ---------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| dexId                                          | String | Refer to the [DEX ID](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/dex-id.md) page for details.                                                                                                                                                                                                                |
| path<mark style="color:red;">\*</mark>         | Array  | Comma-separated values of token addresses, inside an array, to swap.                                                                                                                                                                                                                                            |
| amountIn<mark style="color:red;">\*</mark>     | String | Amount of token to be swapped.                                                                                                                                                                                                                                                                                  |
| amountOutmin<mark style="color:red;">\*</mark> | String | Minimum amount accepted as the result of swap.                                                                                                                                                                                                                                                                  |
| to<mark style="color:red;">\*</mark>           | String | Address of the recipient of the token.                                                                                                                                                                                                                                                                          |
| deadline<mark style="color:red;">\*</mark>     | String | Deadline for the transaction to be executed (UNIX Timestamp).                                                                                                                                                                                                                                                   |
| from<mark style="color:red;">\*</mark>         | String | Address of the sender of the token.                                                                                                                                                                                                                                                                             |
| gas<mark style="color:red;">\*</mark>          | String | Maximum gas limit provided by the sender, for the transaction.                                                                                                                                                                                                                                                  |
| rpc                                            | String | Remote procedural call URL.                                                                                                                                                                                                                                                                                     |
| involveBaseToken                               | String | <p>If a base token is involved in the swap;<br><code>0</code> for erc20 -> erc20, <br><code>1</code> for base -> erc20 ("from" address should be of equivalent wrapped token),<br><code>2</code> for erc20 -> base ("to" address should be of equivalent wrapped token).</p><p>By default, <code>0</code> .</p> |
| gasPriority                                    | String | low, medium, or high.                                                                                                                                                                                                                                                                                           |
| slippage                                       | String | <p>Percentage of total swap value. <br>By default, 1.</p><p>0 <= slippage  value <= 10</p>                                                                                                                                                                                                                      |

{% 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": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
        "value": "0",
        "gas": "173376",
        "data": "0x38ed173900000000000000000000000000000000000000000000000000038d7ea4c68000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000063056e00436da25bcf48a40dfbbdcc708935100600000000000000000000000000000000000000000000000000000000634d00ee0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000b4fbf271143f4fbf7b91a5ded31805e42b2208d600000000000000000000000011fe4b6ae13d2a6055c8d9cf65c55bac32b5d844"
    }
}
```

{% endtab %}
{% endtabs %}

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

<pre class="language-json"><code class="lang-json">{
    "dexId": "1000",
    "amountIn": "10000000000",
    "amountOutMin": "0",
    "path": [
        "0x6B175474E89094C44Da98b954EedeAC495271d0F",
        "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
    ],
    "to": "0x356dB816602c85e2075774bB77D13995c8Bab023",
    "deadline": "1765990894",
    "from": "0x356dB816602c85e2075774bB77D13995c8Bab023",
    "gas": "273376",
    "gasPriority": "high"
<strong>}
</strong></code></pre>

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x356dB816602c85e2075774bB77D13995c8Bab023",
        "to": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
        "value": "0",
        "gas": "187586",
        "data": "0x38ed173900000000000000000000000000000000000000000000000000000002540be400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000356db816602c85e2075774bb77d13995c8bab023000000000000000000000000000000000000000000000000000000006942e1ee00000000000000000000000000000000000000000000000000000000000000020000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "dexId": "1000",
    "amountIn": "10000000000000",
    "amountOutMin": "0",
    "path": [
        "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        "0x6B175474E89094C44Da98b954EedeAC495271d0F"
    ],
    "to": "0x22cf65ae3fa16d6379e72f4b4c2401c1b7c69731",
    "deadline": "1701931771",
    "from": "0x22cf65ae3fa16d6379e72f4b4c2401c1b7c69731",
    "gas": "173376",
    "gasPriority": "low",
    "slippage": "10"
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x22cf65ae3fa16d6379e72f4b4c2401c1b7c69731",
        "to": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
        "value": "0",
        "gas": "173376",
        "data": "0x38ed1739000000000000000000000000000000000000000000000000000009184e72a00000000000000000000000000000000000000000000000000000486999ef3cec9000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000022cf65ae3fa16d6379e72f4b4c2401c1b7c697310000000000000000000000000000000000000000000000000000000065716afb0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f"
    }
}
```

{% 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                                            | String | Refer to the [DEX ID](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/dex-id.md) 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<mark style="color:red;">\*</mark>            | String | Maximum gas limit provided by the sender, for the transaction.                                   |
| rpc                                              | String | Remote procedural call URL.                                                                      |
| gasPriority                                      | String | low, medium, or high.                                                                            |
| slippage                                         | String | <p>Percentage of total value. <br>By default, 1.</p><p>0 <= slippage  value <= 10</p>            |

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

```json
{
    "dexId": "1000",
    "tokenA": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", 
    "tokenB": "0x6B175474E89094C44Da98b954EedeAC495271d0F", 
    "amountADesired": "1000000000000000",
    "amountBDesired": "1332066335118442626",
    "amountAMin": "0",
    "amountBMin": "0",
    "to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",  
    "deadline": "166978170",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",  
    "gas": "230000"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
        "to": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
        "value": "0",
        "gas": "230000",
        "data": "0xe8e33700000000000000000000000000b4fbf271143f4fbf7b91a5ded31805e42b2208d600000000000000000000000011fe4b6ae13d2a6055c8d9cf65c55bac32b5d84400000000000000000000000000000000000000000000000000038d7ea4c68000000000000000000000000000000000000000000000000000127c734631fdc0820000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000063056e00436da25bcf48a40dfbbdcc70893510060000000000000000000000000000000000000000000000000000000009f3e27a"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "dexId": "1000",
    "tokenA": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", 
    "tokenB": "0x6B175474E89094C44Da98b954EedeAC495271d0F", 
    "amountADesired": "1000",
    "amountBDesired": "997726184637093",
    "amountAMin": "0",
    "amountBMin": "0",
    "poolFees":"3000",
    "from": "0x356dB816602c85e2075774bB77D13995c8Bab023",
    "to":"0x356dB816602c85e2075774bB77D13995c8Bab023",
    "deadline":"1699965863785",
    "gas": "0",
    "gasPriority":"medium"
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x356dB816602c85e2075774bB77D13995c8Bab023",
        "to": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
        "value": "0",
        "gas": "201790",
        "data": "0xe8e33700000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000038b6d3ad182a500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000356db816602c85e2075774bb77d13995c8bab0230000000000000000000000000000000000000000000000000000018bcddc8769"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "dexId": "1000",
    "tokenA": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
    "tokenB": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "amountADesired": "1000000",
    "amountBDesired": "640706397834636",
    "amountAMin": "100",
    "amountBMin": "100",
    "to": "0x22cf65Ae3fa16d6379E72F4B4c2401c1B7C69731",
    "deadline": "1712015780705",
    "from": "0x22cf65Ae3fa16d6379E72F4B4c2401c1B7C69731",
    "gas": "230000",
    "slippage": "5.00001"
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x22cf65Ae3fa16d6379E72F4B4c2401c1B7C69731",
        "to": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
        "value": "0",
        "gas": "230000",
        "data": "0xe8e33700000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000246b8153f8d8c000000000000000000000000000000000000000000000000000000000000005f000000000000000000000000000000000000000000000000000000000000005f00000000000000000000000022cf65ae3fa16d6379e72f4b4c2401c1b7c697310000000000000000000000000000000000000000000000000000018e9c17ab61"
    }
}
```

{% 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                                        | String | Refer to the [DEX ID](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/dex-id.md) 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<mark style="color:red;">\*</mark>        | 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 | Percentage of total value. By default, 1. 0 <= slippage value <= 10                              |

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

```json
{
    "dexId": "1000",
    "tokenA": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "tokenB": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
    "liquidity": "20759430672661383",
    "amountAMin": "0",
    "amountBMin": "0",
    "to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "deadline": "1669720626",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "420000"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
        "to": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
        "value": "0",
        "gas": "420000",
        "data": "0xbaa2abde000000000000000000000000b4fbf271143f4fbf7b91a5ded31805e42b2208d600000000000000000000000011fe4b6ae13d2a6055c8d9cf65c55bac32b5d8440000000000000000000000000000000000000000000000000049c0979afbbb870000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000063056e00436da25bcf48a40dfbbdcc7089351006000000000000000000000000000000000000000000000000000000006385ea32"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "dexId": "1000",
    "tokenA": "0x6B175474E89094C44Da98b954EedeAC495271d0F", 
    "tokenB": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", 
    "amountAMin": "0",
    "amountBMin": "0",
    "from": "0x356dB816602c85e2075774bB77D13995c8Bab023",
    "to":"0x356dB816602c85e2075774bB77D13995c8Bab023",
    "deadline":"1700033844291",
    "liquidity":"65051302687488",
    "gas": "123444",
    "gasPriority":"medium"
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x356dB816602c85e2075774bB77D13995c8Bab023",
        "to": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
        "value": "0",
        "gas": "200648",
        "data": "0xbaa2abde0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000003b29efc9f30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000356db816602c85e2075774bb77d13995c8bab0230000000000000000000000000000000000000000000000000000018bd1e9d443"
    }
}
```

{% endtab %}
{% endtabs %}

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

```json
{
    "dexId": "1000",
    "tokenA": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
    "tokenB": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "liquidity": "3834508059710445",
    "amountAMin": "100",
    "amountBMin": "100",
    "to": "0x4970798F8E5a77598CA4Da778eb6D12303AEefc9",
    "deadline": "1669720626",
    "from": "0x4970798F8E5a77598CA4Da778eb6D12303AEefc9",
    "gas": "420000",
    "slippage": "5.01"
}
```

{% endtab %}

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

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x4970798F8E5a77598CA4Da778eb6D12303AEefc9",
        "to": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
        "value": "0",
        "gas": "420000",
        "data": "0xbaa2abde0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000d9f76fac993ed000000000000000000000000000000000000000000000000000000000000005f000000000000000000000000000000000000000000000000000000000000005f0000000000000000000000004970798f8e5a77598ca4da778eb6d12303aeefc9000000000000000000000000000000000000000000000000000000006385ea32"
    }
}
```

{% endtab %}
{% endtabs %}


---

# 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/~/changes/CwwHZ0oIeFsEWwiEWd1b/integrations/dex-and-aggregators/uniswap-v2.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.
