Mastering AMMs: A Complete Guide to Automated Market Makers

30 min read

At Three Sigma, we recognize the intricate opportunities within the Web3 space. Based in Lisbon, our team of experts offers premier services in development, security, and economic modeling to drive your project's success. Whether you need precise code audits, advanced economic modeling, or comprehensive blockchain engineering, Three Sigma is your trusted partner.

Explore our website to learn more.

We are not just experts in code, economic auditing, and blockchain engineering—we are passionate about breaking down Web3 concepts to drive clarity and adoption across the industry.

Introduction

This article provides a comprehensive overview of the current DeFi Automated Market Maker (AMM) ecosystem, with a focus on how these protocols function rather than their investment potential.

As part of a broader series, we will explore various Decentralized Exchange (DEX) models, starting with AMMs. Our goal is to break down the mechanisms and benefits that have contributed to the success of specific protocols.

Each AMM covered will be analyzed based on its year of deployment and the specific model it implements. We will highlight the unique features of each protocol, its core components, and the different use cases it supports. Additionally, we’ll explore the challenges these models face and discuss the market segments where they are best suited.

The following 33 protocols were included:

What Are AMMs?

Automated Market Makers are protocols based on decentralized trading pools that let users provide liquidity directly to markets allowing others to buy or sell tokens.

They represented a big advancement in DeFi, offering certain advantages over traditional on-chain order book models, such as continuous liquidity provision, faster transactions, reduced dependence on market makers, and simplified market access for users.

Older systems often struggled with challenges like excessive network transaction fees and high latency due to the inefficiencies of managing each order fully on-chain. Etherdelta, an early DEX operational from 2016 to 2018, used an order book model and faced similar issues, highlighting the need for more efficient trading solutions in the decentralized space. Similar to what we saw on the Perpetual Futures Landscape, very early projects faced regulatory scrutiny. In 2018 Etherdelta faced charges by the SEC.

The concept of AMMs began to materialize in 2017 when Bancor released a whitepaper introducing a novel pricing mechanism based on bonding curves. Despite its approach, Bancor's system received criticism for its inability to dynamically adapt to real market conditions. Critics highlighted that Bancor’s formulaic pricing, relying solely on token reserves rather than market equilibrium, rendered the protocol vulnerable to extreme market events. For instance, during bank runs or panic selling, Bancor would continue offering liquidity at prices above zero, even as market sentiment collapsed, leading to a depletion of its reserves.

Months later, Vitalik posted "On Path Independence”, an article idealizing the future of AMMs and introducing the constant product AMMs (CPMM) concept, which would become one of the most famous AMM models and the basis for Uniswap v1.

During late 2017, Hayden Adams designed a proof-of-concept AMM. Uniswap V1 would launch a year later, becoming the first widely successful CPMM in the crypto space.

With several years passing, AMMs continued growing and became the predominant subsector of the fourth-largest DeFi category, DEXes, with the highest number of active protocols compared to other subsectors. DEXes currently trails behind that of Liquid Staking, Lending, and Bridge sectors.

Source: https://defillama.com/categories

Research

In this series, we explore AMM protocols, anchoring our analysis around fundamental variables that dictate their performance and adoption. Our goal is to provide a comprehensive understanding of the differences and operational efficiencies across AMM protocols and models.

For this, we classified the protocols based on two variables.

Price discovery: The process by which the price of an asset is determined. This mechanism adjusts the price as trades are made, reflecting market demand and supply.

  • Internal on-chain price discovery → Price is determined within the AMM by the ratio of assets in its liquidity pool, adjusting as trades occur.
  • External off-chain price discovery → Prices within the system are influenced by external market data, which is integrated through oracles, solvers, or other external data sources.

Liquidity sources: The origin and management of the assets that enable trading within an AMM. The source of liquidity affects pricing, slippage, and overall market efficiency.

  • Internal Liquidity → AMMs rely solely on liquidity provided within their pools. Prices are adjusted based on the pool's asset ratio but may face higher slippage during volatility.
  • Outsourced Liquidity → External sources are integrated as the protocol does not rely on internal liquidity.

Note: AMMs are a specific subsector of DEXs, with other types such as order books and RFQs also existing within the broader design space. However, we're focusing on AMMs as they represent a highly decentralized and interesting primitive that enables fully on-chain, peer-to-pool (P2Pool) interactions.

To facilitate the visualization of the protocols and their corresponding launch and active periods, we have created a timeline featuring most of the protocols and their important versions.

This timeline will be zoomed in on 3 specific periods as the research develops.


2016-2018: The Experimental Phase of AMMs

The early development of AMMs was a period of significant experimentation and innovation. This initial phase introduced the concept of Constant Function Market Makers (CFMMs), pioneering mechanisms that would expand to include multi-token liquidity pools and invariant functions tailored for stablecoins. The foundational models here set the stage for the diverse and complex AMM systems that would follow.

Constant Function Market Makers (CFMM)

CFMMs are the foundational model for AMMs as they introduced predefined mathematical functions that determine the pricing of assets within a liquidity pool. The core principle is that the function's output remains constant before and after trades, ensuring that the balance of assets in the pool adheres to specific rules.

The general form of a CFMM is f(x1,x2,…,xn)=k, where {x1,x2,…,xn} are the quantities of different assets in the pool, and k is a constant.

In such systems, deposits for trading pairs are pooled within a smart contract, allowing traders to use this combined liquidity to swap tokens directly with the pool, rather than needing individual counterparties for each trade.

It is essential to differentiate CFMMs from bonding curves—another concept that utilizes mathematical functions to influence pricing, but in the context of token issuance rather than trading liquidity.

Bonding Curves describe the relationship between the price of a token and its supply. The model dictates that as more tokens are bought, the price ascends the curve; conversely, as tokens are sold, the price declines.

On the other hand, CFMMs manage the interaction between multiple tokens within a liquidity pool, ensuring that trades maintain a constant relationship between these tokens based on the pool's reserves. The function of a CFMM is designed to balance the quantities of different tokens to facilitate liquidity and enable trades between assets.

Building upon the concept of CFMMs, several subcategories of AMMs emerged, such as Constant Product Market Makers, Constant Sum Market Makers , and Constant Mean Market Makers . These models constitute a class of first-generation AMMs popularized by protocols like Bancor, Curve, and Uniswap.

Constant Product Market Maker (CPMM)

