Repository: pancakeswap/pancake-developer
Pull request #49: feat: update docs 
Author: login: ChefMist
Created: 2025-05-19T03:12:00Z | Merged: 2025-05-19T06:36:55Z


- [x] farms related information 
- [x] pcs infinity vs uniswap v4 
- [x] include warning about managing v4 liquidity position that involve eth 
- [x] include updated universal router caddress


Diff:
diff --git a/docs/pages/contracts/infinity/faq.mdx b/docs/pages/contracts/infinity/faq.mdx
index be49c78..de58631 100644
--- a/docs/pages/contracts/infinity/faq.mdx
+++ b/docs/pages/contracts/infinity/faq.mdx
@@ -51,3 +51,7 @@ When both protocol fee and swap fee are present:
 1. Protocol fee is taken from the input amount first.
 2. LP fee is taken from the remaining amount after deducting the protocol fee.
 
+
+## Q5: What is the key differences between Uniswap v4 and PancakeSwap Infinity?
+
+See [this document](/contracts/infinity/faq/pancakeswap-infinity-vs-uniswap-v4)
diff --git a/docs/pages/contracts/infinity/faq/pancakeswap-infinity-vs-uniswap-v4.mdx b/docs/pages/contracts/infinity/faq/pancakeswap-infinity-vs-uniswap-v4.mdx
new file mode 100644
index 0000000..d19dbf8
--- /dev/null
+++ b/docs/pages/contracts/infinity/faq/pancakeswap-infinity-vs-uniswap-v4.mdx
@@ -0,0 +1,135 @@
+# Key Differences Between PancakeSwap Infinity and Uniswap v4
+
+This section outlines the high-level architectural and integration differences between PancakeSwap Infinity and Uniswap v4, with a focus on considerations relevant to developers and integrators.
+
+## 1. Pool Type Support 
+
+PancakeSwap Infinity features a modular architecture that enables support for multiple DEX designs.
+
+- PancakeSwap Infinity currently supports both:
+    - Concentrated Liquidity Pools
+    - Liquidity Book Pools
+
+- Uniswap v4, by contrast, supports only:
+    - Concentrated Liquidity Pools
+
+This flexibility in PancakeSwap Infinity allows for future extensibility and experimentation with alternative AMM models.
+
+## 2. Separation of Accounting and AMM Layers 
+
+A core architectural difference lies in how the accounting logic is separated from the AMM logic:
+
+- PancakeSwap Infinity separates concerns by introducing:
+    - Vault – handles asset accounting
+    - CLPoolManager / BinPoolManager – manage the AMM logic
+
+- Uniswap v4 combines both accounting and AMM logic within a single contract:
+    - PoolManager
+
+This separation allows PancakeSwap Infinity to support multiple AMM types more easily and provides a more modular integration pattern.
+
+
+**Integration Implications**
+
+| Operation                       | PancakeSwap Infinity   | Uniswap v4                       |
+|---------------------------------|------------------------|----------------------------------|
+| Asset Transfer Target           | `Vault` contract       | `PoolManager` contract           |
+| Accounting Functions (eg. take) | `vault.take(...)`      | `poolManager.take(...)`          |
+
+Integrators interacting with the accounting layer should take this distinction into account.
+
+### Reference Implementations
+
+For further guidance and practical integration examples, refer to the following smart contracts in the PancakeSwap [Infinity periphery repository](https://github.com/pancakeswap/infinity-periphery):
+
+- [InfinityRouter.sol](https://github.com/pancakeswap/infinity-periphery/blob/main/src/InfinityRouter.sol)
+
+- [CLPositionManager.sol](https://github.com/pancakeswap/infinity-periphery/blob/main/src/pool-cl/CLPositionManager.sol)
+
+- [BinPositionManager.sol](https://github.com/pancakeswap/infinity-periphery/blob/main/src/pool-bin/BinPositionManager.sol)
+
+## 3. PoolKey Struct 
+
+PancakeSwap Infinity and Uniswap v4 define their PoolKey structs differently due to architectural differences, particularly in how they handle pool-specific parameters and hook permissions.
+
+**Key Differences**
+- PancakeSwap Infinity uses a unified `bytes32 parameters` field to encode both the hook's permissions and AMM-specific attributes.
+- Uniswap v4 uses a dedicated `int24 tickSpacing` field for AMM parameters, with hook permissions handled separately.
+
+PancakeSwap Infinity also include a `poolManager` attribute which is either CLPoolManager or BinPoolManager address.
+
+### Understanding `bytes32 parameters` in PancakeSwap Infinity
+
+In PancakeSwap Infinity, the `parameters` field encapsulates:
+
+- **Hook permissions** (first 16 bits)
+- **AMM-specific attributes**, depending on the pool type:
+    - **CLPoolManager**: tick spacing (next 24 bits). See [CLPoolParametersHelper](https://github.com/pancakeswap/infinity-core/blob/main/src/pool-cl/libraries/CLPoolParametersHelper.sol)
+    - **BinPoolManager**: bin step (next 16 bits). See [BinPoolParameterHelper](https://github.com/pancakeswap/infinity-core/blob/main/src/pool-bin/libraries/BinPoolParametersHelper.sol)
+
+
+**Example: CLPool: BNB/CAKE with dynamic fee hook**
+
+```solidity
+// ref: https://pancakeswap.finance/liquidity/pool/bsc/0x737a7d974a19bafb34c8d74d898188c9b59689b91f291fa6ade69f71fa0f5afa
+// PoolId: 0x737a7d974a19bafb34c8d74d898188c9b59689b91f291fa6ade69f71fa0f5afa
+
+// Query poolKey via CLPoolManager.poolIdToPoolKey(bytes32 poolId)
+PoolKey: 
+[ poolIdToPoolKey(bytes32) method Response ]
+  currency0   address :  0x0000000000000000000000000000000000000000
+  currency1   address :  0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82
+  hooks   address :  0x32C59D556B16DB81DFc32525eFb3CB257f7e493d
+  poolManager   address :  0xa0FfB9c1CE1Fe56963B0321B32E7A0302114058b
+  fee   uint24 :  8388608
+  parameters   bytes32 :  0x00000000000000000000000000000000000000000000000000000000000a00c2
+```
+
+In this example: 
+
+- parameters = `0x00000000000000000000000000000000000000000000000000000000000a00c2`
+- **Hook permission**: `0x00c2 → 0000 0000 1100 0010` (in bits)
+- **Tick spacing**: 0x00000a → decimal 10
+
+
+### Interpreting Hook Permissions
+
+Hook permissions occupy the first 16 bits of `parameters`. These bits determine which lifecycle callbacks are enabled.
+
+For **CL pool types**, refer to [ICLHooks](https://github.com/pancakeswap/infinity-core/blob/main/src/pool-cl/interfaces/ICLHooks.sol)
+
+- Example interpretation of `0000 0000 1100 0010`:
+    - afterInitialize callback enabled
+    - beforeSwap callback enabled
+    - afterSwap callback enabled
+
+For **Bin Pool types**, see [IBinHooks](https://github.com/pancakeswap/infinity-core/blob/main/src/pool-bin/interfaces/IBinHooks.sol)
+
+### PoolKey Struct Reference
+
+**PancakeSwap Infinity**
+```solidity
+struct PoolKey {
+    Currency currency0;
+    Currency currency1;
+    IHooks hooks;
+    /// @notice The pool manager of the pool
+    IPoolManager poolManager;
+    uint24 fee;
+    /// @notice Hooks callback and pool specific parameters, i.e. tickSpacing for CL, binStep for bin
+    bytes32 parameters;
+}
+```
+
+**Uniswap v4**
+```solidity
+struct PoolKey {
+    Currency currency0;
+    Currency currency1;
+    uint24 fee;
+    /// @notice Ticks that involve positions must be a multiple of tick spacing
+    int24 tickSpacing;
+    /// @notice The hooks of the pool
+    IHooks hooks;
+}
+```
diff --git a/docs/pages/contracts/infinity/guides/manage-liquidity.mdx b/docs/pages/contracts/infinity/guides/manage-liquidity.mdx
index ade60ac..e59b457 100644
--- a/docs/pages/contracts/infinity/guides/manage-liquidity.mdx
+++ b/docs/pages/contracts/infinity/guides/manage-liquidity.mdx
@@ -98,13 +98,18 @@ clPositionManager.modifyLiquidities(payload, deadline);
 ## 3. Type of CL pool liquidity actions (`CLPositionManager`)
 
 <Callout type="info">
-  In Infinity, there's no longer `collect()` to collect LP fee(s) for a position. Instead, use CL_INCREASE_LIQUIDITY or CL_DECREASE_LIQUIDITY action with `liqudiity: 0` to collect LP fees. 
+  In Infinity, there's no longer `collect()` to collect LP fee(s) for a position. Instead, use CL_INCREASE_LIQUIDITY or CL_DECREASE_LIQUIDITY action with `liquidity: 0` to collect LP fees. 
 </Callout>
 
 Below list down CL pool related actions and its associated params.  
 
 ### CL_MINT_POSITION
 Mint a new position
+
+:::warning
+When providing liquidity using a native token (e.g., BNB), ensure that you include a sweep action to recover any excess native token sent to the position manager.
+:::
+
 ```solidity
 {
   PoolKey poolKey; // struct which determine the poolKey 
@@ -132,12 +137,17 @@ Burn the NFT and automatically decrease liquidity to 0 if the position is not al
 
 ### CL_INCREASE_LIQUIDITY
 Increase liquidity from existing position
+
+:::warning
+When increasing liquidity using a native token (e.g., BNB), ensure that you include a sweep action to recover any excess native token sent to the position manager.
+:::
+
 ```solidity
 {
   uint256 tokenId; // the NFT tokenId to increase liquidity 
   uint256 liquidity; // the amount of liquidity to increase
   uint128 amount0Max; // max amount0, revert if more than amount0Max is added
-  uint128 amount1Max: max amount1, revert if more than amount1Max is added
+  uint128 amount1Max: // max amount1, revert if more than amount1Max is added
   bytes hookData: // hook data to pass to hook, or empty bytes if nothing to pass
 }
 ```
@@ -155,8 +165,13 @@ Decrease liquidity from existing position
 ```
 
 ## 4. Type of Bin pool liquidity actions (`BinPositionManager`)
-Add liqudiity, will mint the correspond ERC-1155 token.
+Add liquidity, will mint the correspond ERC-1155 token.
 ### BIN_ADD_LIQUIDITY
+
+:::warning
+When providing liquidity using a native token (e.g., BNB), ensure that you include a sweep action to recover any excess native token sent to the position manager.
+:::
+
 ```solidity 
 IBinPositionManager.BinAddLiquidityParams {
   PoolKey poolKey; // struct which identify the pool
diff --git a/docs/pages/contracts/infinity/guides/perform-a-swap.mdx b/docs/pages/contracts/infinity/guides/perform-a-swap.mdx
index 20cd3e1..8522a2f 100644
--- a/docs/pages/contracts/infinity/guides/perform-a-swap.mdx
+++ b/docs/pages/contracts/infinity/guides/perform-a-swap.mdx
@@ -300,7 +300,7 @@ Make a call to v3 NonFungiblePositionManager. The only methods available to call
 IV3NonfungiblePositionManager.DecreaseLiquidityParams memory decreaseParams = 
     IV3NonfungiblePositionManager.DecreaseLiquidityParams({
         tokenId: tokenId,
-        liquidity: liqudiity,
+        liquidity: liquidity,
         amount0Min: 0,
         amount1Min: 0,
         deadline: block.timestamp
diff --git a/docs/pages/contracts/infinity/overview/farms.mdx b/docs/pages/contracts/infinity/overview/farms.mdx
new file mode 100644
index 0000000..b118334
--- /dev/null
+++ b/docs/pages/contracts/infinity/overview/farms.mdx
@@ -0,0 +1,182 @@
+# Farms 
+
+## Overview 
+
+User additional CAKE rewards by providing liquidity to Infinity Pools listed at https://pancakeswap.finance/liquidity/pools?type=1. 
+
+### Farm mechanics
+
+1. **Farm Listing**: The PancakeSwap team registers Infinity Pool farms in the [CampaignManager contract](https://bscscan.com/address/0x26Bde0AC5b77b65A402778448eCac2aCaa9c9115) 
+
+2. **Liquidity Provision**: Users add liquidity to Infinity Pools via the [Liquidity Pools & Farms](https://pancakeswap.finance/liquidity/pools?type=1)
+
+3. **Reward Calculation**: Every epoch (8 hours at 00:00, 08:00, 16:00 UTC), PancakeSwap runs a job to:
+    - Calculate fees earned by the pool in the past 8 hours.
+    - Determine the CAKE reward for each user based on their liquidity contribution.
+
+4. **Merkle Root Update**: PancakeSwap updates the Merkle root by calling the `setMerkleTree` function on the [Distributor contract](https://bscscan.com/address/0xEA8620aAb2F07a0ae710442590D649ADE8440877)
+
+5. Reward Claiming: Users with pending CAKE rewards can call the `claim` function on the [Distributor contract](https://bscscan.com/address/0xEA8620aAb2F07a0ae710442590D649ADE8440877) to claim the cake reward.
+
+
+### Amount of cake earned
+
+The CAKE reward a user earns depends on the proportion of fees their liquidity position (LP) contributes to the total fees in the Infinity Pool.
+
+- Assume the BNB-CAKE pool has 100 CAKE rewards to distribute for the next epoch.
+- Alice’s LP generates $10 in fees.
+- Bob’s LP generates $40 in fees.
+- Alice’s LP accounts for 20% of the total fees ($10 / ($10 + $40) = 0.2). Thus, Alice earns 20% of the CAKE rewards (20 CAKE).
+
+## Integration guide 
+
+This section provides guidance for integrators looking to integrate with PancakeSwap farms.
+
+:::warning
+PancakeSwap does not guarantee API uptime, and the interface may change without prior notice.
+
+If you are a protocol interested in launching a farm using your own token as a reward, we encourage you to reach out to the PancakeSwap  to share your feedback. Implementation will be considered based on demand.
+:::
+
+
+### Fetching the list of farms 
+
+The list of active farms is managed by the [CampaignManager contract](https://bscscan.com/address/0x26Bde0AC5b77b65A402778448eCac2aCaa9c9115)
+
+To retrieve the current list of active farms, use one of the following methods:
+
+#### Option 1: Index `CampaignCreated` and `CampaignStopped` events
+
+Monitor the CampaignCreated and CampaignStopped events emitted by the CampaignManager contract. 
+
+```solidity
+event CampaignCreated(
+    uint256 indexed campaignId,
+    IPoolManager indexed poolManager,
+    PoolId indexed poolId,
+    uint64 startTime,
+    uint64 duration,
+    uint128 campaignType,
+    IERC20 rewardToken,
+    int256 totalRewardAmount
+);
+
+event CampaignStopped(
+    uint256 indexed campaignId, 
+    uint128 newDuration, 
+    uint256 newTotalRewardAmount
+);
+```
+
+
+#### Option 2: Query on-chain 
+To retrieve the list of active farms directly from the blockchain, follow these steps:
+
+1. **Fetch Total Campaigns**: Call the `campaignLength` function on the [CampaignManager contract](https://bscscan.com/address/0x26Bde0AC5b77b65A402778448eCac2aCaa9c9115) to get the total number of campaigns.
+
+2. **Retrieve Campaign Details**: For each campaignId (from 1 to the total campaign length), call the `campaignInfo(uint256 campaignId)` function to obtain details such as the `poolId, totalReward`.
+
+
+```solidity
+eg. campaignManager.campaignInfo(1);
+
+[ campaignInfo(uint256) method Response ]
+  poolManager   address :  0xa0FfB9c1CE1Fe56963B0321B32E7A0302114058b
+  poolId   bytes32 :  0xcbc43b950eb089f1b28694324e76336542f1c158ec955921704cebaa53a278bc
+  startTime   uint64 :  1742457600
+  duration   uint64 :  604800 // in seconds 
+  campaignType   uint128 :  0 // will always be 0 for now 
+  rewardToken   address :  0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82
+  totalRewardAmount   uint256 :  2100000000000000000
+```
+
+
+### How to claim reward
+
+Prerequisites
+- **User Wallet Address**: Ensure you have user's wallet address.
+- **Current Time**: Obtain the current timestamp in seconds.
+
+
+::::steps
+#### Step 1: Fetch Merkle proof
+
+To claim rewards from the [Distributor contract](https://bscscan.com/address/0xEA8620aAb2F07a0ae710442590D649ADE8440877), first retrieve the Merkle proof for the user's address.
+
+- **Action**: Call the PancakeSwap API to fetch the Merkle proof for the user’s address and the relevant reward distribution period.
+
+```bash
+GET https://infinity.pancakeswap.com/farms/users/{chainId}/{user_address}/{current_ts_sec}
+
+// Example
+// BNB chainId: 56
+// user: 0x42571B8414c68B63A2729146CE93F23639d25399
+// Current time in sec: 1747382043 (Tuesday, June 21, 40749 11:16:35.266)
+GET https://infinity.pancakeswap.com/farms/users/56/0x42571B8414c68B63A2729146CE93F23639d25399/1747382043
+```
+
+It should return the below response:
+```json
+// Should only return array of 1 item as theres only CAKE as reward token currently
+{
+  "rewards": [
+    {
+      "endBlock": "49740160",
+      "epochEndTimestamp": 1747353600,
+      "user": "0x42571b8414c68b63a2729146ce93f23639d25399",
+      "rewardTokenAddress": "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82",
+      "totalRewardAmount": "678344590635830",
+      "merkleRoot": "0xb52a93aeb6dbbd53079bd74228fff7ed4b379ba5c5313046e10c89200c605f76",
+      "proofs": [
+        "0xad47c8aee5bb023005a8b5848cd7e2adb08aeb277bd4eacc8e29fcce3fa8e0c1",
+        "0x422e4dba88b14027e2a9ae9320ce220ddeddbd001f10b57ecd48d8faac35ae7d",
+        "0xc82f2f46a827c804e9fe7dd3e4982052e8db8e4d84e0e90ee567543ab051c73d",
+        "0xbf834f1935a7033b67d0470df748fe116c00894af0dfc307c87f7b2714c44ae0",
+        "0xc6ce4dd445803d58d8c85f804cf58ebc8f4e45cc4f88470e1aee29683c688db0",
+        "0x7702608a7cf68ddc046caf09e5c838c16d4da56446bffc5811eb4f876e4fa436",
+        "0x8d4447ab25c76dd390a853fc0b76eeda382b2641cd6a111afb6c15d189f3b902",
+        "0xf7073ad0b7b7f0f647e36cc0bb58fff1cd7905c484ab9bf24cec3a058a94dd1f",
+        "0xc12e6cf2930cfec1b29f5e178ce2514d886e0a5f5cf3f662c2d0c9e92ed3e40e",
+        "0x982d67b7edb29dca77eabd39b426c0fcedb5ed09025854c53454a1cf94e3e448"
+      ]
+    }
+  ]
+}
+```
+
+#### Step 2: Call Distributor contract to claim 
+
+After obtaining the Merkle proof, call the [Distributor contract](https://bscscan.com/address/0xEA8620aAb2F07a0ae710442590D649ADE8440877) to claim CAKE rewards.
+
+**Contract Details**:
+
+The claim function allows users to claim their rewards based on the provided parameters. If a user has already claimed a portion of their rewards (e.g., 10 out of 20 CAKE), only the remaining amount (e.g., 10 CAKE) will be distributed.
+
+
+
+```solidity
+struct ClaimParams {
+  address token; // from rewards[0].rewardTokenAddress
+  uint256 amount; // from rewards[0].totalRewardAmount
+  bytes32[] proof; // from rewards[0].proofs
+}
+
+/// @dev if user have already claimed 10 out of 20 cake, user will only get 10 cake from claiming.
+function claim(ClaimParams[] calldata claimParams);
+```
+
+**Action**:
+Construct a ClaimParams array using:
+
+- token: The reward token address (from rewards[0].rewardTokenAddress in the API response).
+
+- amount: The total reward amount (from rewards[0].totalRewardAmount).
+
+- proof: The Merkle proof array (from rewards[0].proofs). Then, call the claim function with the ClaimParams array.
+
+
+
+View a sample claim transaction on [BscScan](https://bscscan.com/tx/0x807fb8502649d81828fdff9feb8f95757c57ac47e00c127119b94be9bf9a48ea)
+
+::::
+
diff --git a/docs/pages/contracts/universal-router/addresses.md b/docs/pages/contracts/universal-router/addresses.md
index e528440..9e132b5 100644
--- a/docs/pages/contracts/universal-router/addresses.md
+++ b/docs/pages/contracts/universal-router/addresses.md
@@ -2,9 +2,29 @@
 description: Fork of Uniswap v3
 ---
 
+# Unversal router
+
 Integrated PancakeSwap self deployed [Permit2](/contracts/permit2/addresses)
 
-# PancakeSwap Universal Router Addresses
+## PancakeSwap Infinity Universal Router Addresses
+
+**Infinity Universal Router** is the latest version of PancakeSwap's universal router. It builds upon the v3 router by adding support for PancakeSwap Infinity and removing certain NFT-related actions.
+
+For usage details, refer to the [Perform a Swap guide](/contracts/infinity/guides/perform-a-swap).
+
+**Mainnet**
+
+| Chain    | Address                                    |
+| -------- | ------------------------------------------ |
+| BSC      | 0xd9c500dff816a1da21a48a732d3498bf09dc9aeb |
+
+**Testnet**
+
+| Chain            | Address                                    |
+| ---------------- | ------------------------------------------ |
+| BSC testnet      | 0x87FD5305E6a40F378da124864B2D479c2028BD86 |
+
+## PancakeSwap v3 Universal Router Addresses
 
 **Mainnet**
 
diff --git a/docs/snippets/LiquidityRemovalFeeHook.t.sol b/docs/snippets/LiquidityRemovalFeeHook.t.sol
index be6e29e..4db14c4 100644
--- a/docs/snippets/LiquidityRemovalFeeHook.t.sol
+++ b/docs/snippets/LiquidityRemovalFeeHook.t.sol
@@ -58,7 +58,7 @@ contract LiquidityRemovalFeeHookTest is Test, CLTestUtils {
         assertEq(MockERC20(Currency.unwrap(currency0)).balanceOf(alice), 0 ether);
         assertEq(MockERC20(Currency.unwrap(currency1)).balanceOf(alice), 0 ether);
 
-        // remove all liqudiity
+        // remove all liquidity
         decreaseLiquidity(tokenId, key, 10 ether, 10 ether, -60, 60);
 
         // verify that only 9 ether received as 10% fee taken
diff --git a/vocs.config.ts b/vocs.config.ts
index 84d460b..0f1ce4f 100644
--- a/vocs.config.ts
+++ b/vocs.config.ts
@@ -28,11 +28,11 @@ export default defineConfig({
             link: '/contracts/infinity/overview',
             items: [
               {
-                text: 'Accounting Layer | Vault',
+                text: 'Accounting Layer - Vault',
                 link: '/contracts/infinity/overview/accounting-layer-vault',
               },
               {
-                text: 'AMM Layer | Pool Manager',
+                text: 'AMM Layer - Pool Manager',
                 link: '/contracts/infinity/overview/amm-layer-poolmanager',
                 items: [
                   {
@@ -46,9 +46,13 @@ export default defineConfig({
                 ],
               },
               {
-                text: 'Custom Layer | Hook',
+                text: 'Custom Layer - Hook',
                 link: '/contracts/infinity/overview/custom-layer-hook',
               },
+              {
+                text: 'Farms',
+                link: '/contracts/infinity/overview/farms',
+              },
             ],
           },
           {
@@ -91,6 +95,12 @@ export default defineConfig({
             text: 'FAQ',
             collapsed: true,
             link: '/contracts/infinity/faq',
+            items: [
+              {
+                text: 'PancakeSwap Infinity vs Uniswap v4',
+                link: '/contracts/infinity/faq/pancakeswap-infinity-vs-uniswap-v4',
+              }
+            ]
           },
         ],
       },


Reviews:
user: login: chef-omelette
body: LGTM
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T04:33:28Z
user: login: chefburger
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T05:22:16Z
user: login: chefburger
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T05:26:26Z
user: login: chefburger
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T05:27:05Z
user: login: ChefSnoopy
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T06:12:30Z

Review comments:
diff_hunk: @@ -0,0 +1,134 @@
+# Key Differences Between PancakeSwap Infinity and Uniswap v4
+
+This section outlines the high-level architectural and integration differences between PancakeSwap Infinity and Uniswap v4, with a focus on considerations relevant to developers and integrators.
+
+## 1. Pool Type support 
+
+PancakeSwap Infinity features a modular architecture that enables support for multiple DEX designs.
+
+- PancakeSwap Infinity currently supports both:
+    - Concentrated Liquidity Pools
+    - Liquidity Book Pools
+
+- Uniswap v4, by contrast, supports only:
+    - Concentrated Liquidity Pools
+
+This flexibility in PancakeSwap Infinity allows for future extensibility and experimentation with alternative AMM models.
+
+## 2. Separation of Accounting and AMM Layers 
+
+A core architectural difference lies in how the accounting logic is separated from the AMM logic:
+
+- PancakeSwap Infinity separates concerns by introducing:
+    - Vault – handles asset accounting
+    - CLPoolManager / BinPoolManager – manage the AMM logic
+
+- Uniswap v4 combines both accounting and AMM logic within a single contract:
+    - PoolManager
+
+This separation allows PancakeSwap Infinity to support multiple AMM types more easily and provides a more modular integration pattern.
+
+
+**Integration Implications**
+
+| Operation                       | PancakeSwap Infinity   | Uniswap v4                       |
+|---------------------------------|------------------------|----------------------------------|
+| Asset Transfer Target           | `Vault` contract       | `PoolManager` contract           |
+| Accounting Functions (eg. take) | `vault.take(...)`      | `poolManager.take(...)`          |
+
+Integrators interacting with the accounting layer should take this distinction into account.
+
+### Reference Implementations
+
+For further guidance and practical integration examples, refer to the following smart contracts in the PancakeSwap [Infinity periphery repository](https://github.com/pancakeswap/infinity-periphery):
+
+- [InfinityRouter.sol](https://github.com/pancakeswap/infinity-periphery/blob/main/src/InfinityRouter.sol)
+
+- [CLPositionManager.sol](https://github.com/pancakeswap/infinity-periphery/blob/main/src/pool-cl/CLPositionManager.sol)
+
+- [BinPositionManager.sol](https://github.com/pancakeswap/infinity-periphery/blob/main/src/pool-bin/BinPositionManager.sol)
+
+## 3. PoolKey Struct 
+
+PancakeSwap Infinity and Uniswap v4 define their PoolKey structs differently due to architectural differences, particularly in how they handle pool-specific parameters and hook permissions.
+
+**Key Differences**
+- PancakeSwap Infinity uses a unified `bytes32 parameters` field to encode both the hook's permissions and AMM-specific attributes.
+- Uniswap v4 uses a dedicated `int24 tickSpacing` field for AMM parameters, with hook permissions handled separately.
+
+PancakeSwap Infinity also include a `poolManager` attribute which is either CLPoolManager or BinPoolManager address.
+
+### Understanding `bytes32 parameters` in PancakeSwap Infinity
+
+In PancakeSwap Infinity, the `parameters` field encapsulates:
+
+- **Hook permissions** (first 16 bits)
+- **AMM-specific attributes**, depending on the pool type:
+    - **CLPoolManager**: tick spacing (next 24 bits). See [CLPoolParametersHelper](https://github.com/pancakeswap/infinity-core/blob/main/src/pool-cl/libraries/CLPoolParametersHelper.sol)
+    - **BinPoolManager**: bin step (next 16 bits). See [BinPoolParameterHelper](https://github.com/pancakeswap/infinity-core/blob/main/src/pool-bin/libraries/BinPoolParametersHelper.sol)
+
+
+**Example: CLPool: BNB/CAKE with dynamic fee hook**
+
+```solidity
+// ref: https://pancakeswap.finance/liquidity/pool/bsc/0x737a7d974a19bafb34c8d74d898188c9b59689b91f291fa6ade69f71fa0f5afa
+// PoolId: 0x737a7d974a19bafb34c8d74d898188c9b59689b91f291fa6ade69f71fa0f5afa
+
+// Query poolKey via CLPoolManager.poolIdToPoolKey(bytes32 poolId)
+PoolKey: 
+[ poolIdToPoolKey(bytes32) method Response ]
+  currency0   address :  0x0000000000000000000000000000000000000000
+  currency1   address :  0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82
+  hooks   address :  0x32C59D556B16DB81DFc32525eFb3CB257f7e493d
+  poolManager   address :  0xa0FfB9c1CE1Fe56963B0321B32E7A0302114058b
+  fee   uint24 :  8388608
+  parameters   bytes32 :  0x00000000000000000000000000000000000000000000000000000000000a00c2
+```
+
+In this example: 
+
+- parameters = `0x00000000000000000000000000000000000000000000000000000000000a00c2`
+- **Hook permission**: `0x00c2 → 0000 0000 1100 0010` (in bits)
+- **Tick spacing**: 0x00000a → decimal 10
+
+
+### Interpreting Hook Permissions
+
+Hook permissions occupy the first 16 bits of `parameters`. These bits determine which lifecycle callbacks are enabled.
+
+For **CL pool types**, refer to [ICLHooks](https://github.com/pancakeswap/infinity-core/blob/main/src/pool-cl/interfaces/ICLHooks.sol)
+- for Bin Pool type, see [IBinHooks](https://github.com/pancakeswap/infinity-core/blob/main/src/pool-bin/interfaces/IBinHooks.sol)
path: docs/pages/contracts/infinity/faq/pancakeswap-infinity-vs-uniswap-v4.mdx
user: login: chefburger
body: i guess there should also be a "-"  before "For **CL pool types... " so both are in bullet form ?

![CleanShot 2025-05-19 at 13 21 55@2x](https://github.com/user-attachments/assets/851eb780-98c3-496e-b1a2-b6e46eed7f0b)

created_at: 2025-05-19T05:22:16Z
author_association: CONTRIBUTOR
diff_hunk: @@ -91,6 +95,12 @@ export default defineConfig({
             text: 'FAQ',
             collapsed: true,
             link: '/contracts/infinity/faq',
+            items: [
+              {
+                text: 'PancakeSwap Infinity vs Uniswap v4',
+                link: '/contracts/infinity/faq/pancakeswap-infinity-vs-uniswap-v4',
+              }
path: vocs.config.ts
user: login: chefburger
body: also, as mentioned, i would recommend better also put the link of this article in FAQ page 
created_at: 2025-05-19T05:26:26Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,134 @@
+# Key Differences Between PancakeSwap Infinity and Uniswap v4
+
+This section outlines the high-level architectural and integration differences between PancakeSwap Infinity and Uniswap v4, with a focus on considerations relevant to developers and integrators.
+
+## 1. Pool Type support 
+
path: docs/pages/contracts/infinity/faq/pancakeswap-infinity-vs-uniswap-v4.mdx
user: login: ChefSnoopy
body: Suggest : support -> Support
created_at: 2025-05-19T06:12:29Z
author_association: CONTRIBUTOR

PR comments:
user: login: vercel[bot]
created_at: 2025-05-19T03:12:06Z
body: [vc]: #Dzu1DYoD4q5BgsalAJaA4rI8ZCJFjfo71M3WZEiqkjY=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJwYW5jYWtlLWRldmVsb3BlciIsImxpdmVGZWVkYmFjayI6eyJyZXNvbHZlZCI6MCwidW5yZXNvbHZlZCI6MCwidG90YWwiOjAsImxpbmsiOiJwYW5jYWtlLWRldmVsb3Blci1naXQtZmVhdC11cGRhdGUtZG9jcy5wYW5jYWtlLnJ1biJ9LCJpbnNwZWN0b3JVcmwiOiJodHRwczovL3ZlcmNlbC5jb20vcGFuY2FrZXN3YXAvcGFuY2FrZS1kZXZlbG9wZXIvS2NhUEJxUTNwTWROSHk5Wjl4MzZxbVRlR1VUNSIsInByZXZpZXdVcmwiOiJwYW5jYWtlLWRldmVsb3Blci1naXQtZmVhdC11cGRhdGUtZG9jcy5wYW5jYWtlLnJ1biIsIm5leHRDb21taXRTdGF0dXMiOiJERVBMT1lFRCIsInJvb3REaXJlY3RvcnkiOm51bGx9XX0=
**The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)

| Name | Status | Preview | Comments | Updated (UTC) |
| :--- | :----- | :------ | :------- | :------ |
| **pancake-developer** | ✅ Ready ([Inspect](https://vercel.com/pancakeswap/pancake-developer/KcaPBqQ3pMdNHy9Z9x36qmTeGUT5)) | [Visit Preview](https://pancake-developer-git-feat-update-docs.pancake.run) | 💬 [**Add feedback**](https://vercel.live/open-feedback/pancake-developer-git-feat-update-docs.pancake.run?via=pr-comment-feedback-link) | May 19, 2025 6:36am |


author_association: NONE
user: login: chefburger
created_at: 2025-05-19T05:26:56Z
body: rest looks good 
author_association: CONTRIBUTOR