📢 Gate Square #Creator Campaign Phase 2# is officially live!
Join the ZKWASM event series, share your insights, and win a share of 4,000 $ZKWASM!
As a pioneer in zk-based public chains, ZKWASM is now being prominently promoted on the Gate platform!
Three major campaigns are launching simultaneously: Launchpool subscription, CandyDrop airdrop, and Alpha exclusive trading — don’t miss out!
🎨 Campaign 1: Post on Gate Square and win content rewards
📅 Time: July 25, 22:00 – July 29, 22:00 (UTC+8)
📌 How to participate:
Post original content (at least 100 words) on Gate Square related to
Exploring the Mainstream AMM Implementations in the Web3 Financial Sector: A Comparison of CPMM, CLMM, and DLMM
Exploration of AMM Implementation in the Web3 Financial Sector
In the Web3 industry, decentralized finance ( DeFi ) products dominate the market. As a core component of DeFi, automated market maker ( AMM ) mechanisms play an important role in driving financial innovation in Web3. This article will introduce several important AMM implementations within the Solana ecosystem, providing references for liquidity providers to choose investment strategies.
CPMM: Constant Product Market Maker
CPMM( Constant Product Market Maker ) is one of the most basic implementations of AMM. Taking an AMM based on constant product launched by a trading platform as an example, its core principle is that the supply of the two tokens in the pool maintains a constant product: X * Y = k.
When a user adds liquidity to the pool, the system will automatically create a linked account and issue LP tokens to prove that the user holds a share of the pool. When withdrawing liquidity, the corresponding LP tokens will be destroyed.
The on-chain program of CPMM is developed using Anchor. During the token exchange process, the system will trigger swap-related instructions. Taking the exchange between USDC and TRUMP tokens as an example, when a transaction occurs, it will directly interact with the CPMM program, modifying the status of the corresponding Token Account through the provided pool address, token address, etc., to complete the swap operation.
The specific amount of target tokens that can be exchanged is calculated using the constant product formula:
(X + ΔX)(Y - ΔY) = XY
Through mathematical conversion, the calculation formula for the number of Y tokens that can be exchanged for ΔY( is:
ΔY = )ΔX * Y( / )X + ΔX(
![Solana Ecosystem AMM Research: The Underlying Code Behind High Liquidity])https://img-cdn.gateio.im/webp-social/moments-888d982f15ce3c27c6334c37dfa8fdd9.webp(
CLMM: Concentrated Liquidity Market Maker
CLMM) Concentrated Liquidity Market Maker ( allows liquidity providers to select a price range when injecting funds, and the funds will only be distributed within the selected range. This mechanism is similar to the V3 version of certain DEXs, where each token pair can create pools with multiple fee tier levels.
CLMM inherits concepts such as ticks, multi-rate tiers, and concentrated liquidity. Similar to CPMM, due to the characteristics of the Solana chain, CLMM does not need to deploy contracts separately for each pool.
Liquidity providers can choose to concentrate their funds within a certain range around the current price or provide unilateral liquidity. For pools with small price fluctuations, they usually tend to choose a smaller price range; while for pools with significant fluctuations, they tend to select a larger range.
Although concentrated liquidity can improve capital efficiency, it also raises higher requirements for the financial management abilities of liquidity providers. If not handled properly, frequent price fluctuations may lead to significant impermanent loss.
![Solana Ecosystem AMM Research: The Underlying Code Behind High Liquidity])https://img-cdn.gateio.im/webp-social/moments-0cd2b8ac94f0c770688a696d01aa3a14.webp(
![Solana Ecosystem AMM Research: The Underlying Code Behind High Liquidity])https://img-cdn.gateio.im/webp-social/moments-2ec2653a014a540b670682d2caf3a00d.webp(
![Solana Ecosystem AMM Research: The Underlying Code Behind High Liquidity])https://img-cdn.gateio.im/webp-social/moments-e37158b5b9adf9a88d817e837dcc7456.webp(
![Solana Ecosystem AMM Research: The Underlying Code Behind High Liquidity])https://img-cdn.gateio.im/webp-social/moments-2d7712d72d2c0895cbb3a5bc896a9781.webp(
DLMM: Dynamic Liquidity Market Maker
DLMM) Dynamic Liquidity Market Maker ( is another AMM product similar to V3. It introduces the concept of Bins, dividing the price into a series of small segments. If a trade occurs within the same Bin, traders will enjoy zero slippage, which can significantly increase trading volume and success rate.
In DLMM, the tokens in the pool are distributed on both sides of the current price. The currently activated Bin contains two types of tokens, while other Bins only contain a single type of token. When the amount of tokens in the activated Bin changes, the system will automatically adjust the activated Bin, thereby driving price changes in the pool.
DLMM offers three liquidity strategies: Spot, Curve, and Bid Ask. The Spot strategy is suitable for most pools; the Curve strategy is suitable for pools with very little price change, such as stablecoin pairs ); the Bid Ask strategy is more suitable for pools with higher price volatility.
Summary
AMM, as an important component of the Web3 financial sector, promotes the development of decentralized finance through its unique mechanism. With continuous technological advancements and the improvement of the ecosystem, AMM is expected to play a greater role in the future, further changing the landscape of traditional finance.