The first type of CFMM to gain prominence, notably through Bancor and Uniswap.

CPMMs operate on the basic formula x * y = k, which establishes a range of prices for two tokens according to the available quantities (liquidity) of each token.

In a CPMM, if the supply of one token increases due to a trade, the supply of the other must decrease to maintain the constant product k.

Graphically, this relationship is represented by a hyperbola, which shows that liquidity is always available, but at increasingly higher prices as one token becomes more scarce, with prices escalating towards infinity as availability narrows.

Building on the initial success of Bancor CPMM, Uniswap adopted the model to streamline token swaps and enhance liquidity provision.

Uniswap v1, though initially successful, had key limitations—such as requiring all token pairs to be ETH-based, leading to inefficient and costly ERC-20 swaps, and lacking robust price oracles, which left it vulnerable to manipulation—that Uniswap v2 addressed, making it a widely used protocol to this day.

In UNIv2, liquidity pools are created for pairs of different tokens. For a given pool, let x denote the number of tokens of Token_0 and y denote the number of tokens of Token_1. The trading function used by Uniswap is , which defines the valid trades within the pool.

The core principle is that a trade is valid if the function remains constant before and after the trade. This means the product of the token reserves must stay the same, adhering to the CPMM model.

To fix V1 problems, Uniswap V2 developed new features, with key ones being:

  • ERC-20 pairs. In Uniswap V1, having ETH as the base token for pools simplified routing but also presented the drawback of higher transaction fees. To trade USDC to USDT, users were forced to execute a two-step process via an ETH intermediary (USDC-ETH and then ETH-USDT), leading to additional costs. Both V1 and V2 exposed LPs to impermanent loss from price fluctuations in paired assets such as ETH. However, Uniswap V2 supports direct pairing of any ERC-20 tokens, like USDC-USDT, reducing routing inefficiencies and transaction costs.
  • Price oracle. Uniswap V2 can be used as a price oracle as follows. Uniswap records the cumulative sum of the prices so far in every block: . This record is made before the first trade of each block. Let be the time-weighted average price (TWAP) between . If someone wishes to use Uniswap as a price oracle, using specifically as their measure of the price, they only need to know to efficiently compute . The point of using an average price as an oracle instead of the price at an instant of time is that the first option is less prone to manipulation.
  • Flash swaps. Flash swaps enable traders to receive tokens and execute multiple swaps within the same transaction block before making any payments. This feature ensures the constant product rule is upheld post-trade, facilitating complex arbitrage strategies across different platforms without requiring upfront capital. If the transactions are not finalized within the same block, they fail.

Constant Sum Market Maker (CSMM)

CSMMs are another model designed to facilitate trades with zero-price slippage, adhering to the formula and representing a straight line graphically. This model keeps the sum of the reserves constant, ideally allowing trades without slippage.

However, CSMMs are vulnerable to arbitrage, especially when external market price ratios deviate from 1:1. Arbitrageurs can exploit these differences, depleting one reserve and leaving the pool with diminished liquidity for further trades. Due to these risks, CSMMs have not been widely adopted in AMM platforms, as they are prone to liquidity issues and market manipulation.

Trader Joe introduced a design called Liquidity Book that incorporates elements of the CSMM model. Unlike traditional CSMMs, which are vulnerable to arbitrage and liquidity depletion, Trader Joe's implementation uses a discretized bin structure to mitigate these risks while still leveraging the benefits of zero-slippage trades within specific price ranges. Within each bin of the Liquidity Book, the model behaves like a CSMM, offering constant sum dynamics for a narrow price range.

For example, consider an ETH/USDC pool with two adjacent bins:

  1. Bin A: ETH prices between 1000.00 and 1010.00 USDC
  2. Bin B: ETH prices between 1010.00 and 1020.00 USDC

Each bin acts as its own mini CSMM pool. As long as a trade occurs entirely within Bin A or Bin B, it will execute with zero slippage. This is because within each bin, the price is fixed, and the ratio of assets simply shifts along the constant sum line.


2019-2021 - The DeFi Summer

The debut of the first AMMs marked a significant innovation in DeFi, but not without challenges.

Early AMMs struggled with issues like impermanent loss, where liquidity providers lose compared to holding tokens as pool prices diverge, and low capital efficiency, leaving much of the liquidity underutilized and increasing price impacts on trades.

Another challenge is Loss-Versus-Rebalancing (LVR) a form of arbitrage that occurs when an AMM's price is outdated compared to another market, allowing traders to exploit the price difference at the expense of LPs. As CFMMs use constant product formulas, they are particularly vulnerable to this issue due to their static pricing, leading to LP losses as arbitrageurs rebalance across more liquid venues.

Despite advancements in the technology, these problems persist in many platforms, posing ongoing challenges to efficiency and profitability within the AMM landscape.

As the DeFi sector matured, particularly during the explosive growth of the 2020-2021 “DeFi Summer,” new AMM protocols emerged, either as forks or entirely new models, to tackle foundational challenges. These protocols iterated on earlier designs, incorporating new mechanisms and adding dynamism to address inefficiencies and enhance functionality.

The advent of Ethereum Layer 2’s further propelled this innovation, providing the groundwork for other models to be created, like hybrid automated market makers, dynamic automated market makers, proactive market makers, and virtual automated market makers. These models introduced features like smarter liquidity management, dynamic fee structures, and improved price alignment with external markets.

Important Upgrades

Uniswap v3

Uniswap v3 represents a significant evolution from its predecessor, building on its foundational aspects but incorporating new mechanisms that increase efficiency and offer users more control over their trading strategies.

Key Upgrades of Uniswap v3:

  1. Concentrated Liquidity:
    • The defining feature of Uniswap V3 is called concentrated liquidity. Roughly speaking, it works as follows. There are price ticks , for . For each tick , there is a liquidity . If the current price is , ( is the price of coin_0 in terms of coin_1) then the invariant which should be true during the trade is . Note however, that the price changes during the execution of the trade, and each portion of the trade, happening in a given tick, should use the appropriate invariant.
  2. Flexible Fees:
    • Addressing the one-size-fits-all fee approach of v2, Uniswap v3 offers multiple fee tiers (0.05%, 0.3%, 1%). This allows LPs to align fees with the risk associated with their provided liquidity. Pools involving more volatile assets can charge higher fees, compensating LPs for potential impermanent loss.
  3. Advanced Oracle Upgrades:
    • V3 improves upon the oracle functionality by using a time-weighted geometric mean for price calculations, ensuring that the oracle price is consistent regardless of the direction of trade. This enhancement resolves discrepancies in price reporting seen in v2 and provides more reliable data for DeFi applications relying on accurate price feeds.
  4. Range Orders:
    • Range Orders add the capability for users to make trades within specific price ranges, effectively creating limit orders.

