Uniswap V2
/getprice
Returns the swap quotation for the given token pair.
GET
https://api.expand.network/dex/getprice
Query Parameters
Name | Type | Description |
---|---|---|
rpc | String | Remote procedural call URL. |
dexId | String | Refer to the DEX ID page for details. |
path* | String | Comma separated values of token addresses whose price is to be fetched. |
amountIn* | String | Amount of token. |
/getuserliquidity
Returns the balance of a particular token pair of an account.
GET
https://api.expand.network/dex/getuserliquidity
Query Parameters
Name | Type | Description |
---|---|---|
rpc | String | Remote procedural call URL. |
tokenA* | String | Address of token. |
address* | String | Public address of liquidity provider. |
dexId | String | Refer to DEX ID page for details. |
tokenB* | String | Address of token. |
/getpoolliquidity
Returns the total liquidity for a specified pool.
GET
https://api.expand.network/dex/getpoolliquidity
Query Parameters
Name | Type | Description |
---|---|---|
rpc | String | Remote procedural call URL. |
poolAddress* | String | Pool address whose liquidity is to be fetched. |
dexId | String | Refer to DEX ID page for details. |
/gettokenliquidity
Returns the individual token liquidity within the specified liquidity pool.
GET
https://api.expand.network/dex/gettokenliquidity
Query Parameters
Name | Type | Description |
---|---|---|
rpc | String | Remote procedural call URL. |
poolAddress* | String | The pool address. |
dexId | String | Refer to DEX ID page for details. |
/getliquidityholders
Returns the total number of liquidity holders in the specified pool.
GET
https://api.expand.network/dex/getliquidityholders
Query Parameters
Name | Type | Description |
---|---|---|
rpc | String | Remote procedural call URL. |
poolAddress* | String | The pool address. |
dexId | String | Refer to DEX ID page for details. |
/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
Name | Type | Description |
---|---|---|
rpc | String | Remote procedural call URL. |
address* | String | The public address of the liquidity holder. |
dexId | String | Refer to DEX ID page for details. |
poolAddresses | String | The pool Addresses whose liquidity is to be fetched. (Comma-separated vaules) |
poolSize | String | The number of pools for which the user intends to fetch the individual position. By default: 50, Maximum: 9,950 |
/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
Name | Type | Description |
---|---|---|
rpc | String | Remote procedural call URL. |
poolAddress* | String | The pool address. |
dexId | String | Refer to DEX ID page for details. |
endPage | String | Index of the last page that user wants to query. By default: startPage+9 |
startPage | String | Index of the start page that user wants to query. By default: endPage-9 |
/gethistoricaltimeseries
Get the historical time series transactions for a specific pool address.
GET
https://historicaltrade.api.expand.network/dex/gethistoricaltimeseries
Query Parameters
Name | Type | Description |
---|---|---|
dexId* | String | Refer to DEX ID page for details. |
endBlock | String | Last block of the range. |
startBlock | String | Starting block of the range. |
poolAddress* | String | Pool address whose time series is to be fetched. |
/gethistoricaltransactions
Get the historical transactions focusing on swaps associated with a specific pool address.
GET
https://historicaltrade.api.expand.network/dex/gethistoricaltransactions
Query Parameters
Name | Type | Description |
---|---|---|
dexId* | String | Refer to DEX ID page for details. |
endBlock | String | Last block of the range. |
startBlock | String | Starting block of the range. |
poolAddress* | String | Pool address whose transactions is to be fetched. |
/gethistoricalpoolchartdata
Get the data the OHCLV (Open, High, Close, Low, and Volume) within the specified time interval for pool on Uniswap V2.
GET
https://api.expand.network/dex/gethistoricalpoolchartdata
Query Parameter
Name | Type | Description |
---|---|---|
dexId* | String | Refer to DEX ID page for details. |
interval | String | 15 mins(by default), 30 mins, 60 mins, and 90 mins. |
limit | String | No of iteration. Start limit is 100 and maximum limit is 500. |
poolAddress* | String | Pool address whose transactions is to be fetched. |
rpc | String | Remote procedural call URL. |
/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
Name | Type | Description |
---|---|---|
dexId* | String | Refer to DEX ID page for details. |
interval | String | 15 mins(by default), 30 mins, 60 mins, and 90 mins. |
poolAddress* | String | Pool address whose transactions is to be fetched. |
/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
Name | Type | Description |
---|---|---|
dexId* | String | Refer to DEX ID page for details. |
endBlock | String | Last block of the range. |
startBlock | String | Starting block of the range. |
poolAddress* | String | Pool address whose data is to be fetched. |
eventType | String | Transfer, Swap, Burn or Mint(by default). |
/swap
Initiate a swap transaction on a specified DEX.
POST
https://api.expand.network/dex/swap
Request Body
Name | Type | Description |
---|---|---|
dexId | String | Refer to the DEX ID page for details. |
path* | Array | Comma-separated values of token addresses, inside an array, to swap. |
amountIn* | String | Amount of token to be swapped. |
amountOutmin* | String | Minimum amount accepted as the result of swap. |
to* | String | Address of the recipient of the token. |
deadline* | String | Deadline for the transaction to be executed (UNIX Timestamp). |
from* | String | Address of the sender of the token. |
gas* | String | Maximum gas limit provided by the sender, for the transaction. |
rpc | String | Remote procedural call URL. |
involveBaseToken | String | If a base token is involved in the swap;
By default, |
gasPriority | String | low, medium, or high. |
slippage | String | Percentage of total swap value. By default, 1. 0 <= slippage value <= 100 |
With gasPriority:
With Slippage:
/addliquidity
Add liquidity to a specified pool in a specified DEX.
POST
https://api.expand.network/dex/addliquidity
Request Body
Name | Type | Description |
---|---|---|
dexId | String | Refer to the DEX ID page for details. |
tokenA* | String | Address of the first token being added. |
tokenB* | String | Address of the second token being added. |
amountADesired* | String | Desired amount of token A. |
amountBDesired* | String | Desired amount of token B. |
amountAMin* | String | Minimum amount of token A. |
amountBMin* | String | Minimum amount of token B. |
deadline* | String | Deadline for the transaction to be executed (UNIX Timestamp). |
to* | String | Address of the recipient of the token. |
from* | String | Address of the sender of the token. |
gas* | 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 <= 100 |
With gasPriority:
With Slippage:
/removeliquidity
Remove liquidity from a specified pool for a specified DEX.
POST
https://api.expand.network/dex/removeliquidity
Request Body
Name | Type | Description |
---|---|---|
dexId | String | Refer to the DEX ID page for details. |
tokenA* | String | Address of the first token being removed. |
tokenB* | String | Address of the second token being removed. |
liquidity* | String | Total amount of liquidity to be removed from the given pool. |
amountAMin* | String | Minimum amount of Token A. |
amountBMin* | String | Minimum amount of Token B. |
deadline* | String | Deadline for the transaction to be executed (UNIX Timestamp). |
to* | String | Address of the recipient of the token. |
from* | String | Address of the sender of the token. |
gas* | 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 <= 100 |
With gasPriority:
With slippage:
Last updated