Balancer v2
Below is the list of tokens we currently support for the mentioned endpoints. We are happy to add support for additional tokens upon request.
/getprice
Returns the swap quotation for the given token pairs.
GET
https://api.expand.network/dex/getprice
Query Parameters
rpc
String
Remote procedural call URL.
path*
String
Comma separated values of token addresses whose price is to be fetched.
amountIn*
String
Amount of token.
https://api.expand.network/dex/getprice?dexId=1400&path=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2,0x6B175474E89094C44Da98b954EedeAC495271d0F&amountIn=10000000000000000000
/getuserliquidity
Returns the balance of a particular token pair of an account.
GET
https://api.expand.network/dex/getuserliquidity
Query Parameters
rpc
String
Remote procedural call URL.
tokenA*
String
Address of token.
address*
String
Public address of liquidity provider.
tokenB*
String
Address of token.
tokenC
String
Address of token.
https://api.expand.network/dex/getuserliquidity?tokenA=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2&tokenB=0x6b175474e89094c44da98b954eedeac495271d0f&address=0x6fb447ae94f5180254d436a693907a1f57696900&dexId=1400
/getpoolliquidity
Returns the total liquidity for a specified pool.
GET
https://api.expand.network/dex/getpoolliquidity
Query Parameters
rpc
String
Remote procedural call URL.
poolAddress*
String
Pool address whose liquidity is to be fetched.
https://api.expand.network/dex/getpoolliquidity?dexId=1400&poolAddress=0x25Accb7943Fd73Dda5E23bA6329085a3C24bfb6a
/gettokenliquidity
Returns the individual token liquidity within the specified liquidity pool.
GET
https://api.expand.network/dex/gettokenliquidity
Query Parameters
rpc
String
Remote procedural call URL.
poolAddress*
String
The pool address.
https://api.expand.network/dex/gettokenliquidity?dexId=1400&poolAddress=0x25Accb7943Fd73Dda5E23bA6329085a3C24bfb6a
/getliquidityholders
Returns the total number of liquidity holders in the specified pool.
GET
https://api.expand.network/dex/getliquidityholders
Query Parameters
rpc
String
Remote procedural call URL.
poolAddress*
String
The pool address.
https://api.expand.network/dex/getliquidityholders?dexId=1400&poolAddress=0x1b65fe4881800B91d4277ba738b567CbB200A60d
/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
rpc
String
Remote procedural call URL.
address*
String
The public address of the liquidity holder.
poolAddresses
String
The pool Addresses whose liquidity is to be fetched. (Comma-separated vaules)
https://api.expand.network/dex/getindividualposition?address=0xc29562b045D80fD77c69Bec09541F5c16fe20d9d&dexId=1400&poolAddresses=0xc29562b045D80fD77c69Bec09541F5c16fe20d9d
/swap
Initiate a swap transaction on a specified DEX.
POST
https://api.expand.network/dex/swap
Request Body
path*
Array
Comma-separated values of token addresses, inside an array, to swap.
amountIn*
String
Amount of token to be swapped.
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.
swapKind*
String
The type of batch swap we want to perform.
deadline*
String
Deadline for the transaction to be executed (UNIX Timestamp).
gasPriority
String
low, medium, or high.
slippage
String
Percentage of total swap value. By default, 1.
0 <= slippage value <= 10
{
"dexId": "1400",
"swapKind": "0",
"path": [
"0xae78736Cd615f374D3085123A210448E74Fc6393",
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
],
"amountIn": "100000",
"gas": "800000",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"deadline": "1668973383"
}
With gasPriority:
{
"dexId": "1400",
"swapKind": "0",
"path": [
"0xae78736Cd615f374D3085123A210448E74Fc6393",
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
],
"amountIn": "100000",
"gas": "800000",
"gasPriority": "medium",
"from": "0x4C99D660A51D41bE5D47D66a3d89d5B83D92f27E",
"deadline": "1668973383"
}
With slippage:
{
"dexId": "1400",
"swapKind": "0",
"path": [
"0xae78736Cd615f374D3085123A210448E74Fc6393",
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
],
"amountIn": "100000",
"gas": "800000",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"deadline": "1668973383",
"slippage": "5"
}
/addliquidity
Add liquidity to a specified pool in a specified DEX.
POST
https://api.expand.network/dex/addliquidity
Request Body
path*
Array
Comma separated values of token addresses.
amountIn*
Array
Amount of tokens to add liquidity.
amountOut*
String
Amount of tokens accepted as a result of the transaction.
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.
fromInternalBalance*
Boolean
True
if sending from internal token balances. False
if sending ERC20.
to*
String
Address of the recipient of the token.
gasPriority
String
low, medium, or high.
slippage
String
Percentage of total swap value. By default, 1.
0 <= slippage value <= 10
{
"dexId": "1400",
"path": ["0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", "0x6B175474E89094C44Da98b954EedeAC495271d0F"],
"amountIn": ["0","100000000"],
"amountOut": "2331262690208301876",
"fromInternalBalance": false,
"gas": "2307200",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006"
}
With gasPriority:
{
"dexId": "1400",
"amountIn": [
"1000000000000000000",
"1000000000000000000"
],
"amountOut": "0",
"path": [
"0x6B175474E89094C44Da98b954EedeAC495271d0F",
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
],
"to": "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a",
"deadline": "1710209834351",
"from": "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a",
"gas": "273376",
"fromInternalBalance": false,
"gasPriority": "low"
}
With slippage:
{
"dexId": "1400",
"path": [
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"0x6B175474E89094C44Da98b954EedeAC495271d0F"
],
"amountIn": [
"0",
"100000000"
],
"amountOut": "2331262690208301876",
"fromInternalBalance": false,
"gas": "2307200",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"slippage": "7.02"
}
/removeliquidity
Remove liquidity from a specified pool for a specified DEX.
POST
https://api.expand.network/dex/removeliquidity
Request Body
path*
Array
Comma separated values of token addresses.
amountIn*
String
Amount of tokens to add liquidity.
amountOut*
Array
Amount of tokens accepted as a result of the transaction.
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.
toInternalBalance*
Boolean
True
if you receiving tokens as internal token balances. False
if receiving as ERC20.
to*
String
Address of the recipient of the token.
gasPriority
String
low, medium, or high.
slippage
String
Percentage of total swap value. By default, 1.
0 <= slippage value <= 10
{
"dexId": "1400",
"path": ["0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", "0x6B175474E89094C44Da98b954EedeAC495271d0F"],
"amountOut": ["0","100000000"],
"amountIn": "2427326557218525461",
"toInternalBalance": false,
"gas": "2307200",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006"
}
With gasPriority (medium):
{
"dexId": "1400",
"path": [
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"0x6B175474E89094C44Da98b954EedeAC495271d0F"
],
"amountOut": [
"100",
"100000000"
],
"amountIn": "2427326557218525461",
"toInternalBalance": false,
"gas": "2307200",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"gasPriority": "medium"
}
With Slippage:
{
"dexId": "1400",
"path": [
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"0x6B175474E89094C44Da98b954EedeAC495271d0F"
],
"amountOut": [
"100",
"100000000"
],
"amountIn": "2427326557218525461",
"toInternalBalance": false,
"gas": "2307200",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"slippage": "6.01"
}
Last updated