Futuristic DeFi landscape with AMM pools protected from MEV attacks.

Dynamic AMMs: How to Protect Your Investments from Multiblock MEV Attacks

"Discover the hidden vulnerabilities in dynamic Automated Market Makers (AMMs) and how innovative protections can safeguard your assets from sophisticated MEV exploits."


In the fast-evolving world of decentralized finance (DeFi), Automated Market Makers (AMMs) have become essential for trading digital assets. Unlike traditional markets that rely on order books, AMMs use mathematical formulas to determine the prices of assets. Constant Function Market Makers (CFMMs) are a common type of AMM, but dynamic AMMs, which include liquidity bootstrap pools (LBPs), Temporal-function market makers (TFMMs), and replicating market makers (RMMs), introduce new complexities and potential vulnerabilities.

One critical concern is the risk of Maximal Extractable Value (MEV) attacks, where malicious actors exploit blockchain mechanics to profit at the expense of other users. While MEV in CFMMs is relatively well understood, dynamic AMMs present novel attack vectors. This article explores how inter-block weight changes in dynamic AMMs can be exploited, leading to multiblock MEV attacks, and examines the protections needed to guard against these threats.

We'll delve into how attackers can manipulate pool weights across multiple blocks, similar to 'sandwich attacks,' but targeting liquidity providers (LPs) rather than individual traders. By understanding these vulnerabilities and the proposed guardrails, you can better protect your investments in dynamic AMMs.

AI Search Multiple angles on this topic

An Emerging Multiblock Risk

The supplied sources give no quantified estimates of multiblock MEV’s frequency or financial impact. They describe inter-block weight changes in dynamic AMMs as a potential new attack vector, distinct from the comparatively well-understood MEV in constant-function market making. The 2024 paper presents itself as the first public study of potential multiblock attacks on dynamic AMMs and defenses, with possible relevance to Liquidity Bootstrap Pools and Replicating Market Makers.

Limits of Conventional AMM Defenses

The provided sources describe sandwich attacks in constant-function market makers: deterministic transaction ordering within a block can let a searcher place buy and sell trades around a user's pending swap and extract value from slippage. The research abstracts supplied here ask whether dynamic weights in Liquidity Bootstrap Pools, Temporal-function Market Makers, and Replicating Market Makers create additional attack vectors. They identify inter-block weight changes as analogous to trades, indicating that methods focused on within-block transaction ordering may not address this risk.

A First Public Study

The supplied paper description calls its work the first public study of potential multiblock MEV attacks on dynamic AMMs and defenses. Its research question is whether dynamic weights in Liquidity Bootstrap Pools, Temporal-function Market Makers, and Replicating Market Makers introduce attack vectors beyond those known in constant-function market making. A separate source says the paper uses mathematical derivations for price-manipulation costs and arbitrage returns, and reports more than 450 million numerical simulations testing attack viability under proposed guardrails.

Understanding Temporal-Function Market Making (TFMM)

Futuristic DeFi landscape with AMM pools protected from MEV attacks.

Temporal-Function Market Making (TFMM) pools differ from traditional AMMs by incorporating time-varying trading functions. In a TFMM pool, the portfolio vector, which represents the allocation of assets, changes from block to block. This dynamic adjustment responds to market information, creating arbitrage opportunities that incentivize external agents to rebalance the pool's holdings to match target allocations.

The trading function in a TFMM pool can be expressed as follows:

  • Ru(t) = k(t)
  • where ∑ wi(t) = 1
  • and ∀i, 0 < wi(t) < 1
This formula indicates that the reserves of each asset (Ri) depend on the time-varying weights (wi(t)), and the pool's constant (k) also changes with time. Trades within a block must preserve or increase the value of k(t) at the time of the trade. The dynamic nature of TFMM pools allows them to adapt their positions, re-weighting assets based on market conditions and arbitrage opportunities.
AI Search Multiple angles on this topic

Simulator Defaults for Dynamic Pools

The quantammsim documentation sets a standard minimum pool weight of 3%. It also specifies a maximum weight change of 0.0003 per minute. The documentation says this rate corresponds to coverage for approximately five mainnet blocks, and points readers to a paper on multiblock MEV.

Limits of Observing MEV Strategies

The cited research notes that studying multiblock MEV is complicated by participants’ monetary incentives to conceal their strategies. Revealing a strategy could enable others to replicate it, according to the source. It also reports that bots have copied other MEV-exploiting transactions to profit without understanding the underlying strategies.

Protection Approaches Compared

The supplied comparison describes MEV-aware AMMs, including Uniswap V4 with Hooks and CowSwap, as using batching or custom pool logic to mitigate front-running and sandwich attacks. It contrasts these approaches with traditional AMMs by emphasizing protection for retail liquidity providers and preservation of farmer yields. A separate 2026 guide names private RPCs and intent solvers as tools for protecting DeFi trades, and specifically compares Flashbots Protect with Eden Network.

Multi-token trades are permitted in TFMMs, where traders can exchange a set of tokens (represented by vector A) for another set (represented by vector A). The pool requires that for tokens i where ∆i > 0, Ai = 0, meaning tokens cannot be traded for themselves. To ensure acceptance, trades must also account for fees (1 – γ), satisfying the condition:

Future Directions for AMM Security

This analysis marks an initial step in understanding and addressing potential multi-block MEV attacks on dynamic AMMs. As the DeFi landscape evolves, ongoing research and development of robust defense mechanisms are crucial to ensuring the safety and economic viability of these systems. Continuous improvements in mathematical models, analytical methods, and practical guardrails will be essential to mitigate risks and foster a secure environment for decentralized finance participants.

AI Search Multiple angles on this topic

Inter-Block Protections

