bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 51쪽
#### 2. Select Tokens and Amounts
Choose up to **two tokens** to include in your gift:
* **One BEP-20 token** (required) — e.g., CAKE
* **One native gas token** (optional) — e.g., BNB
This setup lets you:
* Send usable tokens to the recipient
* Cover their gas so they can transact immediately
<figure><img src="https://2908774936-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MHREX7DHcljbY5IkjgJ-1972196547%2Fuploads%2FbRMg0WUJvfOpZRhi9OOT%2Fimage.png?alt=media&token=7f1db92e-3f4e-4240-997d-8a4bba34a9f9" alt="" width="311"><figcaption></figcaption></figure>
#### 3. Choose Gift Type
Select one of the following:
* 🔗 **Link** — Easy to copy and share via chat or socials
* 📱 **QR Code** — Perfect for in-person events or mobile users
> 💡 Each gift can only be claimed once, and only supports one delivery format (link or QR).
<figure><img src="https://2908774936-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MHREX7DHcljbY5IkjgJ-1972196547%2Fuploads%2FTgU2NzM23dQsCr5AVeN5%2Fimage.png?alt=media&token=168b0d9b-aae8-4495-85e1-ba3f8301af34" alt="" width="316"><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%2FiSzIrQypKNqpSRPRGgvM%2Fimage.png?alt=media&token=bec3d6ad-03ec-4fe8-9c42-4bd02039c427" alt="" width="311"><figcaption></figcaption></figure>
#### 4. Review Summary & Pay
Before confirming, review:
* **Gift Amount** — Total tokens included in the gift
* **Gift Claim Gas Fee** — Native tokens sender included for recipient to enjoy gasless claiming (\~$0.05 in BNB)
Once confirmed:
* The gift is created and stored on-chain
* You’ll receive a **link or QR code** — make sure to **save it before closing the popup**
{% hint style="danger" %}
If you close the popup without saving, the gift code cannot be retrieved later.
{% endhint %}
<figure><img src="https://2908774936-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MHREX7DHcljbY5IkjgJ-1972196547%2Fuploads%2FHnPHXEwZBjcan2FvrsmH%2Fimage.png?alt=media&token=02ecaf8c-687d-44d5-9b14-24a4ef8308b1" alt="" width="273"><figcaption></figcaption></figure>
***
### 📤 Step 2: Send or Share the Gift
After creation, you'll receive either:
* A **shareable Link**, and / or
* A **scannable QR Code**
You can share this via:
* Chat apps (Telegram, WhatsApp)
* Email
* Social media
* Direct message at events
Shareable Link
> Just sent you ${Gift\_Amount}! 🎉
>
> Tap this link to claim it: 👉 [https://pancakeswap.finance/invite/{Gift\_Code}](https://pancakeswap.finance/invite/%7BGift_Code%7D)
>
> Connect your wallet to complete the claim.
>
> Or, enter the code `{Gift_Code}` manually in the PancakeSwap Wallet.
QR Code
<figure><img src="https://2908774936-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MHREX7DHcljbY5IkjgJ-1972196547%2Fuploads%2FHDgtBakrI73ox6JG7wTR%2Fimage.png?alt=media&token=df330abc-4182-4e1d-b5d4-34b7849964ff" alt="" width="320"><figcaption></figcaption></figure>
***
### 🎉 Step 3: Claim a Gift
#### 1. After connecting wallet, tap the Link or Scan the QR Code
When the recipient:
* **Opens the link** or
* **Scans the QR code**
The app will autofill the gift code. If eligible and unclaimed, the gift claim UI will load.
<figure><img src="https://2908774936-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MHREX7DHcljbY5IkjgJ-1972196547%2Fuploads%2FoWBDdWhGH8LKRtmyMvwu%2Fimage.png?alt=media&token=75305eb3-61bb-4eae-8997-99431436a826" alt="" width="341"><figcaption></figcaption></figure>
If not, an error message will show (e.g. expired or already claimed).
<figure><img src="https://2908774936-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MHREX7DHcljbY5IkjgJ-1972196547%2Fuploads%2FOt1iALGFnBecKaPWevFP%2Fimage.png?alt=media&token=10dac6fc-2dbd-4a8a-85ca-917c584e4e6e" alt="" width="375"><figcaption></figcaption></figure>
***
#### 2. Approve & Receive Tokens
The recipient can claim **without paying any gas** (it’s already covered).
Once approved:
* The BEP-20 tokens (and gas token, if included) are deposited into their wallet
* The gift is marked as **claimed**
<figure><img src="https://2908774936-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MHREX7DHcljbY5IkjgJ-1972196547%2Fuploads%2FtgaC9gd80b9z0PXVYyTe%2Fimage.png?alt=media&token=31891da6-d7a6-43f8-9316-54e075d0fea0" alt="" width="375"><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%2FzH9oTAkWXsAOasshyCOJ%2Fimage.png?alt=media&token=e83bceb6-9753-4b14-ad13-e7c0ab67e9ce" alt="" width="244"><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%2F3Z66j4vXDrQmP1LNeeF8%2Fimage.png?alt=media&token=ebacaba7-f84a-4733-b063-b8fbdcfc9bae" alt="" width="334"><figcaption></figcaption></figure>
***
### ❌ Step 4: Cancel a Gift (If Unclaimed)
You can cancel a gift only if:
* It’s still **unclaimed**
* It’s still **within the expiry window** (default: 7 days)
To cancel:
1. Go to the **Gift History** tab
<figure><img src="https://2908774936-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MHREX7DHcljbY5IkjgJ-1972196547%2Fuploads%2FHBfYNgwzf59EXnc5Rhy4%2Fimage.png?alt=media&token=d32f7701-e5bb-46c4-b893-73a35099bb2d" alt="" width="308"><figcaption></figcaption></figure>
2. Find the gift
<figure><img src="https://2908774936-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MHREX7DHcljbY5IkjgJ-1972196547%2Fuploads%2FJyTB8ZQHNYm3T64auEpa%2Fimage.png?alt=media&token=68ccb451-d3e9-4dec-8f33-21593e2baf25" alt="" width="299"><figcaption></figcaption></figure>
3. Click **Cancel**
The tokens will be returned to your wallet (minus the gas sponsorship fee).
> ⚠️ Cancelled gifts cannot be reactivated or reused.
<figure><img src="https://2908774936-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MHREX7DHcljbY5IkjgJ-1972196547%2Fuploads%2F4TESrlruYzLyab3YUEI6%2FGroup%201410078707.png?alt=media&token=03145f23-4f95-44c7-a2eb-0faf8836cf12" alt="" width="563"><figcaption></figcaption></figure>
***
### ✅ That’s It!
You now know how to:
1. Create a Pancake Gift
2. Send it to someone via link or QR
3. Claim a gift sent to you
4. Cancel a gift if needed
Want to view your full gift history or check statuses? Just return to the **Gift tab** in the PancakeSwap Wallet.
# Pancake Gifts FAQ
This FAQ covers how Pancake Gifts work behind the scenes, what to expect in different scenarios, and why certain design choices were made.
***
## 1. 🔐 Gift Code Behavior & Access
### **1.1 Why isn’t the gift code stored?**
We **intentionally do not store** the gift code in:
* Frontend local storage
* Backend databases
This protects:
* User privacy
* Security against device compromise
* Accidental or malicious gift claims
### **1.2 Can I regenerate or retrieve the gift code later?**
No. The gift code:
* Is shown **only once** during creation
* Is embedded in the **link** or **QR code** generated
* Will **not be displayed again** in the UI or history
{% hint style="warning" %}
If the code is lost and you didn’t save the link or QR, the gift cannot be claimed manually. Instead, to retrieve your gift amount, you may manually cancel it.
{% endhint %}
### **1.3 Will the gift code still be embedded in the share link or QR?**
Yes:
* Share link includes the gift code (e.g. `pancakeswap.finance/gift#code=xxxx`)
* QR code also embeds the gift code, but **cannot be regenerated later.**
{% hint style="success" %}
**Pro Tip:** Download the image once it's generated
{% endhint %}
* Manual claims require the actual gift code — no fallback if the link/QR is lost
## 2. 🎁 Gift Status & Expiry
### **2.1 Can I view whether a gift has been claimed, cancelled, or expired?**
Yes. The **Gift History** section shows:
* Status: Pending / Claimed / Cancelled / Expired / Unclaimable
* Gift details (token, amount, type, chain, timestamps)
### **2.2 What happens when a gift expires?**
If a gift is not claimed within the default **7-day window**:
* The **entire gift amount is refunded** to the creator’s wallet
* The fixed **claim gas fee (\~$0.05) is not returned**
## 3. 🧠 Claim Logic & Limitations
### **3.1 Can users claim a gift on a different chain from the one it was created on?**
No. A gift is **chain-bound**:
* A gift created on **BSC** must be claimed on **BSC**
* Cross-chain gifting is not currently supported
## 4. ⛽ Gas Fees & Design
### **4.1 How is the fixed gas amount for gift creation decided?**
We set a flat gas price based on current BNB chain conditions (\~5 times current recommended Gas amount).
This buffer:
* Protects against sudden gas spikes
* Ensures gifts remain claimable under normal volatility
\
Example
* **Current recommended: 0.1 Gwei** (see: [BNB Gas Tracker](https://bscscan.com/gastracker))
* **Therefore, Fixed gas claim fee= 0.1 Gwei x 5 = 0.5 Gwei**
# Notifications
Receive your DeFi updates all in one place!
<figure><img src="https://lh7-us.googleusercontent.com/KuhB0fchwKb7jvN7cVj4BiO9ohoIwAS__z8-dU1JjRXHUZ_diEpe8fRnMhU4DqIN4u9-Io8RZZGhsDVhIC4AB5ohNablWz_wLYbL9R2C5YR263veplzKXA4R9mvifggqRWr7afdfK1MwaoIMPYKz6Ck" alt=""><figcaption></figcaption></figure>
### What are Web3 Notifications?
Web3 Notifications represent a leap forward in interacting with platforms for the latest news and updates. Integrated seamlessly into PancakeSwap, these notifications bring a host of benefits. Partnering with WalletConnect, we've launched the Notifications (BETA) for our users to access their DeFi news, updates and important actions all in one window. Please note that Web3 Notifications is still in BETA and will undergo further changes and developments in the coming months.
**Web3 Notifications Benefits:**
* Stay Updated with Real-Time Alerts: Never miss out on key PancakeSwap events, market trends, product updates, or community news.
* Prioritize What Matters to You: Selecting topics, products, and categories based on their relevance to you. Tailor your notifications with a variety of filters.
* Direct and Actionable Links: Respond quickly to crucial updates directly from your notifications, as each notification comes with a direct link.
### How to set up Notifications:
1. Activate with Ease: Visit our[ homepage](https://pancakeswap.finance/). Click the settings icon at the top left of the PancakeSwap menu and select "Allow Notifications".
<figure><img src="https://2908774936-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MHREX7DHcljbY5IkjgJ-1972196547%2Fuploads%2FWwfil6QC31vs5MGyqPoC%2Fweb-git-feat-web3-notifications-soft-launch.pancake.run__chain%3Dbsc%20(1).png?alt=media&token=e64877bd-b060-44e6-9555-0fa15ae30b3f" alt="" width="362"><figcaption></figcaption></figure>
2. Connect Wallet: Click the Bell icon on the top right and sign a message in your wallet to authorize notifications.
<figure><img src="https://2908774936-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MHREX7DHcljbY5IkjgJ-1972196547%2Fuploads%2FFvnS8g15VkUTTngc90cV%2Fweb-git-feat-web3-notifications-soft-launch.pancake.run__chain%3Dbsc%20(6).png?alt=media&token=0fe88944-f948-430e-8663-8d162214eec2" alt="" width="433"><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%2FFiKjgnVoUvS5dukNRbEV%2Fweb-git-feat-web3-notifications-soft-launch.pancake.run__chain%3Dbsc%20(4).png?alt=media&token=50da17e3-e5d6-4e89-b676-4e79dea89f48" alt="" width="293"><figcaption></figcaption></figure>
3. Customize Your Feed: Tailor your notification settings by selecting the drop-down on the left to match your interests and needs.
<figure><img src="https://2908774936-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MHREX7DHcljbY5IkjgJ-1972196547%2Fuploads%2FJ7sIALjRm9kBAv9wV6VA%2Fweb-git-feat-web3-notifications-soft-launch.pancake.run__chain%3Dbsc%20(5).png?alt=media&token=6217ce87-7ee2-41b7-a2fe-321b6d861f3d" alt=""><figcaption></figcaption></figure>
4. Stay Informed: Access all your notifications conveniently from the dropdown menu by clicking the bell icon.
### Notification Features
The current list of notifications are supported across all EVM chains and includes:
| Notification | Function |
| ------------------ | ------------------------------------------------------------ |
| Liquidity Position | Updates users to move liquidity position if its out of range |
| Farm | Updates users on farm APRs, or if there's a new farm |
| Wallet Balance | Updates users if they have low gas balance |
| Lottery | Updates users on Lottery draw |
| Prediction | Updates users to claim prediction reward |
| Price Alerts | Updates users on major price changes |
### What's Next?
* Enhanced Filtering: Fine-tuning notifications so that users receive the right information on time
* Multi-Platform: Support on Mobile and other platforms, potential cross-protocol functionality, making PancakeSwap the hub for your DeFi Activities
* More Notifications: Notifications for our other products and governance-related information such as new proposals.
# Trading Tools FAQ
(To be populated)
# MEV Guard FAQ
## What is MEV and Sandwich Attack?
MEV (Maximal Extractable Value) refers to the additional profit can earn by reordering or including transactions within a block.
A sandwich attack is a specific type of MEV attack where an attacker places one transaction before and one after a target transaction to manipulate the price of an asset for profit. This results in increased costs or worse outcomes for the victim.
## What is an MEV protected RPC endpoint?
It is a specialized gateway for interacting with a blockchain that helps safeguard users against MEV (Maximal Extractable Value) exploitation, such as sandwich attacks.
## How does MEV Guard protect me from attacks?
The endpoint routes transactions through private relays, along with other protection mechanisms to ensure that users’ transactions are processed securely and without interference, reducing the risk of slippage, price manipulation, or lost value.
## How do I Install MEV Guard?
Follow the page instructions to switch or add the MEV protected endpoint to your wallet.
If you are using MetaMask, it can be done via clicking the button. If you are using other wallets, please refer to the detail guides to add the network manually.
## How do I disable or remove MEV Guard?
If you are using MetaMask, simply switch your rpc endpoint back to the regular public nodes. If you are using other wallets, please refer to the detail guides to switch the network back to public nodes manually.
# Building Trading Agents on PancakeSwap V3
While this page provides an overview, please visit [pancakeswap.ai](https://pancakeswap.ai) for more info
> A guide for developers building autonomous agents — with [BNB Agent Studio](https://www.bnbchain.org/en/bnb-agent-studio) or any framework — that interact with PancakeSwap V3 liquidity pools and farms on BNB Smart Chain.
>
> You describe a strategy; your agent executes it on-chain, unattended. This page covers the PancakeSwap half: the contracts to call, the safe order to call them in, and a complete worked example (an automated V3 range rebalancer). For how to describe, build, and deploy the agent itself, see the BNB Agent Studio docs.
PancakeSwap requires **no integration** for this to work. V3 pools and farms are permissionless smart contracts — your agent calls them directly, the same way the PancakeSwap front end does. Everything below is public on-chain surface.
***
### 1. What an agent can do with PancakeSwap
Concentrated liquidity (V3) gives LPs far better capital efficiency than V2, at the cost of active management: a position only earns fees while the price is inside its tick range, and rewards/yields shift constantly. That operational overhead is exactly what an agent removes. Common strategies:
* **Range rebalancer** — watch an LP position; when price drifts toward the edge of the range, withdraw and re-mint around the new price so the position keeps earning fees. *(Worked example in §6.)*
* **Farm APR router** — track CAKE + fee yield across pools and move liquidity to the highest total yield.
* **Swap/quote bots** — route trades through the Smart Router for best execution across V2 + V3.
All of these are compositions of the same handful of contract calls below.
***
### 2. Contract surface (BNB Smart Chain, chainId 56)
| Contract | Address | Your agent uses it to |
| ------------------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| **NonfungiblePositionManager** (NFPM) | `0x46A15B0b27311cedF172AB29E4f4766fbE7F4364` | Create/manage LP positions — `mint`, `increaseLiquidity`, `decreaseLiquidity`, `collect`, `burn` |
| **SmartRouter** | `0x13f4EA83D0bd40E75C8222255bc855a974568Dd4` | Execute swaps with best V2+V3 routing |
| **MasterChefV3** | `0x556B9306565093C855AEA9AE92A594704c2Cd59e` | Stake a position NFT to farm CAKE — `harvest`, `withdraw` |
| **V3 Quoter** | `0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997` | Quote a swap before sending it |
| **PancakeV3Factory** | `0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865` | Resolve a pool address from `(token0, token1, fee)` |
| **Permit2** | `0x31c2F6fcFf4F8759b3Bd5Bf0e1084A055615c768` | Gasless/batched token approvals for **Smart Router swaps** (see §5.1) |
> ⚠️ **Always reconfirm addresses** against the canonical PancakeSwap deployment list before sending real value. Treat the table above as a starting point.
A V3 **pool** is identified by `(token0, token1, fee)`. Fee tiers and their tick spacing:
| Fee | `fee` value | Tick spacing | Typical use |
| ----- | ----------- | ------------ | ------------------------- |
| 0.01% | `100` | 1 | Stable–stable |
| 0.05% | `500` | 10 | Correlated (e.g. ETH/BTC) |
| 0.25% | `2500` | 50 | Most pairs |
| 1.00% | `10000` | 200 | Exotic / volatile |
A V3 **position** is an ERC-721 NFT held in the NonfungiblePositionManager. It stores `tickLower`, `tickUpper`, `liquidity`, and accrued fees. You reference it by `tokenId`.
***
### 3. Tooling
You can talk to these contracts with raw ABIs and any web3 library, but the **`@pancakeswap/v3-sdk`** and **`@pancakeswap/smart-router`** packages do the hard math (tick ↔ price, slippage-adjusted minimums, calldata encoding) for you. The examples below use them with [viem](https://viem.sh/).
```bash
pnpm add @pancakeswap/v3-sdk @pancakeswap/smart-router @pancakeswap/sdk viem
```
```tsx
import { createPublicClient, createWalletClient, http } from 'viem'
import { bsc } from 'viem/chains'
import { privateKeyToAccount } from 'viem/accounts'
const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY as `0x${string}`)
const publicClient = createPublicClient({ chain: bsc, transport: http() })
const walletClient = createWalletClient({ chain: bsc, account, transport: http() })
```
Your agent is just this wallet executing transactions on a schedule or trigger. The wallet is funded and managed by Agent Studio — see the BNB docs.
***
### 4. Reading state (do this before every action)
An agent decides *whether* to act by reading the chain. The three reads that drive most strategies:
**Pool price and current tick** — build a `Pool` entity from on-chain `slot0` + `liquidity`:
```tsx
import { Pool, FeeAmount } from '@pancakeswap/v3-sdk'
// poolAddress resolved from the factory or computeP프로젝트로 돌아가기