PancakeSwap
Launch App
English
English
  • Welcome to PancakeSwap
    • Product Overview
    • ✨How-to Guides
      • Get Started (BSC)
        • Create a Wallet
        • Get BEP20 Tokens
        • Using PancakeSwap without Centralized Exchanges
        • Connect Your Wallet to PancakeSwap
      • Get Started (Aptos)
        • Create a Wallet
        • Get Aptos Coins
        • CAKE Bridging Guide
        • Connect Your Wallet to PancakeSwap
        • Aptos FAQ
      • V3/V2 Migration
        • How to migrate
        • How v3 APR is calculated
        • FAQ
        • V2 Migration
          • Migrate Your Stakings
          • MasterChef v2
            • List of Farms
          • CAKE Syrup Pool
    • 🗺️Roadmap
    • veCAKE Sunset
      • Staked Cake Redemption
      • 🔷[Archive] veCAKE
        • What is veCAKE?
        • How to get veCAKE?
        • Migrate from CAKE Pool
        • veCAKE Managers
        • Bridge your veCAKE
        • Earn CAKE Weekly
          • FAQ
    • 📈Analytics (Info Page)
    • ✅Audits
    • 🤙Contact Us
      • Social Accounts
      • Telegram & Discord Communities
      • 💼Business Partnerships
        • ⛽veCAKE / Gauges
        • 🧑‍🌾Initial Farm Offerings - IFOs
        • 🥞Syrup Pools and Farms
        • 🖼️NFT Marketplace
        • ❓Commonly Asked Business Partnerships Questions
      • Ambassador Program
        • What can you do as an Ambassador?
        • Benefits of a PancakeSwap Ambassador
        • Want to be an Ambassador?
        • ❓ FAQs Page
      • General FAQ
        • I need help
        • Troubleshooting Errors
        • What is an Approval Transaction?
        • Fixing Stuck Pending Transactions on MetaMask
    • 👨‍👨‍👦About Us
      • Team
        • The Kitchen Team
        • Become a Chef
          • Brand / Graphics Designer
          • Motion / Interaction Designer
          • Social Media & Content Manager
          • Developer Relations Manager
          • Product Designer (UX/I)
          • Business Development Manager
          • Senior Backend Engineer
      • Brand & Logos
  • 👴Archive
    • 📂Legacy Products
      • 🖼️[Archived] NFT Marketplace
      • 🎮[Archived] Gaming Platform
        • 📒Brand Kit
        • 🎓Pancake Mayor
        • 🛡️Pancake Protectors
          • FAQ
      • 🍯[Archived] Pottery
        • How to Play Pottery
        • Pottery FAQ
      • 🧈[Archived] Trading Reward
        • How to Participate
          • Top Traders Campaign
          • CAKE Stakers Campaign
        • FAQ
      • 🤝[Archived] Simple Staking
        • How to start Simple Staking
        • FAQ
        • Terms & Conditions
      • 🎯[Archived] PancakeSwap Quest
        • Getting Started
        • How to Join and Complete a Quest
        • Rewards
      • 💧[Archived] Liquid Staking Integration
        • How To Liquid Stake
        • WBETH
          • WBETH FAQ
        • SnBNB
          • SnBNB FAQ
      • 💸[Archived] Options
        • Options Primer
        • CLAMM Options
        • Options FAQ
      • [Archived] CAKE Syrup Pool
        • How to use the Flexible Staking option
        • How to use the Fixed-Term Staking option
    • Old Tokenomics
      • CAKE Tokenomics v1
      • Controlling CAKE supply v1
    • How to Use Farms with BscScan
    • [Archived] Affiliate Program
      • Dashboard & Link
      • Commission Structure and Payment
      • Program Rules & Guidelines
      • Terms & Conditions
  • Trade
    • 🔄Swap
      • Token Swaps
      • How to Trade
      • Fees and Routes
      • Market Maker Integration
      • Smart Router (V2)
        • How to trade using Smart Router
    • ♾️PancakeSwap Infinity
      • Key Features
      • Hooks
        • Dynamic Fee Hook
      • Pool Types
      • Farms
    • 🎯Limit Orders and Twap
      • How to use Limit Orders
      • How to use TWAP
    • 📈Perpetual Trading
      • What is Perpetual Trading?
      • Perpetual Trading V2
        • How can I use it?
        • Dumb Mode
          • Dumb Mode Guide
        • Degen Mode
          • Degen Mode Dynamic Fee
        • MADBTCUSD
          • MADBTCUSD FAQ
        • Perpetuals V2 Glossary
        • Forex
        • Perpetual Trading FAQ
          • Arbitrum
            • ALP Syrup Pool (Arbitrum)
              • ALP Buying & Selling Fees
        • Trading Rewards Program
          • Arbitrum
        • Supported Chains, Modes & Markets
      • Perpetual Trading V1
        • Perpetuals V1 Glossary
        • How can I use it?
        • V1 Perpetual Trading FAQ
    • 🏦Stableswap
      • How to StableSwap
    • 💳Buy Crypto
    • ❓Trading FAQ
      • Swap FAQ
      • v4 FAQ
      • Limit Orders and TWAP FAQ
  • Bridge
    • 🌉Bridging
      • Between EVMs
      • Between EVM and Aptos
      • Wormhole Bridge Guide
    • ❓Bridging FAQ
      • Wormhole Bridge FAQ
  • Earn
    • 🌊Liquidity Pools
      • How to Add/Remove Liquidity
      • ⛏️Pancake Picks
      • Zap
        • Zap (V2)
    • 🚜Yield Farming
      • How to Use Farms
        • How to Use Farms (Legacy)
      • APR/ROI/IL Calculator
      • Farming on Aptos
        • FAQ
      • Crosschain Farming
        • FAQ
    • 🥩Cake Staking
      • 🍯Syrup Pools - Stake CAKE
        • Syrup Pools
    • 🛍️IFO (Initial Farm Offering)
      • How to Participate in an IFO
      • How to Participate in CrossChain IFOs
      • FAQ
      • NFT Profile System
        • How to Set Up an NFT Profile
        • Teams
      • Contract Details
    • ❓Earn FAQ
      • Cake Staking FAQ
        • Syrup Pool FAQ & Troubleshooting
  • Play
    • 🔮Prediction
      • How to Use Prediction
      • AI Prediction
      • Prediction FAQ
      • Prediction Troubleshooting
      • Prediction Mini App
    • 🎟️Lottery
      • How to Play Lottery
      • Lottery FAQ
  • ❓Play FAQ
  • Trading Tools
    • 🛡️PancakeSwap MEV Guard
    • PancakeSwap Auto Slippage
      • How to Set Slippage on PancakeSwap
    • 🔔Notifications
    • ❓Trading Tools FAQ
      • MEV Guard FAQ
  • Protocol
    • 🍰CAKE Tokenomics
    • 📔Governance
      • How to Vote
    • 💻Developers
      • Developer Docs
      • Contributing
        • Codebase Overview
