DEX & DEX Aggregators

Provides connectivity across the various decentralized exchanges available on the EVM and Non-EVM chains.

Below are descriptions of the endpoints we support for DEXs and DEX Aggregators:

Name
Description

getprice GET

Returns the swap quotation for the given token pairs for the specified DEX.

getuserliquidity GET

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

getpoolliquidity GET

Returns the total liquidity for a specified pool.

gettokenliquidity GET

Returns the individual token liquidity within the specified liquidity pool.

Source details for the 100 most recently minted tokens, including token address, symbol, name, logo url, and supported DEXs.

getliquidityholders GET

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

getindividualposition GET

Returns the liquidity position for a specified user address across all the pools for a specified DEX.

getliquiditysources GET

Get the liquidity sources for the specified dex aggregator(on the basis of chain), supported by expand.network.

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

gethistoricaltimeseries GET

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

gethistoricaltransactions GET

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

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 and V3, Balancer, Curve V2, and Sushiswap.

getpooltradedata GET

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

getpoolindividualliquidity GET

Get all user addresses, block numbers, and token position details for a specified pool address. Available for Uniswap V2,V3 and Sushiswap only.

Get detailed information for user transactions on various DEXs, including transaction type, block-related details, decoded parameters and many more.

Retrieves quotes from various DEXs & 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.

swap POST

Initiate a swap transaction on a specified DEX.

addliquidity POST

Add liquidity to a specified pool in a specified DEX.

removeliquidity POST

Remove liquidity from a specified pool for a specified DEX.

Returns the aggregated prepared swap quotes for every DEX, in which the pair address is present.

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.

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

This endpoint provides the amount of liquidity distributed across different ticks for UniswapV3, TraderJoe and PancakeswapV3. Currently available for Ethereum,Avalanche, Binance and Polygon

getusertokenids

This endpoint provides the token IDs of all the active position NFTs the user holds.

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

/gettokenlist

Retrieves the details of token mapping for the top 100 trending tokens by default or retrieves the detail of specific token mapping by token address.Available for Uniswap V2, Uniswap V3, SushiSwap V2

GET https://api.expand.network/dex/gettokenlist

Query Parameter

Name
Type
Description

rpc

String

Remote procedural call URL.

tokenAddress

String

Address of the token.

https://api.expand.network/dex/gettokenlist

/getpools

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

GET https://api.expand.network/dex/getpools

Query Parameters

Name
Type
Description

dexId*

String

Comma-separated values of Dex Id. Refer to the DEX ID page for details.

path*

String

Comma-separated values of token pair.

amountIn*

String

Amount of token.

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

/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 and V3, Balancer, Curve V2, and Sushiswap.

/quoteaggregator

Returns a list of all the quotes for a pool on different DEXs. Available on Ethereum and BSC only.

GET https://api.expand.network/dex/quoteaggregator

Query Parameters

Name
Type
Description

chainId

String

Refer to the Chain ID page for details.

path*

String

Comma-separated values of token pair.

amountIn*

String

Amount of token.

chainSymbol

String

Refer to the Chain ID 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.

https://api.expand.network/dex/quoteaggregator?path=0xdac17f958d2ee523a2206206994597c13d831ec7%2C0x6B175474E89094C44Da98b954EedeAC495271d0F&amountIn=1000000&chainId=1&excludedDexes=1000,1100,1400

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

GET https://historicallp.api.expand.network/dex/getwalletposition

Query Parameters

Name
Type
Description

address*

String

Public address of the user.

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

/swapaggregator

Returns the aggregated prepared swap quotes for every DEX, in which the pair address is present. Available on Ethereum and BSC only.

POST https://api.expand.network/dex/swapaggregator

Request Body

Name
Type
Description

chainId

String

Refer to the Chain ID page for details.

path*

String

Comma-separated values of token pair.

amountIn*

String

Amount of token.

chainSymbol

String

Refer to the Chain ID page for details.

from*

String

Address of the sender of the token.

gas*

String

Maximum gas limit provided by the sender, for the transaction.

to*

String

Address of the recipient of the token.

poolFees

String

Different pool based on the fees. By default, it is selected as 3000.

excludedDexes

String

Comma-separated values of dexes to exclude.

bestSwap

Boolean

If true, the endpoint will sort the prepared transactions by amountsOut (the best quote) in descending order Note: If you select "true" for both the "bestSwap" and "cheapestSwap" parameters, the "cheapestSwap" parameter will apply.

cheapestSwap

Boolean

If true, the endpoint will sort the prepared transactions by amount of gas in ascending order Note: If you select "true" for both the "bestSwap" and "cheapestSwap" parameters, the "cheapestSwap" parameter will apply.

gasPriority

String

low, medium, or high.

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

With gasPriority:

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

/dex/screen

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. By default, this endpoint supports top 30 pools ranked by TVL, but the set can be customized.

GET https://historicallp.api.expand.network/dex/screen

Query Parameters

Name
Type
Description

dex

String

Uniswap V2, Uniswap V3 and SushiSwap V2.

liquiditygte

String

Liquidity of Pools greater than or equals to

liquiditylte

String

Liquidity of Pools less than or equals to

volumegte

String

Volume of Pools greater than or equals to

volumelte

String

Volume of Pools less than or equals to

marketCapgte

String

Market cap of Pools greater than or equals to

marketCaplte

String

Market cap of Pools less than or equals to

makersgte

String

Makers of Pools greater than or equals to

makerslte

String

Makers of Pools less than or equals to

transactionsgte

String

Transactions of Pools greater than or equals to

transactionslte

String

Transactions of Pools less than or equals to

fdvgte

String

FDV of Pools greater than or equals to

fdvlte

String

FDV of Pools less than or equals to

pairAgegte

String

PairAge of Pools greater than or equals to

pairAgelte

String

PairAge of Pools less than or equals to

https://historicallp.api.expand.network/dex/screen

/swapwithapproval

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

POST https://api.expand.network/dex/swapwithapproval

Request Body

Name
Type
Description

dexId

String

Refer to the Chain ID page for details.

path*

String

Comma-separated values of token pair.

amountIn*

String

Amount of token.

from*

String

Address of the sender of the token.

slippage

String

Percentage of total swap value. By default, 1.

0 <= slippage value <= 10

swap parameters for the dex specified

-

Refer specified dex swap page for parametes

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

/getliquiditybytick

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

GET https://historicallp.api.expand.network/dex/getliquiditybytick

Request Body

Name
Type
Description

dexId

String

Refer to the DexID page for details.

poolAddress*

String

Address of Pool

tickRange

String

Range of tick from 0 to 10. By default 10

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

/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

GET https://api.expand.network/dex/getusertokenids

Request Body

Name
Type
Description

dexId

String

Refer to the DexID page for details.

address*

String

Address of user

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

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

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

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

Last updated