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:

NameDescription

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.

Return the aggregated dex analyses on Ethereum network. Available for Uniswap V2, Uniswap V3 and SushiSwap V2.

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

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

NameTypeDescription

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

NameTypeDescription

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.

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

Query Parameters

NameTypeDescription

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.

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

/getwalletposition

Get detailed information for user transactions on various DEXs, including transaction type, block-related details, decoded parameters and more. Available for Uniswap V2, Uniswap V3, SushiSwap V2, Curve V2, and Balancer V2.

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

Query Parameters

NameTypeDescription

pageToken

String

The page number that the user wants to fetch.

By default, 1.

address*

String

Public address of the user.

https://historicallp.api.expand.network/dex/getwalletposition?address=0xEf1B32354C3d8A273331Cd532D1576bB819B6E36&pageToken=3

/swapaggregator

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

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

Request Body

NameTypeDescription

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.

excludedDexes

String

Comma-separated values of dexes to exclude.

bestSwap

Boolean

If true, prepared transaction will be sorted by amountsOut in desc order

cheapestSwap

Boolean

If true, prepared transaction will be sorted by amount of gas in asc order

to*

String

Address of the recipient of the token.

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 returns aggregated dex analyses on Ethereum network. Available for Uniswap V2, Uniswap V3 and SushiSwap V2.

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

Query Parameters

NameTypeDescription

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

NameTypeDescription

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"
}

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