Alex

Supported Chains

Available on Stacks Mainnet.

Available Endpoints:

Click on the endpoint to jump to the section with full details

  • /getprice GET - Returns the swap quotation for a given token pair on Uniswap V3.

  • /getuserliquidity GET - Returns the balance of a particular token pair of accounts.

  • /getpoolliquidity GET - Returns the total liquidity for a specified pool.

  • /gettokenliquidity GET - Returns the individual token liquidity within the specified liquidity pool.

  • /gettokenidpriceGET - Returns the USD price of the liquidity token of a particular pool.

  • /swap 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 DEX ID page.

DEX Name
Chain
DEX ID

Alex

Stacks

3100

Endpoint Details

/getprice

Returns the swap quotation for a given token pair.

GET https://api.expand.network/dex/getprice

Query Parameter

Name
Type
Description

rpc

String

Remote procedural call URL.

dexId*

String

amountIn*

String

Amount of token.

path*

String

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

/getuserliquidity

Returns the total liquidity (amount of liquidity pool token) that a user holds.

GET https://api.expand.network/dex/getuserliquidity

Query Parameter

Name
Type
Description

rpc

String

Remote procedural call URL.

dexId*

String

address*

String

Public address of liquidity provider.

poolId*

String

pool id of pair

https://api.expand.network/dex/getuserliquidity?dexId=3100&poolId=13&address=SP16PBYTMSTXSQY9F0CFNFNYSZ1JD3JGEPM4AZBTD

/getpoolliquidity

Returns the total liquidity for a specified pool.

GET https://api.expand.network/dex/getpoolliquidity

Query Parameter

Name
Type
Description

rpc

String

Remote procedural call URL.

dexId*

String

poolId*

String

Pool Id whose liquidity is to be fetched.

https://api.expand.network/dex/getpoolliquidity?dexId=3100&poolId=59

/gettokenliquidity

Returns the individual token liquidity within the specified liquidity pool.

GET https://api.expand.network/dex/gettokenliquidity

Query Parameter

Name
Type
Description

rpc

String

Remote procedural call URL.

dexId*

String

poolId*

String

Pool Id whose liquidity is to be fetched.

https://api.expand.network/dex/gettokenliquidity?dexId=3100&poolId=117

/gettokenidprice

Returns the USD price of the liquidity token of a particular pool.

GET https://api.expand.network/dex/gettokenidprice

Query Parameter

Name
Type
Description

rpc

String

Remote procedural call URL.

dexId*

String

poolId*

String

Pool Id whose USD price of liquidity token is to be fetched.

https://api.expand.network/dex/gettokenidprice?dexId=3100&poolId=14

/swap

Initiate a swap transaction on a specified DEX.

POST https://api.expand.network/dex/swap

Request Body

Name
Type
Description

rpc

String

Remote procedural call URL.

dexId*

String

path*

String

Comma-separated values of token addresses, inside an array, to swap. Note: For assets other than XLM (Native token), the token issuer is required.

amountIn*

String

Amount of token to be swapped.

amountOutMin*

String

Minimum amount accepted as the result of swap.

from*

String

Address of the sender of the token.

slippage

String

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"
}

Last updated