Uniswap V3 presents several comparative advantages.

For Traders, the introduction of concentrated liquidity and range orders reduces slippage and ensures better price execution, lowering transaction costs and more giving them control over their trades. For LPs, while v3 allows them to concentrate their funds in price ranges they anticipate will be most active, it requires them to actively manage their investments and strategize their positions to maximize returns. This introduces a layer of complexity but also opens the door to potentially higher fees and rewards from increased trading volume in their chosen ranges.

Bancor V3

Bancor V3 introduced advancements to optimize its AMM into a Dynamic AMM, with a key feature being an omni-pool architecture, along with the following two additional features:

  • Single Liquidity Pool: Unlike previous versions where each token pair required separate liquidity pools, Bancor V3 consolidates all liquidity into a single pool, known as the Omnipool. This innovation drastically reduces the number of transactions required for trading different token pairs, as it eliminates the need for "double-hop" trades.
  • Efficient Token Swaps: To reduce gas fees and slipage on swaps, in the Omnipool, trades between any two tokens are executed directly, without converting to an intermediate token first.

V3 also introduces 'Infinity Pools,' which allow for unlimited single-sided staking. By removing the cap on how much liquidity can be provided to a pool, the protocol can scale liquidity as demand increases without waiting for available space in the pool.

Other features:

  • Dynamic Fee Adjustment: Bancor V3 allows for dynamic adjustment of trading fees based on market conditions. This flexibility helps in balancing the risk and reward for liquidity providers, especially in volatile market conditions.
  • BNT Staking and Rewards: With the introduction of the Omnipool, BNT stakers now benefit from a share of trading fees across all token pairs, not just the pairs they are directly involved in. This broad exposure maximizes fee-generation opportunities for stakeholders.
  • Instant Impermanent Loss Protection (removed): A feature that is not active anymore but worth highlighting is Bancors V3 instant IL protection. Unlike in V2.1, where IL protection gradually scaled up to 100% over 100 days, V3 provides full IL protection from the moment liquidity is deposited. This instant protection is coupled with a minimal early withdrawal penalty to discourage frequent in-and-out trading, thereby stabilizing liquidity. However, during extreme market volatility in June 2022, the costs to maintain this protection escalated dramatically. Large entities dumping rewards to cover liabilities, coupled with substantial BNT short positions, created a feedback loop where BNT depreciation led to more IL, requiring more BNT emissions. This ultimately forced Bancor to suspend the IL protection feature when the protocol's financial reserves were insufficient to cover the losses, undermining trust in its reliability.

Hybrid CFMMs

As AMM-based liquidity has progressed, we have seen the emergence of hybrid CFMMs that offer greater flexibility and efficiency by integrating features from various AMM models. These advanced designs can optimize liquidity management, adjusting risk exposure for LPs while minimizing price impact for traders.

An example of a highly effective hybrid CFMM is Curve. Curve’s model combines elements of both CPMM and CSMM to create dense pockets of liquidity, reducing price impact within specific ranges of trades.

The resulting price curve is mostly linear, providing low price impact trades, but becomes parabolic as liquidity approaches its extremes. This ensures liquidity is used efficiently, benefiting both LPs, who earn more through higher capital efficiency, and arbitrageurs, who rebalance the pool.

Curve is particularly known for offering low-price-impact swaps between tokens with a relatively stable 1:1 exchange rate, making it ideal for stablecoins or pegged assets. However, Curve quickly expanded its capabilities to support more volatile token pairs. Pools use liquidity more effectively by concentrating it around current market prices, dynamically adjusting as trades occur to maintain balance without causing losses to the pool.

Moreover, Curve V2 introduced a dynamic peg model to further optimize liquidity concentration and minimize slippage. This dynamic peg was developed in response to challenges, such as the stETH depegging crisis, where stable asset pools experienced liquidity imbalance and market price distortions. The dynamic peg allows Curve to adjust the pool’s internal price according to market conditions, using the variables:

  • , which determines how liquidity is concentrated near the pegging point, and
  • , which adjusts the pool’s price in the direction of the oracle price p*
  • A, the amplification coefficient, which shapes the liquidity curve to reduce price movement impact. The higher the 𝐴, the less curved the line is, decreasing relative price movements and minimizing the impact on the pool.

This feature dynamically shifts liquidity towards price points as market prices fluctuate, allowing the pool to adapt swiftly to market movements without the need for manual rebalancing by LPs.

Curve’s pools also feature variable fees (ranging from 0.04% to 0.40%), varying based on how close the price of the asset is from the internal oracle. This combination of features makes Curve highly efficient for both stable and volatile asset trading, while its dynamic peg model and smart liquidity management ensure competitive performance in DeFi.

Dynamic Automated Market Maker (DAMM)

DAMMs adjust key parameters like fees, liquidity, and reserve ratios in real-time to adapt to market conditions.

Unlike Hybrid AMMs, which concentrate liquidity in fixed price ranges, DAMMs offer more flexibility for managing unpredictable assets. For instance, Sigmadex uses a DAMM model that leverages Chainlink Price Feeds and implied volatility to dynamically adjust the behavior of the AMM curve. This means that instead of redistributing liquidity, it dynamically adjusts the shape and slope of the pricing curve based on external market conditions, allowing for more effective responses to market volatility.

DAMMs adjust their algorithms dynamically, incorporating multiple variables to adapt to changing market conditions. In low volatility periods, they concentrate liquidity near the market price for greater capital efficiency. Conversely, during high volatility, they distribute liquidity more broadly to reduce exposure to impermanent loss.

A notable example is the Kyber DMM, which adjusts fee parameters based on market conditions. This allows LPs to earn higher fees during volatile periods, while traders benefit from lower fees when the market is stable.

Kyber implements a Dynamic Fee model that responds to market volatility as measured by the on-chain volume of each pool. The fee adjustment mechanism is based on pool volume, comparing short-term and long-term volume using Simple Moving Average (SMA) or Exponential Moving Average (EMA).

