An In-Depth Analysis of the Solana Ecosystem AMM: Detailed Explanation of CPMM, CLMM, and DLMM Strategies

robot
Abstract generation in progress

Analysis of AMM ( in the Solana Ecosystem

In the Web3 industry, decentralized finance ) DeFi ( products dominate the market. Among them, automated market makers ) AMM ( serve as a key component, driving innovation in the Web3 financial sector. This article will introduce several important AMM implementations within the Solana ecosystem, providing a reference for liquidity providers ) LP ( to choose investment strategies.

![Solana Ecosystem AMM Research: The Underlying Code Behind High Liquidity])https://img-cdn.gateio.im/webp-social/moments-888d982f15ce3c27c6334c37dfa8fdd9.webp(

## Constant Product Market Maker ) CPMM (

CPMM is the most basic implementation of AMM and is used in multiple products. Taking the constant product-based AMM launched by a certain trading platform as an example, the supply of the two tokens in the pool has a fixed product: X * Y = k.

When users add liquidity to the pool, the CPMM automatically creates an associated account for the user's wallet and issues LP Tokens to prove the wallet's share in the pool. When withdrawing liquidity, the corresponding LP Tokens will be destroyed.

The on-chain program of CPMM is developed using Anchor. When users swap tokens, it triggers swap-related instructions. Taking the TRUMP-USDC trading pair as an example, when a user exchanges USDC for TRUMP, it will be done through the pool of that trading pair.

![Solana ecosystem AMM research: the underlying code behind high liquidity])https://img-cdn.gateio.im/webp-social/moments-0cd2b8ac94f0c770688a696d01aa3a14.webp(

In the Solana ecosystem, LP Pair can be directly represented by Token Accounts without the need to deploy new contracts. During the transaction, it interacts directly with the CPMM Program, modifying the state of the corresponding Token Accounts by passing in the pool address, token address, and so on to complete the swap operation.

The specific amount of target tokens that can be exchanged is calculated using the constant product formula. The calculation will take into account the deduction of transaction fees.

![Solana Ecosystem AMM Research: The Underlying Code Behind High Liquidity])https://img-cdn.gateio.im/webp-social/moments-2ec2653a014a540b670682d2caf3a00d.webp(

## Concentrated Liquidity Market Maker ) CLMM (

CLMM is similar to the V3 version of certain DEXs, where each token pair has multiple fee tiers, allowing the creation of pools corresponding to those tiers. It inherits some concepts such as tick, multiple fee tiers, concentrated liquidity, etc.

CLMM allows LPs to select a price range when injecting funds, with funds distributed only within the selected range. It is also possible to inject a single token to provide unilateral liquidity, similar to a limit order.

![Solana Ecosystem AMM Research: The Underlying Code Behind High Liquidity])https://img-cdn.gateio.im/webp-social/moments-e37158b5b9adf9a88d817e837dcc7456.webp(

For pools with low volatility, LPs tend to choose a smaller price range; for pools with high volatility, they choose a larger range. Concentrated liquidity can improve capital efficiency, but it also requires LPs to manage liquidity more actively to avoid significant impermanent loss.

![Solana Ecosystem AMM Research: The Underlying Code Behind High Liquidity])https://img-cdn.gateio.im/webp-social/moments-2d7712d72d2c0895cbb3a5bc896a9781.webp(

## Dynamic Liquidity Market Maker ) DLMM (

DLMM is an AMM product launched by a trading platform, and it is a variant of V3. It introduces the concept of Bin, where the pool starts from a base price, and each small segment of Bin step exists as a Bin. Trades within the same Bin enjoy zero slippage, which can increase trading volume and success rate.

![Solana Ecosystem AMM Research: The Underlying Code Behind High Liquidity])https://img-cdn.gateio.im/webp-social/moments-fef4e9886047f31e3328b34af69187d5.webp(

In DLMM, the currently activated Bin has two types of tokens, while other Bins are distributed on both sides and only have a single token. When a certain token in the activated Bin decreases to 0, it will automatically switch to the adjacent Bin, driving changes in the pool price.

![Solana ecosystem AMM research: The underlying code behind high liquidity])https://img-cdn.gateio.im/webp-social/moments-bb11b6aeaa5618925c982930d7ba7895.webp(

DLMM offers three LP strategies: Spot, Curve, and Bid Ask. Spot is suitable for most pools; Curve is suitable for stablecoin pairs with low volatility; Bid Ask is suitable for pools with high volatility, but requires LPs to frequently adjust positions.

![Solana Ecosystem AMM Research: The Underlying Code Behind High Liquidity])https://img-cdn.gateio.im/webp-social/moments-e993d4d3b41f519e823ea34dc4d04263.webp(

## Summary

AMM, as an important component of Web3 finance, promotes the development of decentralized finance through its unique mechanism. With technological advancements and ecosystem improvements, AMM is expected to play a greater role in the future, further changing the landscape of traditional finance.

SOL-0.99%
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
  • 9
  • Repost
  • Share
Comment
Add a comment
Add a comment
No comments
  • Pinned