PancakeSwap V3
Supported Chains
Available on Arbitrum, Base, Binance Smart Chain, Ethereum and zkSync Era.
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.
PancakeSwap V3
Arbitrum
2808
PancakeSwap V3
Base
2809
PancakeSwap V3
Binance Smart Chain
2800
PancakeSwap V3
Ethereum
2810
PancakeSwap V3
zkSync Era
2811
Endpoint Details
/getprice
Returns the swap quotation for a given token pair on PancakeSwap V3
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.
poolFees
String
Different pool based on the fees. By default, it is selected as 3000.
https://api.expand.network/dex/getprice?path=0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82,0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c&amountIn=100000000&dexId=2800&poolFees=10000
/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.
tokenId*
String
The token ID for PancakeSwap V3 liquidity position.
dexId*
String
Refer to DexId page for details.
https://api.expand.network/dex/getuserliquidity?dexId=2800&tokenId=1312988
/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.
dexId*
String
Refer to DEX ID page for details.
https://api.expand.network/dex/getpoolliquidity?dexId=2800&poolAddress=0xd710DaC10B7255fCc0eC929a0e742A18F25b6395
/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.
dexId*
String
Refer to DEX ID page for details.
https://api.expand.network/dex/gettokenliquidity?dexId=2800&poolAddress=0xd710DaC10B7255fCc0eC929a0e742A18F25b6395
/getpoolindividualliquidity
Returns all user addresses, block numbers, and token position details for a specified pool address.
GET
https://historicallp.api.expand.network/dex/getpoolindividualliquidity
Query Parameters
rpc
String
Remote procedural call URL.
poolAddress*
String
The pool address.
dexId*
String
Refer to DEX ID page for details.
endBlock
String
Last block of the range.
startBlock
String
Starting block of the range.
https://historicallp.api.expand.network/dex/getpoolindividualliquidity?poolAddress=0x588d7cf062f4edd7c7c7f2d66fd770e03b1ea735&dexId=2800&startBlock=44738053&endBlock=44738153
/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
rpc
String
Remote procedural call URL.
address*
String
The public address of the liquidity holder.
dexId*
String
Refer to DEX ID page for details.
poolAddresses
String
The pool Addresses whose liquidity is to be fetched. (Comma-separated vaules)
https://api.expand.network/dex/getindividualposition?dexId=2800&address=0x1782ceA0D026430ad4b410697c2df05a104EFA9b
/swap
Initiate a swap transaction on a specified DEX.
POST
https://api.expand.network/dex/swap
Request Body
rpc
String
Remote procedural call URL.
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.
from*
String
Address of the sender of the token.
gas
String
Maximum gas limit provided by the sender, for the transaction.
poolFees
String
Different pool based on the fees. By default, it is selected as 3000.
gasPriority
String
low, medium, or high.
slippage
String
Percentage of total swap value. By default, 1.
0 <= slippage value <= 100
ofacCheck
Boolean
if true,
provides insights of the contract and tokens involved in the transaction.
By Default, false
Available on Ethereum, Polygon, BSC, Avalanche, Arbitrum and Optimism Mainnet
{
"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"
}
With ofacCheck:
{
"dexId": "2800",
"path": ["0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c", "0x55d398326f99059fF775485246999027B3197955"],
"amountIn":"1000000000000",
"gas": "100000",
"to": "0xf67d5d28614f26f56a73E635197534871D4ACf14",
"amountOutMin": "100",
"from": "0xf67d5d28614f26f56a73E635197534871D4ACf14",
"poolFees": "10000",
"involveBaseToken": "1",
"deadline": "19999999999999",
"ofacCheck": true
}
/addliquidity
Add liquidity to a specified pool in a specified DEX.
POST
https://api.expand.network/dex/addliquidity
Request Body
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.
poolFees*
String
Different pool based on the fees.
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.
tokenId
String
The token ID for PancakeSwap V3 liquidity position.
gasPriority
String
low, medium, or high.
slippage
String
Percentage of total value. By default, 1.
0 <= slippage value <= 100
ofacCheck
Boolean
if true,
provides insights of the contract and tokens involved in the transaction.
By Default, false
Available on Ethereum, Polygon, BSC, Avalanche, Arbitrum and Optimism Mainnet
{
"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"
}
With ofacCheck:
{
"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",
"ofacCheck": true
}
/removeliquidity
Remove liquidity from a specified pool for a specified DEX.
POST
https://api.expand.network/dex/removeliquidity
Request Body
dexId*
String
Refer to the DEX ID page for details.
tokenId*
String
The token ID for PancakeSwap V3 liquidity position.
amountAMin
String
Minimum amount of Token A.
amountAMax
String
Maximum amount of Token A.
amountBMax
String
Maximum amount of Token B.
recipient
String
Recipient for sweep tokens.
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.
tokenA*
String
Address of the first token being removed.
tokenB
String
Address of the second token being removed.
liquidity*
string
The liquidity to be removed.
amountBMin
String
Minimum amount of Token B.
gasPriority
String
low, medium, or high.
slippage
String
Percentage of total value. By default, 1.
0 <= slippage value <= 100
ofacCheck
Boolean
if true,
provides insights of the contract and tokens involved in the transaction.
By Default, false
Available on Ethereum, Polygon, BSC, Avalanche, Arbitrum and Optimism Mainnet
{
"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"
}
With ofacCheck:
{
"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",
"ofacCheck": true
}
Last updated