Skip to content

FAQ(s)

Q1: Are rebasing token supported?

Rebasing tokens are not natively supported in PancakeSwap v3. Such tokens interfere with internal pool accounting and may lead to losses for liquidity providers.

Workarounds:
  • Use PancakeSwap v2, which does not rely on concentrated liquidity accounting.
  • Use a wrapped version of the rebasing token.

Q2: Are fee-on-transfer token supported?

Fee-on-transfer tokens are not supported by the router with v3. Using them will result in an IIA error.

Workarounds:
  • Use PancakeSwap v2, which has more lenient routing.
  • Disable the transfer fee for v3 swaps.
  • Implement a custom router that supports fee-on-transfer tokens.

Q3: What are the key differences between Uniswap v3 and PancakeSwap v3?

1. Fee Tier and Tick Spacing

Both Uniswap and PancakeSwap supports multiple fee tiers. Each fee tier maps to tick spacing. For other fee tiers -> tick spacing, both PancakeSwap and Uniswap have the same fee tier to tick spacing except for the below:

  • Uniswap v3: 0.3% fee tier with 60 tick spacing.
  • PancakeSwap v3: 0.25% fee tier with 50 tick spacing.

Lower tick spacing can offer better trade execution. Other fee tiers generally have similar spacing differences.

2. Liquidity Mining Pool (LMPool)

In PancakeSwap v3, when a pool has an active farm, an LMPool is assigned to the corresponding PancakeV3Pool.

  • On each swap, the LMPool is notified to track rewardGrowth, which will be used to calculate CAKE rewards for each LP.
  • This ensures that LPs who stake in MasterChefV3 receive rewards proportionate to the fees generated by their positions.

Q4: How to calculate lpFee APR?

Step 1: Calculate the Total Swap Fees (in USD)

Track the total amount of fees generated over a defined time period—commonly the last 24 hours—using an indexer or subgraph on the PancakeV3Pool.sol contract.

Focus on swaps where amount0 or amount1 is positive, indicating input tokens. Convert those values to USD using price oracles or token price feeds.

event Swap(
    address indexed sender,
    address indexed recipient,
    int256 amount0,  // if positive, it's an input token
    int256 amount1,  // if positive, it's an input token
    uint160 sqrtPriceX96,
    uint128 liquidity,
    int24 tick,
    uint128 protocolFeesToken0,
    uint128 protocolFeesToken1
);

Step 2: Check the Pool's Total TVL

You can determine the Total Value Locked (TVL) of the pool in several ways:

⚠️ Note: Manually checked TVL may overestimate the actual active liquidity, as it includes unclaimed fees.

Step 3: Calculate the lpFee

Use the formula:

lpFeeAPR = (daily_fee_usd * 365 * fee_tier) / TVL

Example Calculation: Assume:

  • Swap volume in last 24 hours = $20 million
  • Fee tier = 0.01% (or 0.0001)
  • TVL = $10 million

Then:

daily_fee = 20,000,000 * 0.0001 = $2,000

lpFeeAPR = (2,000 * 365) / 10,000,000 = 0.073 = 7.3%

Q5: How to calculate farm APR?

Step 1: Step 1: Calculate the Amount of CAKE Distributed Per Year

  1. Get cake per second: Query the amount of CAKE distributed per second:
masterChefV3.latestPeriodCakePerSecond()
  1. Get total allocation points for MasterChefV3
masterChefV3.totalAllocPoint()
  1. Get allocation points for the specific pool:
masterChefV3.poolInfo(pool_index)

Example Calculation: Assume:

  • cakePerSecond = 0.2
  • totalAllocPoint = 100
  • poolAllocPoint = 10

Then:

poolShare = (10 / 100) * 0.2 = 0.02 CAKE/sec
yearlyCAKE = 0.02 * 86,400 * 365 = 630,720 CAKE/year

Step 2: Check the Pool's Total TVL

You can determine the Total Value Locked (TVL) of the pool in several ways:

⚠️ Note: Manually checked TVL may overestimate the actual active liquidity, as it includes unclaimed fees.

Step 3: Calculate the Farm APR

Use the formula:

farmAPR = (Yearly Value of CAKE Rewards) / TVL

Example Calculation: Assume:

  • CAKE distributed per year = 630,720
  • CAKE price = $2
  • TVL of pool = $10,000,000

Then:

farmAPR = (630,720 * 2) / 10,000,000 = 12.61%

Q6: Are LP or Protocol Fees Considered Part of V3 Pool Liquidity?

No, fees (both LP and protocol) are not part of the pool's active liquidity in PancakeSwap V3.

However, if you manually check the TVL by querying the pool’s token0 and token1 balances, the value will include any unclaimed fees. This can lead to an overestimation of actual active liquidity.