PancakeSwap

/getprice

Returns the swap quotation for the given token pairs.

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.

https://api.expand.network/dex/getprice?dexId=1200&path=0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c,0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82&amountIn=10000000000000000000

/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 the DEX ID page for details.

tokenB*

String

Address of token

https://api.expand.network/dex/getuserliquidity?address=0x6fb447ae94f5180254d436a693907a1f57696900&dexId=1200&tokenA=0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c&tokenB=0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82

/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.

https://api.expand.network/dex/getpoolliquidity?dexId=1200&poolAddress=0x460b4193Ec4C1a17372Aa5FDcd44c520ba658646

/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.

https://api.expand.network/dex/gettokenliquidity?dexId=1200&poolAddress=0x460b4193Ec4C1a17372Aa5FDcd44c520ba658646

/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.

https://api.expand.network/dex/getliquidityholders?dexId=1200&poolAddress=0x460b4193Ec4C1a17372Aa5FDcd44c520ba658646

/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.

poolSize

String

The number of pools for which the user intends to fetch the individual position. By default: 50, Maximum: 9,950

poolAddresses

String

The pool Addresses whose liquidity is to be fetched. (Comma-separated vaules)

https://api.expand.network/dex/getindividualposition?poolAddresses=0xC05654C66756eBB82c518598c5f1ea1a0199a563&address=0x8f295a22a4a5ef346192d2b2d4c483d9f76b2a67&poolSize=1000&dexId=1200

/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.

https://historicaltrade.api.expand.network/dex/gethistoricaltimeseries?dexId=1200&poolAddress=0x16b9a82891338f9ba80e2d6970fdda79d1eb0dae&startBlock=18675000&endBlock=18675639

/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.

https://historicaltrade.api.expand.network/dex/gethistoricaltransactions?poolAddress=0x05616b7b6da03fb4c773b76663816b360ccaede4&dexId=1200&startBlock=34544519&endBlock=34548560

/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 a 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; 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 .

slippage

String

Percentage of total swap value. By default, 1.

0 <= slippage value <= 10

gasPriority

String

low, medium, or high.

{
    "dexId": "1200",
    "amountIn": "120000000",
    "amountOutMin": "0",
    "path": ["0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", "0xCC42724C6683B7E57334c4E856f4c9965ED682bD"],
    "to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "deadline": "1664529286",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "29880"
}

With gasPriority:

{
    "dexId": "1200",
    "amountIn": "120000000",
    "amountOutMin": "0",
    "path": [
        "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
        "0xCC42724C6683B7E57334c4E856f4c9965ED682bD"
    ],
    "to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "deadline": "1704529286",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "298800",
    "gasPriority": "medium"
}

With slippage:

{
    "dexId": "1200",
    "amountIn": "120000000",
    "amountOutMin": "0",
    "path": [
        "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
        "0xCC42724C6683B7E57334c4E856f4c9965ED682bD"
    ],
    "to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "deadline": "1664529286",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "29880",
    "slippage": "8.033543322"
}

/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.

slippage

String

Percentage of total swap value. By default, 1.

0 <= slippage value <= 10

gasPriority

String

low, medium, or high.

{
    "dexId": "1200",
    "tokenA": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
    "tokenB": "0xCC42724C6683B7E57334c4E856f4c9965ED682bD",
    "amountADesired": "50000000000000000",
    "amountBDesired": "77926115",
    "amountAMin": "0",
    "amountBMin": "0",
    "to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "deadline": "1663181575",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "2307200"
}

With gasPriority:

{
    "dexId": "1200",
    "tokenA": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
    "tokenB": "0xCC42724C6683B7E57334c4E856f4c9965ED682bD",
    "amountADesired": "50000000000000000",
    "amountBDesired": "77926115",
    "amountAMin": "0",
    "amountBMin": "0",
    "to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "deadline": "1663181575",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "2307200",
    "gasPriority": "medium"
}

With slippage:

{
    "dexId": "1200",
    "tokenA": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
    "tokenB": "0xCC42724C6683B7E57334c4E856f4c9965ED682bD",
    "amountADesired": "50000000000000000",
    "amountBDesired": "77926115",
    "amountAMin": "10000000000000000",
    "amountBMin": "100000",
    "to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "deadline": "1663181575",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "2307200",
    "slippage": "5"
}

/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 swap value. By default, 1.

0 <= slippage value <= 10

{
    "dexId": "1200",
    "tokenA": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
    "tokenB": "0xCC42724C6683B7E57334c4E856f4c9965ED682bD",
    "liquidity": "163742355742154761",
    "amountAMin": "0",
    "amountBMin": "0",
    "to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "deadline": "1663231732",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "842720"
}

With gasPriority:

{
    "dexId": "1200",
    "tokenA": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
    "tokenB": "0xCC42724C6683B7E57334c4E856f4c9965ED682bD",
    "liquidity": "163742355742154761",
    "amountAMin": "0",
    "amountBMin": "0",
    "to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "deadline": "1703231732",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "842720",
    "gasPriority": "medium"
}

With slippage:

{
    "dexId": "1200",
    "tokenA": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
    "tokenB": "0xCC42724C6683B7E57334c4E856f4c9965ED682bD",
    "liquidity": "163742355742154761",
    "amountAMin": "0",
    "amountBMin": "0",
    "to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "deadline": "1663231732",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "842720",
    "slippage": "5"
}

Last updated

#553: ENC-2526-LIDO

Change request updated