The cited paper analyzes new protections intended to guard against the attack vector created by inter-block weight changes. This frames dynamic-AMM security as requiring attention beyond the familiar MEV patterns in constant-function market making. The source snippet does not specify which protections it analyzes, so their mechanisms and effectiveness cannot be stated from the supplied material.

Toward Protocol-Level Mitigation

The cited source characterizes MEV as evolving from a parasitic tax into a protocol-managed feature. It identifies encrypted mempools, fair ordering, and proposer-builder separation (PBS) as potential directions for DEX security. The snippet presents these as future-facing approaches, without reporting their measured effectiveness.

The study at a glance

Study designSimulation or modelling study[1]
Populationpotential attack scenarios[1]
Sample sizemore than 450 million[1]
Main outcomesuccessful attacks and successful defense[1]
Times cited0[1]

How dynamic-weight risk relates to other MEV work

The paper asks whether changing weights in LBPs, TFMMs, and RMMs create attack paths beyond those associated with constant-function market making. It treats changes between blocks as trade-like, potentially creating a multi-block opportunity.[1]

The paper says it analyzes inter-block protections, while the simulator documentation describes configuration choices that can make a potential attack uneconomical for a specified attack duration. The documentation does not establish a general real-world harm estimate or universal protection effectiveness.[1] [2]

What a follow-up would need to establish

  • Do the simulated attack and defense outcomes correspond to strategies or protections observed in deployed dynamic pools?[1]
  • How does the practical concern change when block builders are not centralized and trusted?[2]
  • For a given pool configuration and attack duration, when do restricted weight changes make an attack uneconomical?[2]

Terms used in the study

Dynamic weights
Weights that vary in pools such as LBPs, TFMMs, and RMMs.[1]
Inter-block weight changes
Changes in pool weights between blocks that can be analogous to trades.[1]

About this Article -

Written with AI assistance from published research, and reviewed by the Mystum team. See our About page for more information.

This article is based on research published under:

DOI-LINK: https://doi.org/10.48550/arXiv.2404.15489,

Title: Multiblock Mev Opportunities & Protections In Dynamic Amms

Subject: q-fin.tr

Authors: Matthew Willetts, Christian Harrington

Published: 23-04-2024

Everything You Need To Know

1

What are dynamic Automated Market Makers (AMMs) and how do they differ from Constant Function Market Makers (CFMMs)?

Dynamic AMMs, such as liquidity bootstrap pools (LBPs), Temporal-function market makers (TFMMs), and replicating market makers (RMMs), introduce complexities not found in Constant Function Market Makers (CFMMs). Unlike CFMMs, which use a fixed formula to determine asset prices, dynamic AMMs can adjust their parameters over time. For instance, Temporal-Function Market Making (TFMM) pools incorporate time-varying trading functions, allowing the pool's portfolio vector to change from block to block, responding to market information and arbitrage opportunities. This adaptability, however, also creates new vulnerabilities, particularly concerning Maximal Extractable Value (MEV) attacks.

2

What are Multiblock Maximal Extractable Value (MEV) attacks in the context of dynamic AMMs, and who do they target?

Multiblock Maximal Extractable Value (MEV) attacks in dynamic AMMs involve malicious actors exploiting blockchain mechanics across multiple blocks to extract profit at the expense of other users. In dynamic AMMs like Temporal-Function Market Making (TFMM) pools, attackers can manipulate pool weights over several blocks, similar to 'sandwich attacks'. However, unlike traditional sandwich attacks that target individual traders, these attacks are often aimed at liquidity providers (LPs). By understanding how attackers can manipulate pool weights, it becomes easier to implement guardrails to protect investments in dynamic AMMs.

3

How does Temporal-Function Market Making (TFMM) work, and what is the significance of the formula Ru(t) = k(t)?

Temporal-Function Market Making (TFMM) pools differ from traditional AMMs by incorporating time-varying trading functions. The formula Ru(t) = k(t), where ∑ wi(t) = 1 and ∀i, 0 < wi(t) < 1, signifies that the reserves of each asset (Ri) depend on the time-varying weights (wi(t)), and the pool's constant (k) also changes with time. This dynamic nature allows TFMM pools to adapt their positions by re-weighting assets based on market conditions and arbitrage opportunities. Trades within a block must preserve or increase the value of k(t) at the time of the trade. This adaptability introduces vulnerabilities that can be exploited, as portfolio vector changes can be exploited.

4

What conditions must multi-token trades satisfy in Temporal-Function Market Making (TFMM) pools to be accepted?

In Temporal-Function Market Making (TFMM) pools, multi-token trades, where traders exchange a set of tokens (vector A) for another set (vector A), must meet specific conditions to be accepted. The pool requires that for tokens i where ∆i > 0, Ai = 0, meaning tokens cannot be traded for themselves. Additionally, trades must account for fees (1 – γ), satisfying a condition that ensures the trade benefits the pool. This rigorous condition ensures the pool's integrity and prevents exploitative trades, though vulnerabilities related to Maximal Extractable Value (MEV) can still arise.

5

What future developments are necessary to enhance the security of dynamic AMMs and mitigate the risks of Multiblock Maximal Extractable Value (MEV) attacks?

To enhance the security of dynamic AMMs and mitigate the risks of Multiblock Maximal Extractable Value (MEV) attacks, ongoing research and development of robust defense mechanisms are essential. This includes continuous improvements in mathematical models, analytical methods, and practical guardrails. As the DeFi landscape evolves, addressing potential multiblock MEV attacks on dynamic AMMs like Temporal-Function Market Making (TFMM) pools requires continuous adaptation of defensive strategies. The goal is to foster a secure environment for decentralized finance participants.

Newsletter Subscribe

Subscribe to get the latest articles and insights directly in your inbox.