Plan liquidity provision on PancakeSwap. Use when user says "add liquidity on pancakeswap", "provide liquidity", "LP on pancakeswap", "farm pancakeswap", or describes wanting to deposit tokens into liquidity pools without writing code.
Plan liquidity provision on PancakeSwap by gathering user intent, discovering and verifying tokens, assessing pool metrics, recommending price ranges and fee tiers, and generating a ready-to-use deep link to the PancakeSwap interface.
This skill does not execute transactions — it plans liquidity provision. The output is a deep link URL that opens the PancakeSwap position creation interface pre-filled with the LP parameters, so the user can review position size, fee tier, and price range before confirming in their wallet.
Key features:
::: danger MANDATORY SECURITY RULES
KEYWORD='user input'). Always quote variable expansions in commands (e.g., "$TOKEN", "$RPC").^0x[0-9a-fA-F]{40}$. RPC URLs must come from the Supported Chains table. Reject any value containing shell metacharacters (", `, $, \, ;, |, &, newlines).open / xdg-open with https://pancakeswap.finance/ URLs. Only use curl to fetch from: api.dexscreener.com, tokens.pancakeswap.finance, api.coingecko.com, api.llama.fi, yields.llama.fi, and public RPC endpoints listed in the Supported Chains table. Never curl internal/private IPs (169.254.x.x, 10.x.x.x, 127.0.0.1, localhost).
:::| Chain | Chain ID | Deep Link Key | Native Token | Fee Tiers |
|---|---|---|---|---|
| BNB Smart Chain | 56 | bsc | BNB | V2 (0.25%), V3 (all), StableSwap |
| Ethereum | 1 | eth | ETH | V3 (0.01%, 0.05%, 0.25%, 1%) |
| Arbitrum One | 42161 | arb | ETH | V3 (0.01%, 0.05%, 0.25%, 1%) |
| Base | 8453 | base | ETH | V3 (0.01%, 0.05%, 0.25%, 1%) |
| zkSync Era | 324 | zksync | ETH | V3 (0.01%, 0.05%, 0.25%, 1%) |
| Linea | 59144 | linea | ETH | V3 (0.01%, 0.05%, 0.25%, 1%) |
| opBNB | 204 | opbnb | BNB | V3 (0.01%, 0.05%, 0.25%, 1%) |
| BSC Testnet | 97 | bsctest | BNB | V2, V3 (dev/testing only) |
If the user hasn't specified all parameters, use AskUserQuestion to ask (batch up to 4 questions at once). Infer from context where obvious.
Required information:
Optional but useful:
# Search by keyword — returns pairs across all DEXes
# Use single quotes for KEYWORD to prevent shell injection
KEYWORD='pancake'
CHAIN="bsc" # DexScreener chainId: bsc, ethereum, arbitrum, base, zksync, linea, opbnb
curl -s -G "https://api.dexscreener.com/latest/dex/search" --data-urlencode "q=$KEYWORD" | \
jq --arg chain "$CHAIN" '[
.pairs[]
| select(.chainId == $chain and .dexId == "pancakeswap")
| {
name: .baseToken.name,
symbol: .baseToken.symbol,
address: .baseToken.address,
priceUsd: .priceUsd,
liquidity: (.liquidity.usd // 0),
volume24h: (.volume.h24 // 0),
labels: (.labels // [])
}
]
| sort_by(-.liquidity)
| .[0:5]'
DexScreener V2/V3 distinction: All PancakeSwap pools use
dexId: "pancakeswap". The pool version is in.labels[]— look for"v2","v3", or"v1". Do NOT filter bydexId == "pancakeswap-v3"— that dexId does not exist.
For well-known PancakeSwap-listed tokens, check the official token list:
curl -s "https://tokens.pancakeswap.finance/pancakeswap-extended.json" | \
jq --arg sym "CAKE" '.tokens[] | select(.symbol == $sym) | {name, symbol, address, chainId, decimals}'
| Chain | Native | URL Value |
|---|---|---|
| BSC | BNB | BNB |
| Ethereum | ETH | ETH |
| Arbitrum | ETH | ETH |
| Base | ETH | ETH |
| opBNB | BNB | BNB |
| Others | ETH | ETH |
If DexScreener and the token list don't return a clear match, use WebSearch to find the official contract address from the project's website. Always cross-reference with on-chain verification (Step 3).
Never include an unverified address in a deep link. Even one wrong digit routes funds to the wrong place.
cast (Foundry — preferred)RPC="https://bsc-dataseed1.binance.org"
TOKEN="0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82" # CAKE
[[ "$TOKEN" =~ ^0x[0-9a-fA-F]{40}$ ]] || { echo "Invalid token address"; exit 1; }
cast call "$TOKEN" "name()(string)" --rpc-url "$RPC"
cast call "$TOKEN" "symbol()(string)" --rpc-url "$RPC"
cast call "$TOKEN" "decimals()(uint8)" --rpc-url "$RPC"
cast call "$TOKEN" "totalSupply()(uint256)" --rpc-url "$RPC"
RPC="https://bsc-dataseed1.binance.org"
TOKEN="0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82"
[[ "$TOKEN" =~ ^0x[0-9a-fA-F]{40}$ ]] || { echo "Invalid token address"; exit 1; }
# name() selector = 0x06fdde03
curl -sf -X POST "$RPC" \
-H "Content-Type: application/json" \
-d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_call\",\"params\":[{\"to\":\"$TOKEN\",\"data\":\"0x06fdde03\"},\"latest\"]}" \
| jq -r '.result'
Red flags — stop and warn the user:
eth_call returns 0x (not a contract)TOKEN_A="0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82" # CAKE
TOKEN_B="BNB"
CHAIN_ID="bsc"
[[ "$TOKEN_A" =~ ^0x[0-9a-fA-F]{40}$ ]] || { echo "Invalid token A address"; exit 1; }
# Find all PancakeSwap pairs for TOKEN_A (filter by quote token in jq)
curl -s "https://api.dexscreener.com/latest/dex/tokens/${TOKEN_A}" | \
jq --arg dex "pancakeswap" --arg chain "$CHAIN_ID" '.pairs[]
| select(.dexId == $dex and .chainId == $chain)
| {
pairAddress: .pairAddress,
poolVersion: (if ((.labels // []) | any(. == "v3")) then "v3" elif ((.labels // []) | any(. == "v1")) then "v1" else "v2" end),
labels: (.labels // []),
liquidity: .liquidity.usd,
volume24h: .volume.h24,
priceUsd: .priceUsd,
priceChange24h: .priceChange.h24
}'
Key insights:
After discovering pools, fetch depth metrics:
# For a specific pair on PancakeSwap
PAIR="0xA527819e89CA0145Fb2e9e03396e088f67Dc4bcc" # CAKE-BNB example
curl -s "https://api.dexscreener.com/latest/dex/pairs/bsc/${PAIR}" | \
jq '.pairs[0] | {
liquidity: .liquidity.usd,
volume24h: .volume.h24,
priceUsd: .priceUsd,
priceChange24h: .priceChange.h24,
baseToken: .baseToken.symbol,
quoteToken: .quoteToken.symbol,
labels: (.labels // []),
poolVersion: (if ((.labels // []) | any(. == "v3")) then "v3" elif ((.labels // []) | any(. == "v1")) then "v1" else "v2" end)
}'
Liquidity assessment:
Fetch yield data to inform position recommendations:
# Projects: "pancakeswap-amm" (V2), "pancakeswap-amm-v3" (V3)
# .symbol contains token names like "CAKE-WBNB". .pool is a UUID — do NOT filter on .pool.
# Note: BSC pools may only appear under "pancakeswap-amm" — query both projects.
curl -s "https://yields.llama.fi/pools" | \
jq '.data[]
| select(.project == "pancakeswap-amm-v3" or .project == "pancakeswap-amm")
| select(.chain == "BSC" or .chain == "Binance")
| {
pool: .symbol,
chain: .chain,
project: .project,
apy: .apy,
apyBase: .apyBase,
apyReward: .apyReward,
tvlUsd: .tvlUsd,
underlyingTokens: .underlyingTokens
}'
Yield tiers for PancakeSwap V3 positions:
| APY Range | Liquidity Quality | Risk Level | Recommendation |
|---|---|---|---|
| 50%+ APY | Thin/risky | Very High | Warn: IL likely > yield |
| 20%–50% APY | Adequate | High | Concentrated positions only |
| 5%–20% APY | Good | Moderate | Best for wide range positions |
| 1%–5% APY | Excellent/deep | Low | Stablecoin pairs, large caps |
| < 1% APY | Massive TVL | Very Low | Fee-based yield only (base APY) |
| Price Range (from current) | IL at 2x move | IL at 5x move |
|---|---|---|
| Full range (±∞) | 0% | 0% |
| ±50% | 0.6% | 5.7% |
| ±25% | 0.2% | 1.8% |
| ±10% | 0.03% | 0.31% |
| ±5% | 0.008% | 0.078% |
Recommendations by LP profile:
Conservative (Broad Range): ±50% around current price
Balanced (Medium Range): ±25% around current price
Aggressive (Tight Range): ±10% around current price
CURRENT_PRICE=2.5 # CAKE/BNB, for example
RANGE_PCT=0.25 # ±25%
LOWER_BOUND=$(echo "$CURRENT_PRICE * (1 - $RANGE_PCT)" | bc)
UPPER_BOUND=$(echo "$CURRENT_PRICE * (1 + $RANGE_PCT)" | bc)
echo "Recommended range: $LOWER_BOUND – $UPPER_BOUND"
| Fee Tier | Tick Spacing | Best For | Trading Volume | IL Risk |
|---|---|---|---|---|
| 0.01% | 1 | Stablecoin pairs (USDC/USDT, USDC/DAI) | Very high | Very low |
| 0.05% | 10 | Correlated pairs (stablecoin + USDC bridge) | High | Low |
| 0.25% | 50 | Large caps (CAKE, BNB, ETH), established | Moderate-high | Medium |
| 1.0% | 200 | Small caps, emerging tokens, volatile pairs | Lower | Medium-high |
Decision tree:
Is this a stablecoin pair (USDT/USDC, USDT/BUSD)?
YES → Use 0.01% (almost zero slippage for swappers, best LP capture)
Is this a large-cap, high-volume pair (CAKE/BNB, ETH/USDC)?
YES → Use 0.25% (default, proven track record)
Is the second token volatile or new?
YES → Use 1.0% (higher swap fees compensate for IL risk)
Is the pair correlated but not strictly stable (e.g., BNB/ETH)?
YES → Use 0.05%–0.25% (balance precision with IL mitigation)