The core function for calculating the amount of asset Y (Δy) received when selling an amount of asset , where and are current inventories of assets X and Y, fee is the base fee predefined by the AMM, and is the variant factor based on average volume, satisfying: -fee ≤ < 1 - fee.

Some other key aspects of Kyber's model include:

  • Liquidity Aggregation and Routing: To address liquidity fragmentation, Kyber pools resources from multiple DEXs, reducing slippage and ensuring traders access the most favorable rates by routing trades through the most efficient liquidity paths.
  • Customizable Capital Allocation for LPs: The platform enables LPs to specify the price ranges in which they wish to allocate their capital, enhancing market depth, minimizing price impact, and optimizing trade execution.
  • Real-Time On-Chain Price Service: Unlike traditional pricing services, Kyber’s on-chain price service provides prices based on real-time, network-specific liquidity, ensuring that the price data reflects actual trading conditions and is immediately actionable.

Meteora a DLM model on Solana, enhances liquidity provision by incorporating dynamic fees and discrete zero-slippage price bins, optimizing how liquidity is concentrated and traded.

The protocol segments liquidity into discrete bins, each associated with a specific price range. Within these bins, liquidity is used for swaps at pre-defined prices, eliminating slippage when trading within the same bin. This model is a departure from traditional AMMs like Uniswap, which distribute liquidity across a continuous price curve, resulting in variable slippage.

Like Kyber, Meteora implements a Dynamic Fee model responsive to market volatility, measured by price movements across liquidity bins. The total swap fee combines a base fee and a variable fee. The base fee is , where is the base factor and is the bin step. The variable fee is calculated as , where is a control parameter and is the volatility accumulator. This accumulator tracks recent market activity using volatility reference, index reference, and bin crossings. The system adjusts fees based on trading frequency, using filter and decay periods to dynamically respond to market conditions.

Strategic Benefits for Users and Project Teams:

  • LPs: The ability to create precise liquidity "shapes" allows LPs to tailor their liquidity to better suit their trading strategies and the market’s needs, potentially maximizing their returns while minimizing risks.
  • Project Teams: DLMM offers novel approaches for token launches, such as bonding curves that reward early adopters and create organic price discovery mechanisms. Additionally, the flexibility of the DLMM model allows for innovative token economics and liquidity strategies.
Note that DAMM and dAMM are not the same. DAMM here as Dynamic Automated Market Maker vs Distributed Automated Market Makers (dAMMs). For the latter, we have a separate article. The distributed AMM (dAMM) is an AMM powered by L2 technology that enables liquidity to be bridged on L2 while remaining unfragmented on L1. Go check it out here: https://threesigma.xyz/blog/damm

Proactive Market Maker (PMM)

Proactive AMMs aim to predict market shifts and adjust parameters before changes occur.

They use predictive models, historical data, and external price feeds to adjust parameters preemptively. For example, a PMM might analyze past trading volumes during specific market events to anticipate liquidity needs.

While this approach could potentially reduce impermanent loss and improve capital efficiency, accurate prediction in volatile crypto markets remains challenging. PMMs are still experimental, with few implementations in production environments, making their long-term effectiveness unproven compared to established dynamic models.

PMMs enable single-sided liquidity provision, simplifying portfolio management for providers by using external price oracles for market-aligned pricing. With segmented pools for base and quote assets, their algorithms optimize bonding curves and rebalance asset ratios in response to market conditions. Dynamic fees adjust to volatility, while customizable liquidity depth allows fine-tuning across price ranges.

Also aiming to increase liquidity on its protocol, DODO is using a PMM that mimics the human market-making behaviors of a traditional central limit order book.

The PMM algorithm integrates external price oracles to obtain the current market mid-price of assets. It then adjusts the prices within the pool to align with these external prices, using the following pricing formula:

DODO's PMM algorithm adjusts asset prices based on changes in the pool's inventory to mimic the behavior of professional market makers. When the inventory of an asset decreases below its target level , indicating that traders are buying the asset, the PMM increases the price to discourage further buying and encourage selling, thereby aiming to restore the inventory balance. Conversely, when the inventory exceeds the target , indicating that traders are selling the asset, the PMM decreases the price to encourage buying and reduce the excess inventory.

The slippage coefficient controls the sensitivity of the price relative to inventory changes. A smaller value concentrates liquidity around the market price, resulting in lower slippage for trades. When , the PMM formula resembles the CPMM formula used in traditional AMMs like Uniswap.

Building upon its PMM algorithm, DODO V3 introduces several technical innovations:

  • Dual Liquidity Structure: DODO V3 implements a dual liquidity model comprising the Vault and the Pool:
    • Vault (for Liquidity Providers - LPs): LPs deposit assets into the Vault, which functions as a lending pool. These assets are made available for Strategy Providers (SPs) to borrow. LPs earn interest on their deposits, with interest rates dynamically adjusting based on asset utilization.
    • Pool (for Strategy Providers - SPs): SPs manage their own Pools, borrowing assets from the Vault to implement market-making strategies. The borrowed assets are used within the Pool to provide liquidity. SPs can deposit or withdraw their own assets at any time but must adhere to collateral requirements.
  • Flexible Leverage and Collateral Management: SPs can engage in leveraged market-making by borrowing assets beyond their initial capital:
    • Borrowing Mechanism: SPs borrow assets from the Vault to enhance liquidity in their Pools. Borrowed funds remain within the Pool and cannot be withdrawn externally.
    • Collateral Ratios: DODO V3 monitors two key collateral ratios to manage risk: Regular Collateral Ratio and Borrowing Collateral Ratio.
  • Dynamic Interest Rates: Interest rates are asset-specific and adjust dynamically based on borrowing demand:
    • Interest Calculation: Interest accrues on borrowed assets and compounds during deposit, withdrawal, borrowing, and repayment operations.
    • Rate Adjustment: As the borrowing ratio of an asset increases (more of the asset is borrowed), the interest rate for that asset rises. This incentivizes repayment and balances supply and demand within the Vault.

Automated Liquidity Manager (ALMs)

ALMs protocols are tools that use sophisticated algorithms to dynamically manage concentrated liquidity positions on AMMs like Uniswap v3. The main objective of ALMs is to optimize the placement of liquidity to coincide with the most active trading ranges, thereby maximizing potential returns through increased fee collection, improving capital efficiency, and minimizing risks associated with LPing.

