Supported Chains
Available on Stacks Mainnet.
Available Endpoints:
Click on the endpoint to jump to the section with full details
GET
- Returns the swap quotation for a given token pair on Uniswap V3.
GET
- Returns the balance of a particular token pair of accounts.
GET
- Returns the total liquidity for a specified pool.
GET
- Returns the individual token liquidity within the specified liquidity pool.
- Returns the USD price of the liquidity token of a particular pool.
POST
- Initiate a swap transaction on a specified DEX.
DEX IDs
Many endpoints have a parameter where you can provide a DEX ID.
Below is a list of DEX IDs related to Alex. For a complete list and more information, please see the page.
Endpoint Details
/getprice
Returns the swap quotation for a given token pair.
GET
https://api.expand.network/dex/getprice
Query Parameter
Remote procedural call URL.
Comma separated values of token addresses whose price is to be fetched.
https://api.expand.network/dex/getprice?path=SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.token-wstx,SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.brc20-db20&amountIn=100&dexId=3100
{
"status": 200,
"msg": "success",
"data": {
"amountIn": "100",
"path": [
"SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.token-wstx",
"SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.brc20-db20"
],
"amountsOut": [
"100",
"2603"
]
}
}
/getuserliquidity
Returns the total liquidity (amount of liquidity pool token) that a user holds.
GET
https://api.expand.network/dex/getuserliquidity
Query Parameter
Remote procedural call URL.
Public address of liquidity provider.
https://api.expand.network/dex/getuserliquidity?dexId=3100&poolId=13&address=SP16PBYTMSTXSQY9F0CFNFNYSZ1JD3JGEPM4AZBTD
{
"status": 200,
"msg": "success",
"data": {
"poolId": "13",
"liquidity": "7031371207288",
"tokenA": "1047964",
"tokenB": "21118906"
}
}
/getpoolliquidity
Returns the total liquidity for a specified pool.
GET
https://api.expand.network/dex/getpoolliquidity
Query Parameter
Remote procedural call URL.
Pool Id whose liquidity is to be fetched.
https://api.expand.network/dex/getpoolliquidity?dexId=3100&poolId=59
{
"status": 200,
"msg": "success",
"data": {
"totalLiquidity": "900000000000000000"
}
}
/gettokenliquidity
Returns the individual token liquidity within the specified liquidity pool.
GET
https://api.expand.network/dex/gettokenliquidity
Query Parameter
Remote procedural call URL.
Pool Id whose liquidity is to be fetched.
https://api.expand.network/dex/gettokenliquidity?dexId=3100&poolId=117
{
"status": 200,
"msg": "success",
"data": {
"token-wstx-v2": "79571081726",
"token-wchillguy": "115134358586619695"
}
}
/gettokenidprice
Returns the USD price of the liquidity token of a particular pool.
GET
https://api.expand.network/dex/gettokenidprice
Query Parameter
Remote procedural call URL.
Pool Id whose USD price of liquidity token is to be fetched.
https://api.expand.network/dex/gettokenidprice?dexId=3100&poolId=14
{
"status": 200,
"msg": "success",
"data": {
"poolId": "14",
"price": "0.9698074551870216"
}
}
/swap
Initiate a swap transaction on a specified DEX.
POST https://api.expand.network/dex/swap
Request Body
Remote procedural call URL.
Comma-separated values of token addresses, inside an array, to swap.
Note: For assets other than XLM (Native token), the token issuer is required.
Amount of token to be swapped.
Minimum amount accepted as the result of swap.
Address of the sender of the token.
Percentage of total swap value. By default, 1.
0 <= slippage value <= 10
{
"dexId": "3100",
"path": [
"SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.token-wstx-v2",
"sp102v8p0f7jx67arq77wea3d3cfb5xw39redt0am.token-alex"
],
"amountIn": "1000",
"from": "SP16PBYTMSTXSQY9F0CFNFNYSZ1JD3JGEPM4AZBTD",
"amountOutMin": "0",
"slippage": "10"
}
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1700",
"from": "SP16PBYTMSTXSQY9F0CFNFNYSZ1JD3JGEPM4AZBTD",
"data": "eyJjb250cmFjdE5hbWUiOiJhbW0tcG9vbC12Mi0wMSIsImZ1bmN0aW9uTmFtZSI6InN3YXAtaGVscGVyIiwiZnVuY3Rpb25BcmdzIjpbeyJ0eXBlIjo2LCJhZGRyZXNzIjp7InR5cGUiOjAsInZlcnNpb24iOjIyLCJoYXNoMTYwIjoiNDAyZGEyYzA3O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