bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 8쪽
// number of CAKE locked at the start of the lock period.
}
```
**CAKE staking amount (before subtracting all the fees)**
```
const userInfo. = await CakePoolContract.userInfo(address);
const PricePerFullShare = await CakePoolContract.getPricePerFullShare();
const cakeAmount = userInfo.shares * PricePerFullShare / 1e18 - userInfo.userBoostedShare ; // cake amount (wei), in flexible staking, userInfo.userBoostedShare should be 0.
```
**Performance Fee**
Query from contract:
```
const performanceFeeAmount = await CakePoolContract.calculatePerformanceFee(address);
```
Calculate it manually:
```
async function calculatePerformanceFeeAmount(_user:address){
const user = await CakePoolContract.userInfo(address);
const isFreeFee = await CakePoolContract.freeFeeUsers(_user); //normal free fee users are some special contracts , so you can set default false
if(user.shares > 0 && !user.locked && !isFreeFee){
const PricePerFullShare = await CakePoolContract.getPricePerFullShare();
uint256 totalAmount = user.shares * PricePerFullShare / 1e18;
uint256 earnAmount = totalAmount - user.cakeAtLastUserAction;
uint256 performanceFee = await CakePoolContract.performanceFee();
uint256 currentPerformanceFee = (earnAmount * performanceFee) / 10000;
return currentPerformanceFee;
}
return 0;
}
```
**Overdue Fee: (only applies to locked staking)**
Query from contract:
```
const overdueFeeAmount = await CakePoolContract.calculateOverdueFee(address);
```
Calculate it manually:
```
async function calculateOverdueFee(_user:address){
const user = await CakePoolContract.userInfo(address);
const isFreeFee = await CakePoolContract.freeFeeUsers(_user); //normal free fee users are some special contracts , so you can set default false
const UNLOCK_FREE_DURATION = 1 week seconds (or you can get from smart contract, const UNLOCK_FREE_DURATION = await CakePoolContract.UNLOCK_FREE_DURATION())
const DURATION_FACTOR_OVERDUE = 180 * 24 * 3600; // 180 days, in order to calculate overdue fee. you can get it from contract too.
if (
user.shares > 0 &&
user.locked &&
!isFreeFee &&
((user.lockEndTime + UNLOCK_FREE_DURATION) < block.timestamp)
) {
const PricePerFullShare = await CakePoolContract.getPricePerFullShare();
uint256 currentAmount = user.shares * PricePerFullShare / 1e18 - user.userBoostedShare;
uint256 earnAmount = currentAmount - user.lockedAmount;
uint256 overdueDuration = block.timestamp - user.lockEndTime - UNLOCK_FREE_DURATION; // you can use UTC timestamp to replace current block.timestamp.
if (overdueDuration > DURATION_FACTOR_OVERDUE) {
overdueDuration = DURATION_FACTOR_OVERDUE;
}
// Rates are calculated based on the user's overdue duration.
uint256 overdueWeight = (overdueDuration * overdueFee) / DURATION_FACTOR_OVERDUE;
uint256 currentOverdueFee = (earnAmount * overdueWeight) / PRECISION_FACTOR;
return currentOverdueFee;
}
return 0;
}
```
**Withdraw Fee**
```
const user = await CakePoolContract.userInfo(address);
const withdrawFee = await CakePoolContract.withdrawFee();
const isFreeFee = await CakePoolContract.freeFeeUsers(_user); //normal free fee users are some special contracts , so you can set default false
let WithdrawFeeAmount = 0;
// you can use UTC timestamp to replace current block.timestamp.
// withdrawFeePeriod = 72 * 3600 (S)
// _amount : withdraw amount
if (!isFreeFee && (block.timestamp < user.lastDepositedTime + withdrawFeePeriod)) {
WithdrawFeeAmount = _amount * withdrawFee;
}
```
**CAKE staking amount (after subtracting all the fees)**
```
const user = await CakePoolContract.userInfo(address);
const cakeAmountWithoutFee = cakeAmount - (!user.locked ? performanceFeeAmount : overdueFeeAmount) - withdrawFeeAmount
```
#### Pending Rewards
Please note that the new pool does not require any compounding. Rewards are being put into your staking balance automatically.
However, you can query the number of CAKE earned since the last action, using the difference between the current staking balance (mentioned above), and the number from `userInfo.cakeAtLastUserAction`.
#### Withdraw
If you are using the `leaveStaking(uint256 _amount)` method on the current PancakeSwap MasterChef. You need to migrate to `withdraw(uint256 _shares)`.
When doing flexible staking. Please note that upon withdrawing, the pending reward fees will be calculated and cut from the number of users’ shares, the actual number of shares being withdrawn will be re-calibrated, based on the percentage of the shares you are withdrawing against the total shares you have. See the example below:
```
// the number of CAKE being withdrawn can be calculated by:
withdrawPercentage = _sharesToWithdraw / userInfo.shares
stakingBalance = userInfo.shares * PricePerFullShare / 1e18 - userInfo.userBoostedShare - !userInfo.locked ? calculatePerformanceFee(_userAddress) : calculateOverdueFee(_userAddress)
finalWithdrawAmount = withdrawPercentage * stakingBalance
```
Please note that the final receiving amount will be affected by withdraw fee. If your function relies crucially on the final number of CAKE being withdrawn, we recommend calculating that using the difference in CAKE balance before and after the withdrawal action:
```
cakeBalPrev = CAKE.balanceOf(address(this))
CakePool.withdraw(_sharesToWithdraw)
cakeBalNew = CAKE.balanceOf(address(this))
cakeWithdrawn = cakeBalNew - cakeBalPrev
```
Or, calculate and subtract the withdraw fee when estimating the amount.
#### How to calculate the CAKE per block distributed to the new CAKE pool?
Previously, the manual CAKE pool had a fixed 10 CAKE/block emission. After migrating to MasterChef v2 and the new CAKE pool, we can now adjust its emissions.
And here's how you can calculate the CAKE per block distributed to the new CAKE pool:
`cakePerBlockToPool = MasterChef.cakePerBlock(false) * (cakePool.allocPoint / MasterChef.totalSpecialAllocPoint)`
You can query the `cakePool.allocPoint` using `MasterChef.poolInfo(0)`
### **Mainnet Contract Address**
**Contract name:** CakePool\
**Contract address:** `0x45c54210128a065de780C4B0Df3d16664f7f859e`
[View the PancakeSwap: Cake Pool Contract on BscScan.](https://bscscan.com/address/0x45c54210128a065de780C4B0Df3d16664f7f859e)
### **Testnet Environment**
You can use the following testnet environment to test the integration of your project with the new PancakeSwap CAKE Pool. 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`)
* $WBNB: `0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd`
#### Factory and Router
* Factory v2: `0x6725F303b657a9451d8BA641348b6761A6CC7a17`
* Router v2: `0xD99D1c33F9fC3444f8101754aBC46c52416550D1`
#### MasterChefs
* v1: `0x1ED62c7b76AD29Bfb80F3329d1ce7e760aAD153d`
* pid0: Manual CAKE
* pid4: Dummy Pool for MasterChef v2
* v2: `0xB4A466911556e39210a6bB2FaECBB59E4eB7E43d`
#### New CAKE Pool
`0x683433ba14e8F26774D43D3E90DA6Dd7a22044Fe`
# Roadmap
*Updated on Jun 1, 2026*
## Our vision: the universal liquidity layer of crypto
All of crypto should route through PancakeSwap. Our **AMMs** and **PCSX** are the rails every trade settles against; our **aggregator** wins the customer with the best price anywhere and routes that demand back into our own liquidity. More flow deepens liquidity, which sharpens execution, which wins more users — and the revenue it generates buys back and burns **CAKE**, tying the token directly to real usage. Increasingly, the traders won't even be human: as AI agents become crypto's newest economic actors, we intend to be the liquidity layer they plug into. Liquidity in, supply out.
***
#### Aggregator — owning the customer relationship
Best price in crypto, every time, on one surface across every chain — then we route that demand into our own rails.
* **Now:** best-price routing across PancakeSwap + external venues; multichain (BNB, ETH, Base, Arbitrum, Solana, and more); sub-second quotes on our own infra
* **Next:** cross-chain aggregated swaps; broader venue and chain coverage
#### AMM — the foundation of liquidity
PancakeSwap Infinity makes our AMM the most extensible, capital-efficient liquidity primitive in DeFi.
* **Now:** more v4 hooks, e.g. dynamic fees hooks, stableswap hooks
* **Next:** a growing ecosystem of hooks; more chains; advanced LP tooling
#### PCSX — the rail specifically built for RWA
Intent-based settlement that connects users to professional market makers, covering fills the pool model can't.
* **Now:** RFQ fills with pro market makers; powering tokenized RWAs
* **Next:** deeper MM network; cross-chain settlement
#### Perps — pro-grade derivatives onchain
A derivatives venue that rivals any platform, without giving up self-custody.
* **Now:** advanced order types (limit, stop, TP/SL); AI copilot for one-click strategies; precise position management, loss rebate mechanisms
* **Next:** advanced trader tooling, more gamified features
#### Agentic — trading that acts for you
The next interface isn't a screen, it's an agent. We're evolving from assisting trades to executing them — and opening our rails to the AI agents becoming crypto's newest traders.
* **Now:** AI skills, AI copilot that turns intent into one-click strategies
* **Next:** autonomous agents that execute and rebalance on your behalf; natural-language trading; agent-accessible APIs so third-party AI routes its flow through our liquidity
#### Tokenized Stock — real-world markets on our rails
A dedicated EVM home for trading tokenized equities, settling through our own liquidity.
* **Now:** dedicated stock terminal; live charts and on-chain data; expanding asset list
* **Next:** more equities and RWAs; more chains; limit order and DCA
#### Other optimizations
The invisible work that compounds: faster flows, simpler onboarding, a stronger mobile experience, deeper multichain reach, and higher reliability at scale.
***
*Crypto moves fast, and so do we — no fixed timelines, just a constant direction: become the universal liquidity layer of crypto, win the customer with the best execution anywhere, route the world's onchain trading (human and agent) through our rails, and return that value to CAKE.*
# veCAKE Sunset
As part of the [Tokenomics 3.0 upgrade](https://pancakeswap.finance/voting/proposal/0x79ef496c9737e48d9677a6e291ff2a549dee6729c9996398e453af8ecbf0ceb3), veCAKE and its connected products are being sunset. Here’s a breakdown of the **some main product areas** affected and when the changes will take effect:
## Which products are affected?
1. **veCAKE and Gauges Voting**
* Starting **00:00 AM UTC April 23, 2025**, veCAKE and all gauge voting will be retired.
* The final gauge voting will end on **00:00 AM UTC, April 23, 2025 (Epoch 37)**
* Results from Epoch 37 will be executed in **Epoch 38 (April 25 – May 6)**.
* **Gauges rewards**, including veCAKE Pool APR and Bribe APR, will continue to accrue **until May 7, 2025**.
2. **Yield farming**
Boosts (from veCAKE) will be phased out across position managers, Syrup Pools, and farming activities between **April 24 and May 7, 2025**.
3. Revenue Sharing
**5% Revenue Sharing** from trading fees will end on **00:00 UTC on May 7, 2025**. Funds that were previously allocated to revenue sharing will now be redirected to the **CAKE burn mechanism**, increasing the burn rate for these pools from **10% to 15%**.
{% hint style="info" %}
🧭 **Note**: The PancakeSwap website will be updated progressively to reflect the full retirement of veCAKE-related features across the platform.
{% endhint %}
## What actions do you need to take?
{% hint style="info" %}
Cake Redemption Guide: [Staked Cake Redemption](/welcome-to-pancakeswap/vecake-sunset/staked-cake-redemption)
{% endhint %}
1. **Claim Rewards**: To earn rewards from the final **Epoch 38** (April 25–May 7, 2025), make sure **not to withdraw your CAKE before 00:00 AM UTC, May 7, 2025**.
2. **Redeem CAKE/veCAKE:** Users who have directly staked CAKE through the PancakeSwap interface have 6 months to redeem their staked CAKE and veCAKE, with the redemption **deadline set for October 23, 2025.**<br>
For veCAKE linked to **veCAKE managers (e.g., Aster, StakeDAO, CakePie),** PancakeSwap will whitelist the delegator addresses for locker protocols that enable 1:1 redemptions. These protocols will launch a redemption page on their interfaces, allowing users who have staked with them to redeem their xCAKE for CAKE on a **1:1 basis. Please refer to the respective veCAKE Managers’ announcements for more detail** .
For more on these changes, check out:
* 📖 [CAKE Tokenomics 3.0 Docs](https://docs.pancakeswap.finance/protocol/cake-tokenomics)
* 📝 [Blog Post: What You Need to Know](https://blog.pancakeswap.finance/articles/implementation-of-cake-tokenomics-3-0-what-you-need-to-know)
# Staked Cake Redemption
{% hint style="info" %}
Staked Cake Redemption site: <https://pancakeswap.finance/cake-staking/redeem>
{% endhint %}
## How does veCAKE claiming work?
#### 1. Connect Your Wallet
Before you do anything, connect your wallet to the claiming page.
> ⚠️ Note: Rewards and balances will only display after your wallet is connected. If the displayed balance is "-", there are no CAKE / CAKE rewards available to claim.
<figure><img src="https://2908774936-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MHREX7DHcljbY5IkjgJ-1972196547%2Fuploads%2FOSgpAbxz1bTzypdAQp4V%2Fno%20balance.png?alt=media&token=ca0873c3-0ae8-4cee-94e9-e769bd700a9a" alt=""><figcaption></figcaption></figure>
#### 2. View Your Balances & Rewards
Once connected, you’ll see the following information:
1. **veCAKE Balance**: Your current amount of veCAKE.
2. **Locked CAKE**: The amount of CAKE you originally staked in the veCAKE Pool.
3. **Original Unlock Date**: Original Date veCAKE will unlock
\*\* With the passing of the [Tokenomics 3.0 Proposal](https://blog.pancakeswap.finance/articles/implementation-of-cake-tokenomics-3-0-what-you-need-to-know), **all locked CAKE is now scheduled to unlock on April 23, 2025, at 9:00 UTC**.
4. **My Total Rewards**: The total CAKE you’re eligible to redeem and claim, made up of:
* **Cake Pool Rewards**: Legacy CAKE Pool rewards
* **Revenue Sharing Rewards**: Earned from staking CAKE ([More info](https://docs.pancakeswap.finance/welcome-to-pancakeswap/vecake-sunset/archive-vecake/earn-cake-weekly))
<figure><img src="https://2908774936-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MHREX7DHcljbY5IkjgJ-1972196547%2Fuploads%2Fn42PhojwM1328VklJeJn%2FConnected%20view%20balance.png?alt=media&token=4adab52b-d856-4a4e-9115-d489d5ef6fa0" alt=""><figcaption></figcaption></figure>
#### 3. Redeem & Claim
Click **‘Redeem & Claim**’ to start. Once the transaction is successful, your CAKE will appear in your wallet.
> 📝 You’ll need to sign and approve the transaction(s) in your wallet to complete the claim.
<figure><img src="https://2908774936-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MHREX7DHcljbY5IkjgJ-1972196547%2Fuploads%2FmuU0MBX31ZJaxuhxVnBJ%2FTxn%20sent.png?alt=media&token=c9dc6c57-ae9c-44ef-bdfd-a608649a2f64" alt=""><figcaption></figcaption></figure>
<figure><img src="https://2908774936-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MHREX7DHcljbY5IkjgJ-1972196547%2Fuploads%2F7DAsWnOORREa4SWdEbap%2Fclaim%20all.png?alt=media&token=67c03637-1d54-4d53-ae91-3d9315e9593a" alt=""><figcaption></figcaption></figure>
#### 4. Double-Check for Multiple Claims
In some cases, your rewards may be split across multiple claim sessions if the reward is large.
> ✅ To ensure you've claimed everything, check that the "My Total Rewards" balance is "-" or 0 after completing the process.
<figure><img src="https://2908774936-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MHREX7DHcljbY5IkjgJ-1972196547%2Fuploads%2FOSgpAbxz1bTzypdAQp4V%2Fno%20balance.png?alt=media&token=ca0873c3-0ae8-4cee-94e9-e769bd700a9a" alt=""><figcaption></figcaption></figure>
# \[Archive] veCAKE
Stake CAKE, Earn CAKE, and much more!
<figure><img src="https://2908774936-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MHREX7DHcljbY5IkjgJ-1972196547%2Fuploads%2FQBwUntAJSdUnClrURzI7%2Fimage.png?alt=media&token=a13db7d5-eb1f-47bd-abcd-db99a84a7f03" alt=""><figcaption></figcaption></figure>
{% hint style="danger" %}
\[ARCHIVED] veCAKE
{% endhint %}
veCAKE stands for vote-escrowed CAKE. veCAKE tokens serve a crucial role in PancakeSwap's governance, enabling you to actively participate in [PancakeSwap’s governance proposals](https://pancakeswap.finance/voting) and Gauges Voting system. This allows you to vote on broader governance proposals and influence the allocation of CAKE emissions within liquidity pools.
Gauges Voting empowers veCAKE holders to shape the distribution of CAKE emissions across essential products like Farms on BNB Chain, Ethereum, and Arbitrum at launch. By leveraging veCAKE, users directly influence how CAKE emissions are allocated within each pool, impacting specific liquidity pools and projects. The more veCAKE a pool accumulates through Gauges Voting, the higher the CAKE emissions allocated, leading to increased rewards for liquidity providers (LPs) during subsequent 14-day epochs.
Lock CAKE for any durations from 1 week to 4 years to get veCAKE. Your veCAKE amount is based on the number of your locked CAKE and the duration you locked them for.
{% content-ref url="/pages/4nGPFBymi9J71g6OmnO7" %}
[What is veCAKE?](/welcome-to-pancakeswap/vecake-sunset/archive-vecake/what-is-vecake)
{% endcontent-ref %}
Here are the guides for how to get veCAKE, either by creating a new position, or migrating from the CAKE staking pool:
{% content-ref url="/pages/MmuUgGJKfAOKoXWI58z7" %}
[How to get veCAKE?](/welcome-to-pancakeswap/vecake-sunset/archive-vecake/how-to-get-vecake)
{% endcontent-ref %}
{% content-ref url="/pages/BkGUKyw6vKcqdlsZQJjD" %}
[Migrate from CAKE Pool](/welcome-to-pancakeswap/vecake-sunset/archive-vecake/migrate-from-cake-pool)
{% endcontent-ref %}
Learn more about our veCAKE ecosystem partners (veCAKE Managers) here:
{% content-ref url="/pages/Gp0u2FqHtF46hXAKGZXa" %}
[veCAKE Managers](/welcome-to-pancakeswap/vecake-sunset/archive-vecake/vecake-managers)
{% endcontent-ref %}
For other questions, please check out:
{% content-ref url="/pages/dZFK8q8q4TfJmBRh90FI" %}
[veCAKE FAQ](/earn/earn-faq/cake-staking-faq/vecake-faq)
{% endcontent-ref %}
# What is veCAKE?
<figure><img src="https://2908774936-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MHREX7DHcljbY5IkjgJ-1972196547%2Fuploads%2FTrzRCNSrR74YXHqr65Pj%2Fimage.png?alt=media&token=09df3d67-9e7d-4d8a-8602-92891c7fdd25" alt=""><figcaption></figcaption></figure>
## **What is veCAKE?**
veCAKE stands for vote-escrowed CAKE. It is not transferable, and the only way to acquire veCAKE is by staking CAKE. The maximum lock time is 4 years; the longer you lock your CAKE, the more veCAKE you’ll receive.
## **What is the purpose of veCAKE?**
veCAKE tokens serve a crucial role in PancakeSwap's governance, enabling you to actively participate in PancakeSwap’s [governance proposals ](https://pancakeswap.finance/voting)and Gauges Voting system. This allows you to vote on broader governance proposals and influence the allocation of CAKE emissions within liquidity pools.
## **What are the benefits of holding veCAKE?**
**Weekly Rewards:** Claim CAKE rewards regularly through CAKE Staking and Revenue Sharing.
{% content-ref url="/pages/60ll5WPMYwZbWNlTwMH5" %}
[Earn CAKE Weekly](/welcome-to-pancakeswap/vecake-sunset/archive-vecake/earn-cake-weekly)
{% endcontent-ref %}
**Gauges Voting Participation:** Influence and boost CAKE emissions in your preferred pools, by engagi프로젝트로 돌아가기