Core Functions of ALMs:

  • Dynamic Range Adjustment: ALMs adapt liquidity ranges based on market conditions, ensuring capital is deployed efficiently in volatile markets. However, rebalancing can be costly due to high gas fees, especially when positions fall outside active trading ranges, requiring LPs to either wait or incur repositioning costs.
  • Risk Mitigation: ALMs help reduce impermanent loss by recalibrating liquidity positions in response to market price shifts, protecting LPs from significant losses in concentrated liquidity environments.
  • Algorithmic Strategy Implementation: ALMs use algorithmic strategies based on market data to optimize liquidity placement, though these can be resource-intensive. Off-chain management via oracles can reduce costs, while passive strategies, like stETH-ETH pairs, offer cost-effective fee earning with minimal intervention.

Arrakis PALM (Protocol Automated Liquidity Management) is a liquidity bootstrapping mechanism designed to create deep liquidity for tokens on Uniswap V3. Built on Arrakis V2, PALM enables protocols to manage their token liquidity by leveraging organic trading volume rather than relying on liquidity mining or bonding.

PALM allows protocols to seed initial liquidity with an imbalanced ratio (e.g., 95% governance token and 5% base asset) and progressively adjust it towards a balanced 50:50 ratio by strategically placing Uniswap V3 positions. PALM doesn't directly swap assets; instead, it adjusts liquidity positions based on market movements, ensuring minimal price impact and avoiding the negative effects seen in liquidity mining or bonding. Additionally, this dynamic management of liquidity positions not only maintains a desired inventory composition but also generates transaction fees for the protocol.
Below we can see the GEL/WETH pool on Ethereum, despite at the beginning being 95% GEL and 5% ETH, PALM rebalanced to 60/40.

Additionally, this dynamic management of liquidity positions not only maintains a desired inventory composition but also generates transaction fees for the protocol.

  • Market Making: PALM dynamically manages liquidity by moving liquidity positions according to price movements, without price impact.
  • Inventory Management: As the price moves, PALM captures base assets or governance tokens from LP positions, maintaining a desired inventory composition to support ongoing trading volumes.

This mechanism is particularly useful for protocols that need deep, sustainable liquidity for their governance tokens without selling tokens or incurring the costs associated with renting liquidity.

Gamma is another ALM that serves a large variety of DEXs (including Uniswap) across many networks.

The Dynamic Range and Stable strategies are specifically tailored to reduce impermanent loss while maximizing fee earnings for LPs. Gamma’s strategies are considered range-based for the most part, but it can be argued that overly narrow ranges requiring frequent rebalancing would involve some elements of capital efficiency maximizing strategies:

  • Dynamic Range Strategy - These strategies involve automated rebalancing of liquidity ranges when certain triggers (e.g., price movements) are hit. They also come in two flavors: narrow and wide. As the names suggest, they indicate the spread of liquidity provided. Narrow ranges cater to risk-tolerant LPs, providing more fees but more subject to impermanent loss (IL) during volatility. Conversely, wide ranges are aimed at less risk-tolerant LPs, minimizing IL during periods of volatility at the cost of earning somewhat lower fees. Accrued fees are compounded back into positions regularly, enabling a passive LP experience.
  • Stables Strategy - Similar to Dynamic Range but tailored for stablecoin pairs. Unlike the standard Dynamic Range strategy, liquidity ranges are based on historical data rather than dynamically adjusting to live price movements.

Replicating Market Makers (RMMs)

Originated in 2021 in this paper by Angeris, Tarun, and Alex Evans, RMMs replicate TradFi instruments like options within the framework of CFMMs, creating a bridge between complex financial derivatives and blockchain-based systems.

The core idea behind RMMs is to align the CFMM's portfolio value function (which represents the value of liquidity providers’ holdings) with a specific, desired payoff structure. This payoff structure can be:

  • Concave: Reflecting diminishing returns as input increases.
  • Nonnegative: Ensuring the payoff is never negative.
  • Nondecreasing: Guaranteeing that the payoff doesn’t decrease as input grows.
  • 1-Homogeneous: Meaning the payoff scales proportionally with the size of the input.

RMMs utilize the equivalence between the space of desirable payoff functions and convex CFMMs, using Fenchel conjugacy from convex analysis for the practical construction of these market makers. They can be constructed using simple tools from convex analysis, making them accessible for developers to integrate sophisticated financial instruments into DeFi projects.

RMMs have struggled to gain traction in the AMM space due to a few key factors. First, RMMs rely on financial models that require more computational power, leading to higher gas fees, which can discourage traders and liquidity providers. Second, RMMs spread liquidity across more specialized pools, reducing their overall impact unless user adoption increases significantly. Lastly, RMMs cater to niche financial products like options and derivatives, appealing to a smaller user base compared to simpler AMMs used for regular trading pairs.


2022-2024» - The Optimization Era

From 2022 onward, AMMs had firmly established themselves with effective models that gained significant traction and have infrastructure capable of addressing many past challenges. Despite the persistence of issues like impermanent loss and Latency Vulnerability Risk (LVR), these problems became less pronounced in most protocols due to improved designs and risk management strategies.

As a result, the community's focus shifted towards optimizing the core mechanics of AMMs, aiming to enhance capital efficiency, reduce friction, and provide a more seamless user experience. This period marked a transition from merely overcoming foundational hurdles to fine-tuning and innovating within the established frameworks, propelling the AMM ecosystem into a new era of sophistication and maturity.

2022 Upgrades

Trader Joe

Trader Joe introduced a design called Liquidity Book that incorporates elements of the CSMM model. Unlike traditional CSMMs, which are vulnerable to arbitrage and liquidity depletion, Trader Joe's implementation uses a discretized bin structure to mitigate these risks while still leveraging the benefits of zero-slippage trades within specific price ranges. Within each bin of the Liquidity Book, the model behaves like a CSMM, offering constant sum dynamics for a narrow price range.

For example, consider an ETH/USDC pool with two adjacent bins:

  1. Bin A: ETH prices between 1000.00 and 1010.00 USDC
  2. Bin B: ETH prices between 1010.00 and 1020.00 USDC

Each bin acts as its own mini CSMM pool. As long as a trade occurs entirely within Bin A or Bin B, it will execute with zero slippage. This is because within each bin, the price is fixed, and the ratio of assets simply shifts along the constant sum line.

