/getprice
Returns the swap quotation for the given token pairs.
GET
https://api.expand.network/dex/getprice
Query Parameters
Remote procedural call URL.
Refer to the DEX ID page for details.
Comma separated values of token addresses whose price is to be fetched.
Sample Request Sample Response
Copy https://api.expand.network/dex/getprice?dexId=1000&path=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2,0xdac17f958d2ee523a2206206994597c13d831ec7&amountIn=10000000000000000000
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"amountIn" : "10000000000000000000" ,
"path" : [
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" ,
"0xdac17f958d2ee523a2206206994597c13d831ec7"
] ,
"amountsOut" : [
"10000000000000000000" ,
"15682130807"
]
}
}
/getuserliquidity
Returns the balance of a particular token pair of an account.
GET
https://api.expand.network/dex/getuserliquidity
Query Parameters
Remote procedural call URL.
Public address of liquidity provider.
Refer to DEX ID page for details.
Sample Request Sample Response
Copy https://api.expand.network/dex/getuserliquidity?tokenA=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2&tokenB=0x6b175474e89094c44da98b954eedeac495271d0f&address=0x6fb447ae94f5180254d436a693907a1f57696900&dexId=1000
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"pairAddress" : "0xA478c2975Ab1Ea89e8196811F51A7B7Ade33eB11" ,
"liquidity" : "2087379027763486" ,
"tokenA" : "91297717639957" ,
"tokenB" : "153006474077467970"
}
}
/getpoolliquidity
Returns the total liquidity for a specified pool.
GET
https://api.expand.network/dex/getpoolliquidity
Query Parameters
Remote procedural call URL.
Pool address whose liquidity is to be fetched.
Refer to DEX ID page for details.
Sample Request Sample Response
Copy https://api.expand.network/dex/getpoolliquidity?poolAddress=0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852&dexId=1000
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"totalLiquidity" : "312219425553389289"
}
}
/gettokenliquidity
Returns the individual token liquidity within the specified liquidity pool.
GET
https://api.expand.network/dex/gettokenliquidity
Query Parameters
Remote procedural call URL.
Refer to DEX ID page for details.
Sample Request Sample Response
Copy https://api.expand.network/dex/gettokenliquidity?poolAddress=0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852&dexId=1000
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"WETH" : "16984981267096993883931" ,
"USDT" : "31586831096555"
}
}
/getliquidityholders
Returns the total number of liquidity holders in the specified pool.
GET
https://api.expand.network/dex/getliquidityholders
Query Parameters
Remote procedural call URL.
Refer to DEX ID page for details.
Sample Request Sample Response
Copy https://api.expand.network/dex/getliquidityholders?poolAddress=0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852&dexId=1000
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"totalTokenHolders" : "2572"
}
}
/getindividualposition
Returns the liquidity position for a specified user address across all the pools for the DEX.
GET
https://api.expand.network/dex/getindividualposition
Query Parameters
Remote procedural call URL.
The public address of the liquidity holder.
Refer to DEX ID page for details.
The pool Addresses whose liquidity is to be fetched. (Comma-separated vaules)
The number of pools for which the user intends to fetch the individual position.
By default: 50, Maximum: 9,950
Sample Request Sample Response
Copy https://api.expand.network/dex/getindividualposition?dexId=1000&address=0x6Fb447Ae94F5180254D436A693907a1f57696900
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"aggregatedLiquidity" : "2370404879481514" ,
"poolAddresses" : {
"DAIWETH" : {
"0xA478c2975Ab1Ea89e8196811F51A7B7Ade33eB11" : "2370404879481514"
}
}
}
}
/getpoolindividualliquidity
Returns all user addresses, block numbers, and token position details for a specified pool address.
GET
https://historicallp.api.expand.network/dex/getpoolindividualliquidity
Query Parameters
Remote procedural call URL.
Refer to DEX ID page for details.
Index of the last page that user wants to query.
By default: startPage+9
Index of the start page that user wants to query.
By default: endPage-9
Sample Request Sample Response
Copy https://historicallp.api.expand.network/dex/getpoolindividualliquidity?startPage=211&endPage=212&poolAddress=0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852&dexId=1000
Copy {
"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"
}
}
]
}
]
}
}
/gethistoricaltimeseries
Get the historical time series transactions for a specific pool address.
GET
https://historicaltrade.api.expand.network/dex/gethistoricaltimeseries
Query Parameters
Refer to DEX ID page for details.
Starting block of the range.
Pool address whose time series is to be fetched.
Sample Request Sample Response
Copy https://historicaltrade.api.expand.network/dex/gethistoricaltimeseries?poolAddress=0x517f9dd285e75b599234f7221227339478d0fcc8&dexId=1000
Copy {
"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"
}
]
}
}
/gethistoricaltransactions
Get the historical transactions focusing on swaps associated with a specific pool address.
GET
https://historicaltrade.api.expand.network/dex/gethistoricaltransactions
Query Parameters
Refer to DEX ID page for details.
Starting block of the range.
Pool address whose transactions is to be fetched.
Sample Request Sample Response
Copy https://historicaltrade.api.expand.network/dex/gethistoricaltransactions?poolAddress=0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc&dexId=1000
Copy {
"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"
}
}
]
}
}
/getpoolchartdata
Get the data for the pool and obtain the OHCL (Open, High, Close, Low) prices within the specified time interval.
GET
https://historicaltrade.api.expand.network/dex/getpoolchartdata
Query Parameters
Refer to DEX ID page for details.
15 mins(by default), 30 mins, 60 mins, and 90 mins.
Pool address whose transactions is to be fetched.
Sample Request Sample Response
Copy https://historicaltrade.api.expand.network/dex/getpoolchartdata?dexId=1000&poolAddress=0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc&interval=60
Copy {
"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"
}
}
]
}
]
}
}
}
/getpooltradedata
Get the trade data from the pool within a specified block range, for the specified event type
GET
https://historicaltrade.api.expand.network/dex/getpooltradedata
Query Parameters
Refer to DEX ID page for details.
Starting block of the range.
Pool address whose data is to be fetched.
Transfer, Swap, Burn or Mint(by default).
Sample Request Sample Response
Copy https://historicaltrade.api.expand.network/dex/getpooltradedata?poolAddress=0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc&dexId=1000&eventType=Burn
Copy {
"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"
]
}
}
]
}
}
/swap
Initiate a swap transaction on a specified DEX.
POST
https://api.expand.network/dex/swap
Request Body
Refer to the DEX ID page for details.
Comma-separated values of token addresses, inside an array, to swap.
Amount of token to be swapped.
Minimum amount accepted as the result of swap.
Address of the recipient of the token.
Deadline for the transaction to be executed (UNIX Timestamp).
Address of the sender of the token.
Maximum gas limit provided by the sender, for the transaction.
Remote procedural call URL.
If a base token is involved in the swap;
0
for erc20 -> erc20,
1
for base -> erc20 ("from" address should be of equivalent wrapped token),
2
for erc20 -> base ("to" address should be of equivalent wrapped token).
By default, 0
.
Percentage of total swap value.
By default, 1.
0 <= slippage value <= 10
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" : "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D" ,
"value" : "0" ,
"gas" : "173376" ,
"data": "0x38ed173900000000000000000000000000000000000000000000000000038d7ea4c68000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000063056e00436da25bcf48a40dfbbdcc708935100600000000000000000000000000000000000000000000000000000000634d00ee0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000b4fbf271143f4fbf7b91a5ded31805e42b2208d600000000000000000000000011fe4b6ae13d2a6055c8d9cf65c55bac32b5d844"
}
}
Sample Request Sample Response
With gasPriority:
Copy {
"dexId" : "1000" ,
"amountIn" : "10000000000" ,
"amountOutMin" : "0" ,
"path" : [
"0x6B175474E89094C44Da98b954EedeAC495271d0F" ,
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
] ,
"to" : "0x356dB816602c85e2075774bB77D13995c8Bab023" ,
"deadline" : "1765990894" ,
"from" : "0x356dB816602c85e2075774bB77D13995c8Bab023" ,
"gas" : "273376" ,
"gasPriority" : "high"
}
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x356dB816602c85e2075774bB77D13995c8Bab023" ,
"to" : "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D" ,
"value" : "0" ,
"gas" : "187586" ,
"data": "0x38ed173900000000000000000000000000000000000000000000000000000002540be400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000356db816602c85e2075774bb77d13995c8bab023000000000000000000000000000000000000000000000000000000006942e1ee00000000000000000000000000000000000000000000000000000000000000020000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
}
}
Sample Request Sample Response
With Slippage:
Copy {
"dexId" : "1000" ,
"amountIn" : "10000000000000" ,
"amountOutMin" : "0" ,
"path" : [
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"0x6B175474E89094C44Da98b954EedeAC495271d0F"
] ,
"to" : "0x22cf65ae3fa16d6379e72f4b4c2401c1b7c69731" ,
"deadline" : "1701931771" ,
"from" : "0x22cf65ae3fa16d6379e72f4b4c2401c1b7c69731" ,
"gas" : "173376" ,
"gasPriority" : "low" ,
"slippage" : "10"
}
With Slippage:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x22cf65ae3fa16d6379e72f4b4c2401c1b7c69731" ,
"to" : "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D" ,
"value" : "0" ,
"gas" : "173376" ,
"data": "0x38ed1739000000000000000000000000000000000000000000000000000009184e72a00000000000000000000000000000000000000000000000000000486999ef3cec9000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000022cf65ae3fa16d6379e72f4b4c2401c1b7c697310000000000000000000000000000000000000000000000000000000065716afb0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f"
}
}
/addliquidity
Add liquidity to a specified pool in a specified DEX.
POST
https://api.expand.network/dex/addliquidity
Request Body
Refer to the DEX ID page for details.
Address of the first token being added.
Address of the second token being added.
Desired amount of token A.
Desired amount of token B.
Minimum amount of token A.
Minimum amount of token B.
Deadline for the transaction to be executed (UNIX Timestamp).
Address of the recipient of the token.
Address of the sender of the token.
Maximum gas limit provided by the sender, for the transaction.
Remote procedural call URL.
Percentage of total value.
By default, 1.
0 <= slippage value <= 10
Sample Request Sample Response
Copy {
"dexId" : "1000" ,
"tokenA" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"tokenB" : "0x6B175474E89094C44Da98b954EedeAC495271d0F" ,
"amountADesired" : "1000000000000000" ,
"amountBDesired" : "1332066335118442626" ,
"amountAMin" : "0" ,
"amountBMin" : "0" ,
"to" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"deadline" : "166978170" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"gas" : "230000"
}
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"to" : "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D" ,
"value" : "0" ,
"gas" : "230000" ,
"data": "0xe8e33700000000000000000000000000b4fbf271143f4fbf7b91a5ded31805e42b2208d600000000000000000000000011fe4b6ae13d2a6055c8d9cf65c55bac32b5d84400000000000000000000000000000000000000000000000000038d7ea4c68000000000000000000000000000000000000000000000000000127c734631fdc0820000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000063056e00436da25bcf48a40dfbbdcc70893510060000000000000000000000000000000000000000000000000000000009f3e27a"
}
}
Sample Request Sample Response
With gasPriority:
Copy {
"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"
}
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x356dB816602c85e2075774bB77D13995c8Bab023" ,
"to" : "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D" ,
"value" : "0" ,
"gas" : "201790" ,
"data": "0xe8e33700000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000038b6d3ad182a500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000356db816602c85e2075774bb77d13995c8bab0230000000000000000000000000000000000000000000000000000018bcddc8769"
}
}
Sample Request Sample Response
With Slippage:
Copy {
"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"
}
With Slippage:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x22cf65Ae3fa16d6379E72F4B4c2401c1B7C69731" ,
"to" : "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D" ,
"value" : "0" ,
"gas" : "230000" ,
"data": "0xe8e33700000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000246b8153f8d8c000000000000000000000000000000000000000000000000000000000000005f000000000000000000000000000000000000000000000000000000000000005f00000000000000000000000022cf65ae3fa16d6379e72f4b4c2401c1b7c697310000000000000000000000000000000000000000000000000000018e9c17ab61"
}
}
/removeliquidity
Remove liquidity from a specified pool for a specified DEX.
POST
https://api.expand.network/dex/removeliquidity
Request Body
Refer to the DEX ID page for details.
Address of the first token being removed.
Address of the second token being removed.
Total amount of liquidity to be removed from the given pool.
Minimum amount of Token A.
Minimum amount of Token B.
Deadline for the transaction to be executed (UNIX Timestamp).
Address of the recipient of the token.
Address of the sender of the token.
Maximum gas limit provided by the sender, for the transaction.
Remote procedural call URL.
Percentage of total value. By default, 1. 0 <= slippage value <= 10
Sample Request Sample Response
Copy {
"dexId" : "1000" ,
"tokenA" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"tokenB" : "0x6B175474E89094C44Da98b954EedeAC495271d0F" ,
"liquidity" : "20759430672661383" ,
"amountAMin" : "0" ,
"amountBMin" : "0" ,
"to" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"deadline" : "1669720626" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"gas" : "420000"
}
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"to" : "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D" ,
"value" : "0" ,
"gas" : "420000" ,
"data": "0xbaa2abde000000000000000000000000b4fbf271143f4fbf7b91a5ded31805e42b2208d600000000000000000000000011fe4b6ae13d2a6055c8d9cf65c55bac32b5d8440000000000000000000000000000000000000000000000000049c0979afbbb870000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000063056e00436da25bcf48a40dfbbdcc7089351006000000000000000000000000000000000000000000000000000000006385ea32"
}
}
Sample Request Sample Response
With gasPriority:
Copy {
"dexId" : "1000" ,
"tokenA" : "0x6B175474E89094C44Da98b954EedeAC495271d0F" ,
"tokenB" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"amountAMin" : "0" ,
"amountBMin" : "0" ,
"from" : "0x356dB816602c85e2075774bB77D13995c8Bab023" ,
"to" : "0x356dB816602c85e2075774bB77D13995c8Bab023" ,
"deadline" : "1700033844291" ,
"liquidity" : "65051302687488" ,
"gas" : "123444" ,
"gasPriority" : "medium"
}
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x356dB816602c85e2075774bB77D13995c8Bab023" ,
"to" : "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D" ,
"value" : "0" ,
"gas" : "200648" ,
"data": "0xbaa2abde0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000003b29efc9f30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000356db816602c85e2075774bb77d13995c8bab0230000000000000000000000000000000000000000000000000000018bd1e9d443"
}
}
Sample Request Sample Response
With slippage:
Copy {
"dexId" : "1000" ,
"tokenA" : "0x6B175474E89094C44Da98b954EedeAC495271d0F" ,
"tokenB" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"liquidity" : "3834508059710445" ,
"amountAMin" : "100" ,
"amountBMin" : "100" ,
"to" : "0x4970798F8E5a77598CA4Da778eb6D12303AEefc9" ,
"deadline" : "1669720626" ,
"from" : "0x4970798F8E5a77598CA4Da778eb6D12303AEefc9" ,
"gas" : "420000" ,
"slippage" : "5.01"
}
With slippage:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x4970798F8E5a77598CA4Da778eb6D12303AEefc9" ,
"to" : "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D" ,
"value" : "0" ,
"gas" : "420000" ,
"data": "0xbaa2abde0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000d9f76fac993ed000000000000000000000000000000000000000000000000000000000000005f000000000000000000000000000000000000000000000000000000000000005f0000000000000000000000004970798f8e5a77598ca4da778eb6d12303aeefc9000000000000000000000000000000000000000000000000000000006385ea32"
}
}
Last updated 8 months ago