PancakeSwap V3

Supported Chains

Available on Arbitrum, Base, Binance Smart Chain.

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

  • /getindividualposition GET - Returns the liquidity position for a specified user address across all the pools for a given DEX.

  • /swap POST - Initiate a swap transaction on a specified DEX.

  • /addliquidity POST - Add liquidity to a specified pool in a specified DEX.

  • /removeliquidity POST - Remove liquidity from a specified pool in 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 PancakeSwap V3. Please see the DEX ID page for a complete DEX ID list and more information.

Endpoint Details

/getprice

Returns the swap quotation for a given token pair on PancakeSwap V3

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

Query Parameters

https://api.expand.network/dex/getprice?path=0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82,0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c&amountIn=100000000&dexId=2800&poolFees=10000

back to top

/getuserliquidity

Returns the balance of a particular token pair of an account.

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

Query Parameters

https://api.expand.network/dex/getuserliquidity?dexId=2800&tokenId=1312988

back to top

/getpoolliquidity

Returns the total liquidity for a specified pool.

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

Query Parameters

https://api.expand.network/dex/getpoolliquidity?dexId=2800&poolAddress=0xd710DaC10B7255fCc0eC929a0e742A18F25b6395

back to top

/gettokenliquidity

Returns the individual token liquidity within the specified liquidity pool.

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

Query Parameters

https://api.expand.network/dex/gettokenliquidity?dexId=2800&poolAddress=0xd710DaC10B7255fCc0eC929a0e742A18F25b6395

back to top

/getindividualposition

Returns the liquidity position for a specified user address across all the pools for a given DEX.

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

Query Parameters

https://api.expand.network/dex/getindividualposition?dexId=2800&address=0x1782ceA0D026430ad4b410697c2df05a104EFA9b

back to top

/swap

Initiate a swap transaction on a specified DEX.

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

Request Body

{
    "dexId": "2800",
    "path": ["0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c", "0x55d398326f99059fF775485246999027B3197955"],
    "amountIn":"1000000000000",
    "gas": "100000",
    "to": "0xf67d5d28614f26f56a73E635197534871D4ACf14",
    "amountOutMin": "100",
    "from": "0xf67d5d28614f26f56a73E635197534871D4ACf14",
    "poolFees": "10000",
    "involveBaseToken": "1",
    "deadline": "19999999999999"
}

With gasPriority (medium):

{
    "dexId": "2800",
    "path": ["0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c", "0x55d398326f99059fF775485246999027B3197955"],
    "amountIn":"1000000000000",
    "gas": "100000",
    "to": "0xf67d5d28614f26f56a73E635197534871D4ACf14",
    "amountOutMin": "100",
    "from": "0xf67d5d28614f26f56a73E635197534871D4ACf14",
    "poolFees": "10000",
    "involveBaseToken": "1",
    "deadline": "19999999999999",
    "gasPriority": "medium"
}

back to top

/addliquidity

Add liquidity to a specified pool in a specified DEX.

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

Request Body

{
    "dexId": "2800",
    "tokenA": "0x55d398326f99059fF775485246999027B3197955",
    "tokenB": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
    "amountADesired":"1000",
    "amountBDesired": "10",
    "amountAMin": "0",
    "amountBMin": "0",
    "deadline": "19999999999",
    "gas": "10000",
    "to": "0xf67d5d28614f26f56a73E635197534871D4ACf14",
    "amountOutMin": "100",
    "from": "0xf67d5d28614f26f56a73E635197534871D4ACf14",
    "poolFees": "10000"
}

With gasPriority (medium):

{
    "dexId": "2800",
    "tokenA": "0x55d398326f99059fF775485246999027B3197955",
    "tokenB": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
    "amountADesired": "1000",
    "amountBDesired": "10",
    "amountAMin": "0",
    "amountBMin": "0",
    "deadline": "19999999999",
    "gas": "10000",
    "to": "0xf67d5d28614f26f56a73E635197534871D4ACf14",
    "amountOutMin": "100",
    "from": "0xf67d5d28614f26f56a73E635197534871D4ACf14",
    "poolFees": "10000",
    "gasPriority": "medium"
}

back to top

/removeliquidity

Remove liquidity from a specified pool for a specified DEX.

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

Request Body

{
    "dexId": "2800",
    "tokenA": "0x55d398326f99059fF775485246999027B3197955",
    "tokenB": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
    "amountAMax": "1000",
    "amountBMax": "10",
    "amountAMin": "0",
    "amountBMin": "0",
    "deadline": "19999999999",
    "liquidity": "10000",
    "gas": "10000",
    "amountOutMin": "100",
    "from": "0x176a7FCF400d3af85909e5A16ea9D04b4717C529",
    "tokenId": "1312988"
}

With gasPriority:

{
    "dexId": "2800",
    "tokenA": "0x55d398326f99059fF775485246999027B3197955",
    "tokenB": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
    "amountAMax": "1000",
    "amountBMax": "10",
    "amountAMin": "0",
    "amountBMin": "0",
    "deadline": "19999999999",
    "liquidity": "10000",
    "gas": "10000",
    "amountOutMin": "100",
    "from": "0x176a7FCF400d3af85909e5A16ea9D04b4717C529",
    "tokenId": "1312988",
    "gasPriority": "medium"
}

back to top

Last updated