VE (3,3) AMM

In January 2022, Solidly was introduced, aiming to enhance AMM mechanics by integrating features from protocols like Uniswap and Curve.

While its AMM design wasn't groundbreaking, Solidly's key innovation lay in its tokenomics—specifically, the introduction of the ve(3,3) model. This model combined Curve's vote-escrowed token mechanism (veCRV) with OlympusDAO's game-theoretic (3,3) staking incentives, seeking to align user participation with long-term protocol health.

Despite its innovative approach, Solidly faced challenges such as technical bugs and issues with token emissions, which affected its viability. However, its foundational concepts inspired other projects to refine and improve upon its principles. Notable examples of protocols that built upon Solidly's ideas include Thena, Velocore, Aerodrome on the Base network, and Velocimeter.

Key Technical Innovations

  • Hybrid AMM Design: These platforms combine elements from Uniswap's concentrated liquidity and Curve's stable swap models. This hybrid approach allows them to offer both stable and volatile pools, catering to different asset types and market conditions.
  • Concentrated Liquidity with Dynamic Fees: Leveraging Algebra's technology, they enable liquidity providers to allocate capital within specific price ranges. Dynamic fee structures adjust in response to market volatility, improving capital efficiency and reducing slippage.
  • Advanced Liquidity Management: The protocols incorporate algorithms that automatically adjust liquidity positions based on market movements. This dynamic management enhances price discovery and minimizes impermanent loss.