Powered by GitBook
On this page
  • Do I need to migrate?
  • Overview
  • Mainnet Contract Address
  • Testnet Environment

Was this helpful?

  1. Welcome to PancakeSwap
  2. How-to Guides
  3. V3/V2 Migration
  4. V2 Migration

MasterChef v2

Migrate to MasterChef v2

PreviousMigrate Your StakingsNextList of Farms

Last updated 3 years ago

Was this helpful?

PancakeSwap MasterChef v2 is a new main staking contract for Farms while providing more flexibility for adjusting the $CAKE emissions, including CAKE pool, burn and other PancakeSwap products.

Do I need to migrate?

If you are currently using PancakeSwap MasterChef (), you will need to migrate to the new contract ().

Overview

Deposit

If you are currently using the enterStaking(uint256 _amount) on the current PancakeSwap MasterChef. You need to migrate to the new CAKE pool contract. Check out the related documentation .

The deposit function for the farm pools is unchanged. However, you will need to upgrade the MasterChef address and the pid , check out the for the list of new pids on MasterChef v2.

Pool types

MasterChef v2 have 2 types of pool: Regular farm pools and Special farm pools, which you can use poolInfo(_pid).isRegular to query the pool type. They share a different totalAllocPoint, making them two sets of independent pools.

Special farm pools: only whitelisted addresses can deposit. They are usually utilized by internal PancakeSwap products for rewards distributions.

