Evolution of AMM Mechanisms: Financial Innovations in Web3 from CPMM to CLMM and DLMM

Core Technology in the Web3 Financial Sector: An Exploration of the AMM Mechanism

In the current landscape of the Web3 industry, products related to decentralized finance ( DeFi ) dominate the market. Among them, Automated Market Makers ( AMM ) play a crucial role in driving innovation and transformation in the Web3 finance sector. This article will focus on several important AMM implementations within the Solana ecosystem, aiming to provide liquidity providers ( LP ) with some references when choosing investment strategies.

Solana Ecosystem AMM Research: The Underlying Code Behind High Liquidity

Constant Product Market Maker ( CPMM )

CPMM is one of the most basic implementations of AMM. Taking the constant product AMM launched by a certain trading platform as an example, its core principle is to keep the product of the supply of two tokens in the pool constant, that is, X * Y = k.

When users add liquidity to the pool, the system will automatically create an associated account for the user's wallet and issue LP Tokens to prove the user's share in the specific pool. These LP Tokens will be destroyed when the user withdraws liquidity.

The on-chain program of CPMM is developed using Anchor. During the trading process, when users swap tokens, swap-related instructions are triggered. Taking the exchange of USDC and TRUMP tokens as an example, the system operates through the TRUMP-USDC pool. The AMM in the Solana ecosystem can directly use Token Accounts to represent LP positions, without the need to deploy new contracts like on Ethereum.

Solana Ecosystem AMM Research: The Underlying Code Behind High Liquidity

In specific swap operations, the system calculates the amount of tokens that can be exchanged based on the constant product formula. The calculation formula is:

(X + ΔX)(Y - ΔY) = XY

Among them, ΔY represents the number of target tokens that users can obtain, calculated as follows:

ΔY = (ΔX * Y) / (X + ΔX)

It is important to note that this calculation does not include transaction fees, as the fees have already been deducted in the preceding logic.

Solana Ecosystem AMM Research: The Underlying Code Behind High Liquidity

Concentrated Liquidity AMM ( CLMM )

CLMM is another AMM implementation launched by a certain trading platform, designed similarly to the V3 version of a well-known DEX. CLMM allows for multiple fee tiers to be set for each token pair and creates corresponding liquidity pools.

One of the main features of CLMM is that it allows liquidity providers to choose a specific price range when injecting funds. This mechanism ensures that funds are distributed only within the selected range, improving the efficiency of fund utilization. LPs can choose to provide liquidity for both tokens in the pool or opt to provide only one-sided liquidity, similar to limit orders in traditional finance.

Solana Ecosystem AMM Research: The Underlying Code Behind High Liquidity

Generally speaking, for pools with smaller price fluctuations, LPs tend to choose a smaller price range; while for pools with significant fluctuations, they tend to choose a larger range. The purpose of this is to minimize the risk of the current price deviating from the selected range, thereby reducing impermanent loss.

It is worth noting that while concentrated liquidity can improve capital utilization, it also places higher demands on LPs' financial management capabilities. LPs need to manage their liquidity more actively; otherwise, they may suffer significant impermanent loss due to market fluctuations.

Solana Ecosystem AMM Research: The Underlying Code Behind High Liquidity

Dynamic Liquidity Market Maker ( DLMM )

DLMM is an AMM product launched by a certain platform. It is also a variant of a well-known DEX V3 and shares many similarities with CLMM. DLMM similarly allows LPs to concentrate funds within a certain range around the current price, but it has innovations in its specific implementation and offers some unique features.

DLMM introduces the concept of "Bin", which divides the price range into multiple small segments. If a trade occurs within the same Bin, traders will enjoy zero slippage trading, which can significantly increase trading volume and success rates, theoretically bringing more fee income to LPs.

Solana Ecosystem AMM Research: The Underlying Code Behind High Liquidity

In DLMM, the tokens in the pool are also distributed on both sides of the current price. There are two types of tokens in the currently activated Bin, while other Bins only contain a single type of token. When the amount of a certain token in the activated Bin decreases to zero, the system automatically sets the adjacent Bin to a new activated state, thereby driving the price changes in the pool.

Solana Ecosystem AMM Research: The Underlying Code Behind High Liquidity

DLMM provides LPs with three liquidity strategies: Spot, Curve, and Bid Ask. The Spot strategy is suitable for most liquidity pools; the Curve strategy is more suitable for pools with low price fluctuations, such as stablecoin pairs; the Bid Ask strategy is suitable for pools with larger price fluctuations, but this strategy usually requires LPs to frequently adjust their positions and has higher demands for market judgment.

Solana Ecosystem AMM Research: The Underlying Code Behind High Liquidity

Conclusion

As an important component of the Web3 financial sector, AMM is driving the popularity and development of decentralized finance through its unique mechanisms and continuous innovation. With advancements in technology and the improvement of the ecosystem, AMM is expected to play a larger role in the future, further changing the landscape of traditional finance. For participants, a deep understanding of the characteristics and risks of different AMM mechanisms will help in making more informed investment decisions.

View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • 5
  • Share
Comment
0/400
wrekt_but_learningvip
· 16h ago
gm degens Solana really delivered this time.
View OriginalReply0
DeFiDoctorvip
· 16h ago
Diagnosis result: The CPMM port still lacks stress regulation mechanisms.
View OriginalReply0
LonelyAnchormanvip
· 16h ago
Enter a position before being played people for suckers.
View OriginalReply0
consensus_whisperervip
· 16h ago
Just a glance makes me dizzy, it's too profound.
View OriginalReply0
GreenCandleCollectorvip
· 17h ago
Ah, ah, ah, I'm too anxious about炒LP.
View OriginalReply0
Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate app
Community
English
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)