Pool Types and Features

  • Stable Pools: Utilize modified stableswap formulas ideal for assets with minimal price variation, like stablecoins, ensuring low slippage and efficient swaps.
  • Volatile Pools: Designed for assets with significant price fluctuations, these pools allow for adaptive rebalancing and efficient trading in more volatile markets.
  • Dynamic Pools (Thena's FUSION): Specifically tailored for assets with evolving price pegs, such as liquid staking derivatives, providing flexibility in liquidity provision.

Incentive Mechanisms

  • Emissions: Through an optimized emissions schedule and the use of tools such as gauge voting and incentives, these protocols more effectively align incentives with liquidity providers, fostering more sustainable liquidity.
  • Anti-Dilution Measures: Enhanced mechanisms safeguard the value of rewards for participants, supporting long-term engagement and promoting stability within the ecosystem.

2023 Upgrades

Ambient Finance

Formerly known as Crocswap, Ambient is an AMM that integrates various forms of AMMs—including concentrated liquidity, CPMMs, and knockout liquidity—into single liquidity pools. Its single-contract design also significantly reduces gas costs for trades and LP management.

Ambient Finance uses both permissionless and permissioned pools. Permissionless pools allow unrestricted user actions for any token pair, while permissioned pools control access via a pre-set oracle. Pool types use 256-bit values, enabling extensive customization.

Key Features of Ambient:

  • Dual Liquidity Model: The platform supports both concentrated and ambient (full-range) liquidity models. LPs can specify price ranges to allocate their capital. The full-range liquidity model makes fees automatically compound back into the pool.
  • Knockout Liquidity: Knockout liquidity is a specialized form of range-based concentrated liquidity. It's permanently removed when the price crosses the specified range boundary, either below the bottom (bid) or above the top (ask). Unlike traditional concentrated liquidity, it doesn't revert once triggered, effectively locking in the position. This mechanism is similar to limit-orders but with the key difference that it operates within a fixed range rather than at a single price point.
  • Dynamic Fee Structure: Like most AMMs from this section, Ambient also implements dynamic liquidity fees. A policy oracle monitors the performance of Uniswap v3 fee tiers and updates Ambient's fee structure every 60 minutes. This adjustment occurs without changes to the underlying smart contract, dynamically toggling the pool fee to reflect the best-performing liquidity tier. Per their calculations, having a dynamic fee model is far more profitable for LPs compared to LP’ing on a 30bps or 100bps pool. And way better than LP’ing on a 5bps pool, where LPs lose money. Source here.
  • Grid Improvement and Tick Adjustment: The platform features a grid improvement mechanism that enhances tick granularity when range orders cross a threshold determined by protocol governance.
  • Transaction Fee Redistribution: Fees collected from trades are redistributed to liquidity providers proportionally, incentivizing continued liquidity provision and compensating them for market risks.

Maverick AMM

Maverick AMM introduced a range-based AMM model designed to enhance capital efficiency by automatically adjusting liquidity positions to stay near the market price. This system allows LPs to engage in strategic, directional bets on price movements while earning fees.

Maverick improves trading efficiency by concentrating liquidity within selected price ranges, reducing slippage, and optimizing trade execution. Through customizable liquidity movement modes, LPs can precisely manage how their liquidity adjusts to market fluctuations, tailoring their strategies based on risk preferences and market behavior.

Advancements in Maverick v2: Building on the solid foundation laid by its predecessor, Maverick v2 introduced improvements and new features that aimed to further refine the functionality and user experience:

  • Reduced Gas Costs for Swaps: Maverick v2 drastically lowered the gas fees associated with swaps.
  • Programmable Pools: This feature allowed for the creation of specialized pools with custom logic, such as KYC compliance or dynamic fee adjustments, tailored to specific needs.
  • Directional Swap Fees: LPs could now set different fee structures based on the direction of the swap.
  • Boosted Position Incentives: Through the introduction of vote-escrowed token voting, Maverick v2 enabled LPs to align incentives more closely with their participation and investment in the ecosystem.

PoolShark

Poolshark provides flexibility and enhances capital efficiency with advanced liquidity management tools, giving traders and liquidity providers greater control in volatile markets. They use 3 types of pools:

  1. Range Pools: These function similarly to concentrated liquidity models, like those in Uniswap V3. Liquidity providers select a specific price range for their assets. This model enables providers to concentrate liquidity within specific price bounds.
  2. Limit Pools: Limit pools offer a unique way to place limit orders on-chain. They split buy and sell orders, aggregating the best-priced liquidity for each direction. This allows traders to undercut market prices, offering a way to execute larger trades with price priority​.
  3. Cover Pools: These pools help users hedge against volatility and impermanent loss by allowing liquidity to be unlocked over a range of prices. Using a Gradual Dutch Auction (GDA) mechanism, Cover Pools adjust prices dynamically, ensuring liquidity can be sold or bought at the best possible price, even during volatile market conditions.

The AMM automatically rebalances liquidity as prices change, for example, in a ETH/USDC pool, it would buy more ETH as its price rises, which would reduce its USDC reserves. This leads to concerns about path dependency—where the AMM might lack enough liquidity (e.g., USDC) when users later want to sell ETH. Additionally, there’s a risk the AMM might overreact to temporary price moves

2024 and onwards Upgrades

Intents

Intents are not a new concept outside of crypto. An intent represents the user’s desired outcome, allowing a solver (or filler) to determine the best steps to achieve it. For example, swapping 1 ETH for at least 2500 USDC. If the solver finds a better rate, they could complete the swap at 2500 USDC, keeping or sharing any surplus with the user.

Though intents aren’t tied to any specific protocol or exclusive to AMMs, their emergence marks a shift in architecture. The rise of intent-based protocols is noteworthy.

A widely held view is that intents will dominate order flow for major assets like USDC, USDT, ETH, and BTC. Meanwhile, LPs on AMMs could find themselves trading only less desirable, long-tail assets that solvers on intent-based platforms avoid.

Protocols such as Uniswap-X, CowSwap, and 1Inch are gradually gaining traction. Over the past 30 days, for instance, $2.3 billion was traded via the Uniswap front-end and wallet, compared to $587 million on Uniswap-X, according to data from Orderflow.art

The same can be seen in this Dune chart, which shows how the volume has increased on intent-based protocol, especially since H2 2023.

Uniswap V4

Uniswap V4 brought with itself one of the biggest updates in recent years, introducing hooks as a new method to customize liquidity pools and trading strategies.

Hooks are externally deployed contracts that execute developer-defined logic at specific points during the lifecycle of a trade or at strategic points as defined by the hook. Hooks allow for customization and the addition of new functionality to concentrated liquidity pools.

When creating a pool on Uniswap V4, the creator can specify a hook contract. This hook contract contains the custom logic that the pool will call out to during its execution. The hook contract can implement various functionalities and modify pool parameters. Some examples of functionalities that can be implemented using hooks include executing large orders over time and implementing on-chain limit orders for traders, introducing volatility-shifting dynamic fees and internalizing MEVs for LPs, and implementing custom oracle solutions.

Uniswap V4 supports several hook callbacks, and the address of the hook contract determines which callbacks are executed. The current version of Uniswap V4 supports eight hook callbacks, which are executed at different stages of the pool's lifecycle:

  1. beforeInitialize/afterInitialize: These hooks are called before and after the initialization of a pool, allowing for custom logic to be executed during the pool creation process.
  2. beforeModifyPosition/afterModifyPosition: These hooks are called before and after modifying a position within a pool, providing an opportunity to add custom logic when changing position parameters.
  3. beforeSwap/afterSwap: These hooks are called before and after executing a swap within a pool, enabling the execution of custom logic during the swapping process.
  4. beforeDonate/afterDonate: These hooks are called before and after donating to a pool, providing the ability to customize the donation process.

By using hooks, developers can extend and enhance the functionality of Uniswap V4 pools beyond the core protocol by utilizing a flexible and customizable execution framework.

Another significant change in V4 is the introduction of a singleton contract model, also known as unified liquidity. Unlike previous versions that used a factory model to create new pool contracts for each trading pair, V4 manages all pools within a single contract.

The singleton model significantly reduces the costs associated with pool creation and multi-hop trades, making it more accessible to the entire user base of the protocol. It also allows for better liquidity management across all pools.

Uniswap X

UniswapX is a new protocol introduced by Uniswap that extends its functionality rather than serving as a direct upgrade to previous versions like V1, V2, V3, or V4. It offers several unique features through a Dutch auction-based decentralized trading mechanism, distinguishing it from earlier iterations.

UniswapX operates through a structured process starting with Order Initiation and Signing, where a swapper requests and selects quotes from fillers, and then signs an order with specific parameters. Following this, in the Order Fulfillment and Adjustment phase, a chosen filler fulfills the order or adjusts it to the next best offer. The order price is updated over time based on a predefined decay function. Lastly, during Execution and Price Improvement, fillers may fulfill orders if profitable, which can potentially improve the price for swappers. Key features of Uniswap X include:

  • Dutch Auction-Based Trading System: This design employs a Dutch auction mechanism where the price of an order decreases over time, creating a competitive environment among fillers—agents who execute orders—to secure the best possible price for swappers.
  • Liquidity Aggregation and Gas-Free Swaps: The system aggregates liquidity from both on-chain and off-chain sources, which improves execution quality. It introduces gas-free swaps where fillers cover the gas costs, incorporated into the execution price. Additionally, it supports cross-chain swaps, enabling trading across different blockchains in a single action.
  • MEV Internalization: The platform internalizes MEV, returning any surplus to swappers as price improvement.
  • No Additional Fees and the Liquidity-Fee Flywheel: This does not impose additional fees beyond filler profits and optional protocol fees. Success is driven by a "liquidity-fee flywheel": high liquidity attracts traders, generating fees that attract more liquidity providers, creating a self-reinforcing cycle.

Function-Maximizing Market Makers (fm-AMM)

The FM-AMMs design operates under the central assumption that trades are batched before execution. By leveraging competition among arbitrageurs, FM-AMMs effectively eliminate arbitrage profits, LVR, and sandwich attacks. On an FM-AMM, the price at which a given trade x is executed equals the marginal price after the trade is executed. This implies that an FM-AMM 'moves up' the curve with each trade

In practical applications, FM-AMMs have been evaluated across 11 token pairs using Binance price data to simulate the lower bound returns for liquidity providers. The findings indicate that the lower bound returns from providing liquidity to an FM-AMM are generally slightly higher than the empirical returns observed on Uniswap v3, which remains the dominant AMM platform.

CoW Swap and Sorella Labs are at the forefront of pioneering FM-AMMs.

CoW Swap, which stands for Coincidence of Wants, differentiates itself from other DEXes by prioritizing direct P2P trades and utilizing solvers when P2P is not feasible. This hybrid approach not only reduces gas costs and LP fees but also diminishes the potential for MEV attacks, a common exploit in other DEX formats. CoW Swap's FM-AMM framework batches trades together, which are then executed at a uniform clearing price, ensuring that each trade "moves up the curve" to maintain price accuracy and fairness.

The novel element of CoW Swap’s AMM lies in how it manages transaction execution:

  • Solver Competition: Solvers within the CoW ecosystem compete to find the most optimal way to execute trades against the AMM, effectively making sure that the liquidity pool always operates at an equilibrium price.
  • Batch Auctions: By batching trades together, CoW AMM mitigates the risks of arbitrage that typically exploit price discrepancies, thereby protecting the interests of liquidity providers.

Sorella Labs operates under a similar ethos, focusing on creating solutions that group transactions in a way that they all share the same execution price within a block. This method, termed "batch auctions," significantly reduces the arbitrageur's advantage by eliminating the opportunity for riskless profit, which Ludwig Thouvenin from Sorella Labs argues should not exist in a well-functioning market.

Common Ground and Distinctive Approaches

Both CoW Swap and Sorella Labs utilize the FM-AMM framework to enhance the efficiency of token exchanges and protect liquidity providers from the pitfalls of previous AMM designs. However, their applications of the FM-AMM concept diverge in their specific mechanisms and goals:

  • CoW Swap aims to optimize trade execution by using a competitive model among solvers, thus ensuring that liquidity providers receive the best possible outcome from trades executed against the AMM.
  • Sorella Labs, on the other hand, is more focused on redefining how transactions are batched and priced to create a more equitable trading environment that directly tackles the MEV issues prevalent in current DEXs.

Automated Liquidity Manager AMMs (am-AMMs)

am-AMMs operate by conducting censorship-resistant on-chain auctions to appoint a temporary pool manager for a constant-product AMM. The pool manager sets the swap fee rate and receives the accrued fees from trades. Additionally, the manager can engage in arbitrage to align pool prices with the market and adjust fees based on retail order flow and changing market conditions, thereby enhancing benefits for liquidity providers.

Liquidity providers can freely enter and exit the pool, subject to a small withdrawal fee. Under certain conditions, am-AMMs are expected to achieve higher liquidity equilibrium compared to standard fixed-fee AMMs. However, protocols still need to implement am-AMMs.

Valantis

Valantis is designed for flexible token exchange through Algorithmic Liquidity Modules (ALMs), don’t confuse it with Automated Liquidity Managers (ALMs).

Valantis features two distinct pool types: Sovereign Pools, which allow custom pricing, and Universal Pools, aimed at reducing liquidity fragmentation.

The Hybrid Order Type (HOT) introduces a unique feature to Valantis by combining two execution modes: a permissionless AMM and a request-for-quote (RFQ) system. This design minimizes liquidity risk and optimizes pricing through a dynamic, time-based fee structure.

HOT enhances liquidity by offering stable and competitive pricing, while protecting LPs from losses due to market volatility and arbitrage. The system also supports rebase tokens and reduces top-of-block arbitrage by resetting spot prices after trades.

Currently, the HOT signer is a centralized component operated by Valantis Labs and partner liquidity managers such as Arrakis. It has facilitated roughly $12m in volume over the past 2 months with $415k in TVL.

VAL tokens govern the protocol, enabling users to influence key updates and incentives.

Conclusions

The evolution of AMMs has been transformative, offering technical advancements, new use cases, and challenges that continue to shape DeFi.

Through this article, we have examined key innovations in the design space, focusing on models such as CPMMs, CSMMs, and advanced systems like hybrid and dynamic AMMs. Each of these approaches offers specific trade-offs that developers must consider when designing an AMM.

Capital Efficiency and Liquidity Management

The development of concentrated liquidity models, as seen in Uniswap V3 and hybrid systems like Curve, reflects a trend toward maximizing capital efficiency.

However, these improvements come at the cost of increased complexity in liquidity management. Developers must weigh the benefits of higher returns against the risks of impermanent loss and the need for more active LP involvement.

Price Discovery and Market Integration

AMM protocols handle price discovery either through internal liquidity (relying solely on liquidity pool ratios) or by integrating external market data via RFQs, market makers, etc.

Internal mechanisms, such as in CPMMs, are “straightforward” but may struggle with slippage and inefficient pricing during market volatility. Hybrid models like DAMMs offer more responsive pricing by dynamically adjusting fees and liquidity to external market signals, but these require additional infrastructure and increase the complexity and risks for LPs. Developers must consider how critical off-chain data is to their protocol and balance this with the cost and security risks of external integration.

Mitigating Impermanent Loss (IL)

Impermanent loss remains a significant challenge for LPs on AMMs, specially on concentrated liquidity AMMs. Solutions like Bancor’s (now-deprecated) IL protection feature can work for some time, until they fell apart.

Curve’s dynamic peg model, attempt to mitigate this risk but are not foolproof. For example, in the event of a stablecoin depeg, as the pool’s liquidity is depleted, the pricing curve becomes increasingly flat, leading to sharp spikes at the ends, as a result of having a skewed inventory. This can result in impermanent loss for LPs who enter or exit the pool during these periods.

As AMM designs become more sophisticated, managing IL without overcomplicating user experience or increasing gas fees becomes a central challenge. Protocols that can optimize for both efficiency and user protection will likely see greater adoption.

User Experience and Technical Sophistication:

There is a growing divide between the sophistication of AMM models and their accessibility to non-sophisticated users.

Early models allowed virtually anyone to become a LP. Later on, the introduction of concentrated liquidity, or intents, made this a lot harder. Sure, anyone can still LP on Uniswap V3, but how many can be profitabe?

The future of AMMs may depend on their ability to offer sophisticated liquidity management tools while maintaining a seamless and intuitive user experience. Developers have a hard choice, appeal to professional market makers and other sophisticated actors that literally make markets 24/7 or try to reduce the friction in user interactions for non-technical users.

Future Outlook and Mainstream Adoption:

Despite the growing interest from developers and the introduction of more sophisticated AMMs, such as hybrid CFMMs, DAMMs, and PMMs, the volume on DeFi remains a small fraction compared to the overall cryptocurrency volume and an even smaller fraction of the global financial system. For DeFi to create a new economic paradigm, it must overcome this adoption barrier.

The newer protocols target issues like impermanent loss, impermanent loss, MEV, capital efficiency, and slippage. Yet they often add complexity to the ecosystem, returning to a problem that has daunted DeFi since its inception.

Reach out to Three Sigma, and let our team of seasoned professionals guide you confidently through the Web3 landscape. Our expertise in smart contract security, economic modeling, and blockchain engineering, we will help you secure your project's future.

Contact us today and turn your Web3 vision into reality!

References