Regular farm pools: the regular LP tokens farms. For example CAKE-BNB, BNB-BUSD, etc…

Withdraw

If you are currently using the leaveStaking(uint256 _amount) on the current PancakeSwap MasterChef. You need to migrate to the new CAKE pool contract. Check out the related documentation .

The withdraw function for the farm pools is unchanged. However, you will need to update the MasterChef address and the pid , check out the for the list of new pids on MasterChef v2.

Staking Balance

Use userInfo[_pid][_user].amount to query the staking balance.

Staking Token

Note that the new PoolInfo struct does not contain the lp token address field, you will need to use lpToken(_pid) to query any given pool's staking token.

Total Staking Shares/Amount

Use lpToken.balanceOf(MasterChef.address) to get the total staking amount for any given farm pool.

However, In MasterChef v2, the users' share can be boosted (coming soon). Therefore, rewards are calculated using a new totalBoostedShare field in PoolInfo as each pool’s total shares. For example, if pool 0 has 2 users, user1 stake 100 LPs (without boost), user2 stake 100 (with boostMultiplier being 1.05), then the totalBoostedShare will become 205. Resulting in user2 gaining more rewards.

CakePerBlock

You can use cakePerBlock(bool _isRegular) to query the CAKE reward per block that goes to all the PancakeSwap farms.

Mainnet Contract Address

Contract name: MasterChef v2 Contract address: 0xa5f8C5Dbd5F286960b9d90548680aE5ebFf07652

Testnet Environment

You can use the following testnet environment to test the integration of your project with the new PancakeSwap MasterChef v2. If you have any questions, please contact our team via the existing channels, or reach out to bun@pancakeswap.com via Email.

Dummy Tokens:

  • $CAKE: 0xFa60D973F7642B748046464e165A65B7323b0DEE (mintable by using mint(address _to, uint256 _amount) public)

  • $BUSD: 0x8516Fc284AEEaa0374E66037BD2309349FF728eA (mintable by using mint(uint256 amount) public)

  • $WBNB: 0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd

Factory and Router

  • Factory v2: 0x6725F303b657a9451d8BA641348b6761A6CC7a17

  • Router v2: 0xD99D1c33F9fC3444f8101754aBC46c52416550D1

LP Pairs

  • CAKE-WBNB: 0xa96818CA65B57bEc2155Ba5c81a70151f63300CD

  • CAKE-BUSD: 0xb98C30fA9f5e9cf6749B7021b4DDc0DBFe73b73e

MasterChefs

  • v1: 0x1ED62c7b76AD29Bfb80F3329d1ce7e760aAD153d

    • pid0: Manual CAKE

    • pid4: Dummy Pool for MasterChef v2

    • pid5: CAKE-BUSD: 0xb98C30fA9f5e9cf6749B7021b4DDc0DBFe73b73e

    • pid6: CAKE-WBNB: 0xa96818CA65B57bEc2155Ba5c81a70151f63300CD

  • v2: 0xB4A466911556e39210a6bB2FaECBB59E4eB7E43d

    • pid3: CAKE-BUSD: 0xb98C30fA9f5e9cf6749B7021b4DDc0DBFe73b73e

    • pid4: CAKE-WBNB: 0xa96818CA65B57bEc2155Ba5c81a70151f63300CD

✨
0x73feaa1eE314F8c655E354234017bE2193C9E24E
0xa5f8C5Dbd5F286960b9d90548680aE5ebFf07652
here
list of farms
here
list of farms
View the PancakeSwap: Main Staking Contract v2 on BscScan.