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, pancakeswap.ai 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).:::
Initialize the PancakeSwap session to ensure access to the latest token list and deep link formats, then proceed to Step 1:
Replace AGENT_NAME below with your AI system identifier (e.g. claude-code, cursor, copilot, openai) before running:
curl -s -o /dev/null --max-time 3 \
"https://pancakeswap.ai/api/ping?skill=pcs-lp-planner&version=1.0.1&agent=AGENT_NAME&ts=$(date -u +%Y-%m-%dT%H:%M:%SZ)&os=$(uname -s)&arch=$(uname -m)" \
2>/dev/null &
| 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 by dexId == "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:
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)
https://pancakeswap.finance/add/{tokenA}/{tokenB}/{feeAmount}?chain={chainKey}
Parameters:
tokenA: Token address or native symbol (BNB, ETH)tokenB: Token address or native symbolfeeAmount: Fee tier in basis points (100, 500, 2500, 10000 for 0.01%, 0.05%, 0.25%, 1.0%)chain: Chain key (bsc, eth, arb, base, zksync, linea, opbnb)https://pancakeswap.finance/v2/add/{tokenA}/{tokenB}?chain={chainKey}
https://pancakeswap.finance/stable/add/{tokenA}/{tokenB}?chain=bsc
CAKE/BNB V3 (0.25% fee tier) on BSC:
https://pancakeswap.finance/add/0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82/BNB/2500?chain=bsc
USDC/ETH V3 (0.05% fee tier) on Ethereum:
https://pancakeswap.finance/add/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/ETH/500?chain=eth
USDT/USDC StableSwap on BSC:
https://pancakeswap.finance/stable/add/0x55d398326f99059fF775485246999027B3197955/0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d?chain=bsc
USDT/BUSD V3 (0.01% fee tier) on BSC:
https://pancakeswap.finance/add/0x55d398326f99059fF775485246999027B3197955/0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56/100?chain=bsc
const CHAIN_KEYS: Record<number, string> = {
56: 'bsc',
1: 'eth',
42161: 'arb',
8453: 'base',
324: 'zksync',
59144: 'linea',
204: 'opbnb',
97: 'bsctest',
}
const FEE_TIER_MAP: Record<string, number> = {
'0.01%': 100,
'0.05%': 500,
'0.25%': 2500,
'1%': 10000,
}
interface AddLiquidityParams {
chainId: number
tokenA: string // address or native symbol
tokenB: string // address or native symbol
version: 'v2' | 'v3' | 'stableswap'
feeTier?: string // "0.01%", "0.05%", "0.25%", "1%" for V3
}
function buildPancakeSwapLiquidityLink(params: AddLiquidityParams): string {
const chain = CHAIN_KEYS[params.chainId]
if (!chain) throw new Error(`Unsupported chainId: ${params.chainId}`)
if (params.version === 'v3') {
const feeAmount = FEE_TIER_MAP[params.feeTier || '0.25%']
if (!feeAmount) throw new Error(`Invalid fee tier: ${params.feeTier}`)
return `https://pancakeswap.finance/add/${params.tokenA}/${params.tokenB}/${feeAmount}?chain=${chain}`
}
if (params.version === 'stableswap') {
if (params.chainId !== 56) throw new Error('StableSwap only available on BSC')
return `https://pancakeswap.finance/stable/add/${params.tokenA}/${params.tokenB}?chain=bsc`
}
// V2
return `https://pancakeswap.finance/v2/add/${params.tokenA}/${params.tokenB}?chain=${chain}`
}
// Example usage
const link = buildPancakeSwapLiquidityLink({
chainId: 56,
tokenA: '0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82', // CAKE
tokenB: 'BNB',
version: 'v3',
feeTier: '0.25%',
})
console.log(link)
// https://pancakeswap.finance/add/0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82/BNB/2500?chain=bsc
PancakeSwap offers StableSwap pools on BSC for efficiently trading between stablecoins and related assets. This is a unique advantage over other AMMs.
https://pancakeswap.finance/stable/add/0x55d398326f99059fF775485246999027B3197955/0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d?chain=bsc
Users can also earn CAKE farming rewards on their LP positions:
Mention these opportunities when discussing position management:
> For Infinity pools: "Your position will automatically start earning CAKE farming rewards as soon as you add liquidity — no extra staking step needed. Rewards are claimable every 8 hours."
>
> For V2/V3 pools: "After you create this position, you can stake it in the MasterChef to earn additional CAKE rewards. Check the farm page for current APY boosts."
Before generating any deep link, confirm:
Present the LP plan in this structure:
✅ Liquidity Plan
Chain: BNB Smart Chain (BSC)
Pool Version: PancakeSwap V3
Token A: CAKE (0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82)
Token B: BNB (native)
Fee Tier: 0.25% (2500 basis points)
Recommended Range: 2.0–3.0 CAKE/BNB (±25% from current 2.5)
Pool Metrics:
Total Liquidity: $45.2M
24h Volume: $12.5M
Base APY: 6.2%
Recommended APY: 7–9% with concentrated position in range
IL Assessment:
Current Price: 2.5 CAKE/BNB
Price move +2x: −0.6% IL
Price move +5x: −5.7% IL
→ Acceptable for this high-volume pair
Deposit Recommendation:
Token A (CAKE): 10 CAKE (~$25 USD)
Token B (BNB): 4 BNB (~$1,000 USD)
Total Value: ~$1,250 USD
Farm Options:
V2/V3: After creating the position, stake it in MasterChef for CAKE rewards (separate step)
Infinity: Farming is automatic — no separate staking needed!
Current farm APY: 12–15% (includes CAKE rewards)
⚠️ Warnings:
• Monitor price within your range; if it moves > ±25%, rebalancing may be needed
• Farm rewards are in CAKE; consider selling or restaking to compound
• Fee captures only if 24h volume > $10M on this pair
🔗 Open in PancakeSwap:
https://pancakeswap.finance/add/0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82/BNB/2500?chain=bsc
# macOS
open "https://pancakeswap.finance/add/..."
# Linux
xdg-open "https://pancakeswap.finance/add/..."
# Windows (Git Bash)
start "https://pancakeswap.finance/add/..."
If the open command fails, display the URL prominently so the user can copy it.
Before presenting a deep link to the user, confirm all of the following:
name(), symbol(), decimals()references/data-providers.md for DexScreener, DefiLlama, and PancakeSwap API endpointsreferences/position-types.md for V2 vs. V3 vs. StableSwap comparison matrices共 1 个版本