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:
Returns the swap quotation for the given token pairs for the specified DEX.
Returns the balance of a particular token pair of an account.
Returns the total liquidity for a specified pool.
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.
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.
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 .
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.
Initiate a swap transaction on a specified DEX.
Add liquidity to a specified pool in a specified DEX.
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
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
Remote procedural call URL.
Sample Request Sample Response
Copy https://api.expand.network/dex/gettokenlist
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"tokenList" : [
{
"contract_address" : "0x99411eb6c3ff2a37a0e8c48d0c44b900e13710b4" ,
"token_name" : "Disdainful The Bear" ,
"token_symbol" : "DISDAIN" ,
"decimals" : "9" ,
"logo_url" : "https://assetlogo.expand.network/ethereum/DISDAIN.png" ,
"availableDex" : {
"uniswapV2" : [
"0xc4201bfeefd9a08f58c5e2d0877f788167e07666"
]
}
} ,
{
"contract_address" : "0x7ce0b3878bc54bfc989d2b3f9583a39ce7ad1b27" ,
"token_name" : "Megadeth by 𝓜𝓪𝓽𝓽 𝓕𝓾𝓻𝓲𝓮" ,
"token_symbol" : "MEGADETH" ,
"decimals" : "9" ,
"logo_url" : "https://assetlogo.expand.network/ethereum/MEGADETH.png" ,
"availableDex" : {
"uniswapV2" : [
"0x18aa074ca80ffaf28aa0353a6dd2e528c9d6fc6b"
]
}
} ,
{
"contract_address" : "0x63c5b611ee5b1f24a64aa0c423bc57eedc46a194" ,
"token_name" : "Pecky" ,
"token_symbol" : "PECKY" ,
"decimals" : "9" ,
"logo_url" : "https://assetlogo.expand.network/ethereum/PECKY.png" ,
"availableDex" : {
"uniswapV2" : [
"0x8e07824021b06956f7bfb224bd3b11fb7c38c57b"
]
}
}
]
}
}
/getpools
Returns a list of all the quotes for a pool on different DEXs.
GET
https://api.expand.network/dex/getpools
Query Parameters
Comma-separated values of Dex Id. Refer to the DEX ID page for details.
Comma-separated values of token pair.
Sample Request Sample Response
Copy https://api.expand.network/dex/getpools?dexId=1500,1400,1300&path=0x6b175474e89094c44da98b954eedeac495271d0f,0xdac17f958d2ee523a2206206994597c13d831ec7&amountIn=100000000000000000
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : [
{
"dexId" : "1300" ,
"value" : "99431"
} ,
{
"dexId" : "1400" ,
"value" : "130999"
} ,
{
"dexId" : "1500" ,
"value" : "99977"
}
]
}
/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
Comma-separated values of token pair.
Comma-separated values of dexes to exclude.
Different pool based on the fees. By default, it is selected as 3000.
Sample Request Sample Response
Copy https://api.expand.network/dex/quoteaggregator?path=0xdac17f958d2ee523a2206206994597c13d831ec7%2C0x6B175474E89094C44Da98b954EedeAC495271d0F&amountIn=1000000&chainId=1&excludedDexes=1000,1100,1400
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : [
{
"dexName" : "0x" ,
"dexId" : "1600" ,
"amountIn" : "1000000" ,
"path" : [
"0xdac17f958d2ee523a2206206994597c13d831ec7" ,
"0x6B175474E89094C44Da98b954EedeAC495271d0F"
] ,
"amountsOut" : [
"1000000" ,
"1002502103426469968"
]
} ,
{
"dexName" : "SushiswapV2" ,
"dexId" : "1100" ,
"amountIn" : "1000000" ,
"path" : [
"0xdac17f958d2ee523a2206206994597c13d831ec7" ,
"0x6B175474E89094C44Da98b954EedeAC495271d0F"
] ,
"amountsOut" : [
"1000000" ,
"1002189910250308204"
]
} ,
{
"dexName" : "Kyberswap" ,
"dexId" : "2200" ,
"amountIn" : "1000000" ,
"path" : [
"0xdac17f958d2ee523a2206206994597c13d831ec7" ,
"0x6B175474E89094C44Da98b954EedeAC495271d0F"
] ,
"amountsOut" : [
"1000000" ,
"1002189910250308204"
]
} ,
{
"dexName" : "CurveV2" ,
"dexId" : "1500" ,
"amountIn" : "1000000" ,
"path" : [
"0xdac17f958d2ee523a2206206994597c13d831ec7" ,
"0x6B175474E89094C44Da98b954EedeAC495271d0F"
] ,
"amountsOut" : [
"1000000" ,
"1000399509916717049"
]
} ,
{
"dexName" : "BalancerV2" ,
"dexId" : "1400" ,
"amountIn" : "1000000" ,
"path" : [
"0xdac17f958d2ee523a2206206994597c13d831ec7" ,
"0x6B175474E89094C44Da98b954EedeAC495271d0F"
] ,
"amountsOut" : [
"1000000" ,
"1000363941967920384"
]
} ,
{
"dexName" : "UniswapV3" ,
"dexId" : "1300" ,
"amountIn" : "1000000" ,
"path" : [
"0xdac17f958d2ee523a2206206994597c13d831ec7" ,
"0x6B175474E89094C44Da98b954EedeAC495271d0F"
] ,
"amountsOut" : [
"1000000" ,
"999896502154908225"
]
} ,
{
"dexName" : "UniswapV2" ,
"dexId" : "1000" ,
"amountIn" : "1000000" ,
"path" : [
"0xdac17f958d2ee523a2206206994597c13d831ec7" ,
"0x6B175474E89094C44Da98b954EedeAC495271d0F"
] ,
"amountsOut" : [
"1000000" ,
"996499217880095575"
]
}
]
}
/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
Public address of the user.
Sample Request Sample Response
Copy https://historicallp.api.expand.network/dex/getwalletposition?address=0x28A5eC068ae7500cbf21B989D62C7a81e2665B18
Copy {
"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
}
]
}
}
]
}
/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
Comma-separated values of token pair.
Address of the sender of the token.
Maximum gas limit provided by the sender, for the transaction.
Address of the recipient of the token.
Different pool based on the fees.
By default, it is selected as 3000.
Comma-separated values of dexes to exclude.
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.
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.
Sample Request Sample Response
Copy {
"path" : [
"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" ,
"0x6B175474E89094C44Da98b954EedeAC495271d0F"
] ,
"amountIn" : "1000000" ,
"gas" : "800000" ,
"from" : "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402" ,
"to" : "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402" ,
"cheapestSwap" : true ,
"bestSwap" : true ,
"chainId" : "1"
}
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : [
{
"dexName" : "UniswapV2" ,
"amountsOut" : "3696603530" ,
"from" : "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402" ,
"to" : "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D" ,
"value" : "1000000" ,
"gas" : "800000" ,
"data": "0x7ff36ab500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dae2f6eddda6fb4fb60cc02633de27e2b431b40200000000000000000000000000000000000000000000000000000193817718420000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f",
"estimationCheck" : "Returned error: insufficient funds for gas * price + value: address 0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402 have 17695120464000 want 136837418655888595" ,
"referenceId" : "01dac9c06f08417e826b42e28a403d50"
} ,
{
"dexName" : "SushiswapV2" ,
"amountsOut" : "3693198033" ,
"from" : "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402" ,
"to" : "0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F" ,
"value" : "1000000" ,
"gas" : "800000" ,
"data": "0x7ff36ab500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dae2f6eddda6fb4fb60cc02633de27e2b431b40200000000000000000000000000000000000000000000000000000193817718420000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f",
"estimationCheck" : "Returned error: insufficient funds for gas * price + value: address 0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402 have 17695120464000 want 136837418655888595" ,
"referenceId" : "01dac9c06f08417e826b42e28a403d50"
} ,
{
"dexName" : "UniswapV3" ,
"amountsOut" : "3696374718" ,
"from" : "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402" ,
"to" : "0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45" ,
"value" : "1000000" ,
"gas" : "800000" ,
"data": "0xac9650d8000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000e404e45aaf000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000000000000000000000000000000000000000000bb8000000000000000000000000dae2f6eddda6fb4fb60cc02633de27e2b431b40200000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000412210e8a00000000000000000000000000000000000000000000000000000000",
"estimationCheck" : "Returned error: insufficient funds for gas * price + value: address 0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402 have 17695120464000 want 136837418655888595" ,
"referenceId" : "01dac9c06f08417e826b42e28a403d50"
} ,
{
"dexName" : "0x" ,
"amountsOut" : "3695949530" ,
"chainId" : "1" ,
"from" : "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402" ,
"to" : "0x70bf6634ee8cb27d04478f184b9b8bb13e5f4710" ,
"value" : "1000000" ,
"gas" : "800000" ,
"data": "0x1fff991f000000000000000000000000dae2f6eddda6fb4fb60cc02633de27e2b431b4020000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000000000da29e44400000000000000000000000000000000000000000000000000000000000000a049f45b98764cc9c837ea3898a1a07800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000380000000000000000000000000000000000000000000000000000000000000010438c9c147000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000000000000002710000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000024d0e30db00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a4d92aadfb00000000000000000000000070bf6634ee8cb27d04478f184b9b8bb13e5f47100000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000000000dcb2edbfd08400449e9d945c57f1a4d289fba1d97785d27b93b45020f6886192880ae61300000000000000000000000000000000000000000000000000000000674c263b000000000000000000000000b02f39e382c90160eb816de5e0e428ac771d77b50000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000000411b64c63d6976390e6613f9da98022a6e01a9d4f499060dacefb87225e98132c1c6778cd65649acc761390e0d6a32870eef601a9fcf751b7e65b4af84ea90c3f7270000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012438c9c1470000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000000000000000000000000000000000000000000f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000ad01c20d5886137e056775af56915de824c8fce500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"estimationCheck" : "Returned error: insufficient funds for gas * price + value: address 0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402 have 17695120464000 want 136837418655888595" ,
"referenceId" : "01dac9c06f08417e826b42e28a403d50"
} ,
{
"dexName" : "Kyberswap" ,
"amountsOut" : "3696603530" ,
"from" : "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402" ,
"to" : "0x6131B5fae19EA4f9D964eAc0408E4408b66337b5" ,
"value" : "1000000" ,
"gas" : "800000" ,
"data": "0xe21fd0e90000000000000000000000000000000000000000000000000000000000000020000000000000000000000000f081470f5c6fbccf48cc4e5b82dd926409dcdd67000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000000000000000000000000068000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000dae2f6eddda6fb4fb60cc02633de27e2b431b40200000000000000000000000000000000000000000000000000000000674c2aaa0000000000000000000000000000000000000000000000000000000000000360000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000040989238340000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000aaaaaaaaa24eeeb8d57d431224f73832bc34f68800000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007fc66500c84a76ad7e9c93437bfc5ac33e2ddae900000000000000000000000000000000000000000000000000000000000001a4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400e00deaa0000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000800000000000000000000000007a7d6209d5950bb3b5b3a7724eeb48df8e8a1a630000000000000000000000007fc66500c84a76ad7e9c93437bfc5ac33e2ddae90000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000000000017ca44e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000003a8e0000000000000000000000037d82cb19000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000dae2f6eddda6fb4fb60cc02633de27e2b431b40200000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002137b22536f75726365223a22657870616e64222c22416d6f756e74496e555344223a22302e30303030303030303337303935333233323336383531222c22416d6f756e744f7574555344223a2230222c22526566657272616c223a22222c22466c616773223a302c22416d6f756e744f7574223a2230222c2254696d657374616d70223a313733333034333730362c22496e74656772697479496e666f223a7b224b65794944223a2231222c225369676e6174757265223a2243756e47794b4155314c357567746a53554563565a68674d38505a41534b634d444b5732346a367635337a425a585852497570492b4d7432685165704e7574704e4965716a532f6e716d4a384c2b697979373278497556563671582f71354550534b79324a7a716f4630765a444d3551484664473332302b5571784b4c5132734e79686e62756f4d685a76715a4c7932546e6f315474584238325771456739417a57516b33463875434d57776c716b717a75463869366a4a6a34666d62427455354c6a5533694d592f7077527a477a68523738736368414e59697569544a316d64753177413158373676334839427a52726c4e4131666747316a67474459314b596857785576386e376e3437632f6e6d3064532b5042466773394338336675377956765368696f5445574e52694b6a64613039334e577846305741436d396246784b7062564f377145304e55335968306432366372773d3d227d7d00000000000000000000000000",
"estimationCheck" : "Returned error: insufficient funds for gas * price + value: address 0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402 have 17695120464000 want 136837418655888595" ,
"referenceId" : "01dac9c06f08417e826b42e28a403d50"
}
]
}
Sample Request Sample Response
With gasPriority:
Copy {
"path" : [
"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" ,
"0x6B175474E89094C44Da98b954EedeAC495271d0F"
] ,
"amountIn" : "1000000" ,
"gas" : "800000" ,
"from" : "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402" ,
"to" : "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402" ,
"cheapestSwap" : true ,
"bestSwap" : true ,
"chainId" : "1" ,
"gasPriority" : "medium"
}
With gasPriority:
Copy {
"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"
}
]
}
/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
Uniswap V2, Uniswap V3 and SushiSwap V2.
Liquidity of Pools greater than or equals to
Liquidity of Pools less than or equals to
Volume of Pools greater than or equals to
Volume of Pools less than or equals to
Market cap of Pools greater than or equals to
Market cap of Pools less than or equals to
Makers of Pools greater than or equals to
Makers of Pools less than or equals to
Transactions of Pools greater than or equals to
Transactions of Pools less than or equals to
FDV of Pools greater than or equals to
FDV of Pools less than or equals to
PairAge of Pools greater than or equals to
PairAge of Pools less than or equals to
Sample Request Sample Response
Copy https://historicallp.api.expand.network/dex/screen
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : [
{
"dex" : "sushiswapV2" ,
"chain" : "1" ,
"poolAddress" : "0xfb3cd0b8a5371fe93ef92e3988d30df7931e2820" ,
"pool" : "WETH/INJ" ,
"txns" : {
"m15" : {
"sells" : 0 ,
"buys" : 0
} ,
"m5" : {
"sells" : 0 ,
"buys" : 0
} ,
"h1" : {
"sells" : 0 ,
"buys" : 1
} ,
"h24" : {
"sells" : 37 ,
"buys" : 44
} ,
"m30" : {
"sells" : 0 ,
"buys" : 1
} ,
"h4" : {
"sells" : 2 ,
"buys" : 5
} ,
"h6" : {
"sells" : 3 ,
"buys" : 6
}
} ,
"makers" : {
"m15" : 0 ,
"m5" : 0 ,
"h1" : 1 ,
"h24" : 32 ,
"m30" : 0 ,
"h4" : 1 ,
"h6" : 6
} ,
"buyers" : {
"m15" : 0 ,
"m5" : 0 ,
"h1" : 1 ,
"h24" : 21 ,
"m30" : 1 ,
"h4" : 5 ,
"h6" : 6
} ,
"sellers" : {
"m15" : 0 ,
"m5" : 0 ,
"h1" : 0 ,
"h24" : 15 ,
"m30" : 0 ,
"h4" : 1 ,
"h6" : 1
} ,
"volume" : {
"m15" : {
"sell_vol" : "0.00" ,
"buy_vol" : "0.00"
} ,
"m5" : {
"sell_vol" : "0.00" ,
"buy_vol" : "0.00"
} ,
"h1" : {
"sell_vol" : "0.00" ,
"buy_vol" : "29.10"
} ,
"h24" : {
"sell_vol" : "11.91" ,
"buy_vol" : "1610.16"
} ,
"m30" : {
"sell_vol" : "0.00" ,
"buy_vol" : "29.10"
} ,
"h4" : {
"sell_vol" : "0.55" ,
"buy_vol" : "50.73"
} ,
"h6" : {
"sell_vol" : "0.72" ,
"buy_vol" : "94.88"
}
} ,
"avg_buy_size" : "36.594545454545454" ,
"avg_sell_size" : "0.3218918918918919" ,
"pair_age" : "1608184117" ,
"liquidity" : {
"INJ" : "16593.04" ,
"WETH" : "109.68"
} ,
"poolLiquidity" : "808559948466546211397" ,
"price" : "149.4748031907699" ,
"marketCap" : "2847630.82" ,
"holders" : "null" ,
"fdv" : "2847630.82"
}
........and many more
]
}
/swapwithapproval
Returns the approve and swap transaction on a DEX supported by Expand.
POST
https://api.expand.network/dex/swapwithapproval
Request Body
Comma-separated values of token pair.
Address of the sender of the token.
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
Sample Request Sample Response
Copy {
"dexId" : "1000" ,
"amountIn" : "1000000000000000" ,
"amountOutMin" : "0" ,
"path" : [ "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" , "0x6B175474E89094C44Da98b954EedeAC495271d0F" ] ,
"to" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"deadline" : "1665990894" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"gas" : "173376"
}
Copy {
"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"
}
]
}
/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
Refer to the DexID page for details.
Range of tick from 0 to 10. By default 10
Sample Request Sample Response
Copy https://historicallp.api.expand.network/dex/getliquiditybytick?dexId=1300&poolAddress=0xCBCdF9626bC03E24f779434178A73a0B4bad62eD&tickRange=10
Copy {
"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"
}
]
}
/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
GET
https://api.expand.network/dex/getusertokenids
Request Body
Refer to the DexID page for details.
Sample Request Sample Response
Copy https://api.expand.network/dex/getusertokenids?dexId=1300&address=0xF802993d29eA093E062658C1B5EC2727DE8a3247
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"tokens" : [
{
"tokenId" : "818396" ,
"liquidity" : "42704482896171366122"
}
]
}
}
Following is a sequence diagram for swap() process:-
Following is a sequence diagram for addLiquidity() process:-
Following is a sequence diagram for removeLiquidity() process:-