PancakeSwap, a decentralized exchange, has announced the release of its version four codebase and white paper on March 15. The new version aims to provide custom liquidity pools and flash accounting, with the goal of reducing gas costs for users and preventing impermanent loss for liquidity providers. Additionally, the PancakeSwap team plans to establish a development fund to support the further development of the protocol.
PancakeSwap currently ranks as the third-largest decentralized crypto exchange based on the total value of cryptocurrency locked within its contracts, with over $2.3 billion of assets across nine different networks, according to DefiLlama.
The new version, v4, is expected to launch on the Ethereum and BNB networks in the third quarter of 2024. It introduces “hooks,” which are customizable add-ons that independent developers can create to enhance specific liquidity pools. These hooks enable pools to offer dynamic fees, custom oracles, and active liquidity management modules.
The announcement also mentions the implementation of liquidity book pools, which deviate from the traditional X*Y = K formula and instead use X + Y = K. PancakeSwap claims that this new type of pool eliminates impermanent loss for liquidity providers and avoids price impact for traders within a bin.
To minimize gas costs, the developers have consolidated all pools into a single contract using a “singleton” model. This consolidation reduces the cost of multi-hop trades that require multiple swaps to complete. Additionally, the v4 protocol incorporates flash accounting, which optimizes the accounting process by calculating net balances for a batch of transactions and settling them collectively, further reducing gas costs.
The new code is open-source, allowing developers to fork it under an open-source license. Developers who wish to fork the code can apply to become affiliates and receive official recognition from the PancakeSwap team. Furthermore, PancakeSwap has launched a $500,000 developer program to financially support independent developers in creating hooks for v4.
As the crypto user base continues to grow, decentralized exchanges are competing to implement new features and gain market share. Uniswap, for example, recently announced the release of a web extension wallet with its integrated exchange. In November 2023, Uniswap introduced a “gauges” voting feature that enables PancakeSwap’s (CAKE) tokenholders to vote on allocating additional rewards to specific pools.