
AMMDeFi
The AMM security deep dive - Part 2: A deep dive into the top DEX platforms
October 2, 2025•
M3D

In our last post, Part 1, we broke down the simple but powerful
x * y = k formula that got the whole decentralized exchange (DEX) party started. But as elegant as that equation is, it was just the beginning. Today, we're diving deeper to see how the biggest names in DeFi have taken that core idea and run with it, building specialized platforms for unique financial needs—each with its own set of strengths, weaknesses, and, crucially, its own distinct security profile.Our goal is to look under the hood and understand the design choices that these platforms made to chase goals like better capital efficiency, lower slippage, and even automated portfolio management. As we explore, we'll also pinpoint where these innovations introduced new attack surfaces and, conversely, where they opened up exciting opportunities for developers to build more secure and sophisticated financial primitives.
The titans of a new financial world
The DEX landscape is really shaped by a handful of innovators. To see how things have progressed, there’s no better place to start than with Uniswap, the protocol that kicked everything off, before we look at its more specialized cousins. Each evolution brought not just new features but also new security considerations, a theme we'll revisit throughout.
The Uniswap saga: A four-part story of evolution
Uniswap V1: The original blueprint.
The first version of Uniswap was a thing of beauty in its simplicity. It proved the
x * y = k model worked, laying a foundational layer for decentralized trading. However, this elegance came with a significant limitation: every liquidity pool had to be paired with ETH. If you wanted to swap DAI for MKR, for example, you had to make two separate trades (DAI to ETH, then ETH to MKR), which meant paying double the fees and dealing with twice the slippage.From a security perspective, V1 was relatively straightforward. Its fixed structure limited certain types of complex exploits, but its fundamental simplicity also constrained its economic efficiency.
Uniswap V2: A major leap with new risks.
Released in 2020, V2 was a game-changer. It addressed the ETH-pairing problem by introducing direct ERC20-to-ERC20 pools. This update also gave us flash swaps and much more reliable on-chain price oracles. These oracles became essential infrastructure, allowing other DeFi projects to safely use Uniswap's price data.
While incredibly powerful, features like flash swaps introduced new security challenges, primarily through the potential for reentrancy attacks or complex arbitrage strategies that could drain pools if not carefully managed by integrating protocols. The oracle also became a critical dependency; its integrity was paramount. We will delve deeper into oracle security and flash loan exploits in upcoming protocol articles. The one drawback was that liquidity was still spread thinly across an infinite price range, from zero to infinity, which wasn't very efficient.
Uniswap V3: The capital efficiency revolution and magnified impermanent loss.
This version completely rewrote the playbook with a new concept: concentrated liquidity. Instead of providing liquidity across the entire price range, providers could now focus their capital within a specific range where most trading happens. This dramatically increased the potential to earn fees but also came with a higher risk of impermanent loss. If an asset’s price moved out of a provider’s selected range, their position would go inactive, potentially leading to major losses compared to just holding the assets. This effectively changed liquidity providers from passive participants into active managers.
The increased complexity of V3's liquidity provision (LP) strategy introduces a new layer of economic security considerations. LPs need sophisticated tools to manage their ranges, and incorrect or inactive ranges can lead to significant capital decay. For developers, this presented both a challenge and an opportunity: building sophisticated LP management strategies, automated range rebalancers, and impermanent loss mitigation tools became a new frontier. Our subsequent deep dives will explore advanced impermanent loss scenarios and best practices for LP range management.
Uniswap V4: The future is customizable—and potentially complex.
Looking ahead, V4 is all about customization through something called "hooks." Think of hooks as plug-ins that let developers run their own smart contracts at certain points during a trade. This opens up a world of possibilities for things like dynamic fees, on-chain limit orders, MEV capture mechanisms, or even pools that require compliance checks. V4 also brings in a "singleton" contract design and temporary "transient" storage, which will make it much cheaper and easier to deploy new trading pairs and execute complex swaps.
While offering unprecedented flexibility, V4's hook architecture significantly expands the attack surface. Each custom hook introduces potential vulnerabilities, from reentrancy risks in complex callback functions to economic exploits if dynamic fees or custom logic are not meticulously coded and audited. Developers gain immense power but also shoulder a greater responsibility for the security of their custom pool logic. This modularity, while powerful, demands rigorous security testing and a deep understanding of smart contract interactions. Future articles will focus on best practices for developing secure Uniswap V4 hooks and mitigating novel exploit vectors.
Curve Finance: The king of stable swaps and the "Curve Wars" security implications
While Uniswap V3 was busy solving capital efficiency for volatile coins, Curve Finance was cornering the market on trading similar assets, especially stablecoins like USDC and DAI.
Their secret sauce is the Stableswap invariant, a hybrid formula that creates a massive, flat area of liquidity right around the $1.00 peg. This allows for huge trades between stablecoins with almost zero slippage. The Curve ecosystem also became famous for its tokenomics, which sparked the "Curve Wars." In this fight, protocols like Convex Finance scooped up vast amounts of CRV tokens. By locking them up for veCRV, they could vote to direct liquidity incentives toward their own pools, making their stablecoins deeper, more resilient, and more integrated across DeFi.
From a security standpoint, Curve's unique invariant has proven remarkably robust for its intended purpose. However, the complexity of its tokenomics and the "Curve Wars" introduced new forms of economic manipulation and governance exploits. Controlling a significant portion of veCRV allows for powerful influence over the protocol's incentive layer, potentially leading to vote-buying schemes or directing emissions to less secure or even malicious pools. While not a direct smart contract vulnerability, these economic incentives create systemic risks that require careful monitoring. We'll explore the economic security of incentive layers and governance attacks in an upcoming series.
Balancer: The DEX as a portfolio manager with flexible vulnerabilities
Balancer took a completely different angle. Instead of just focusing on two-asset pools, they asked: what if a pool could be an entire portfolio?
With Balancer, you can create weighted pools with multiple assets, like one with 40% WETH, 40% WBTC, and 20% DAI. This pool automatically rebalances itself, essentially acting like a decentralized index fund. Balancer also pioneered Liquidity Bootstrapping Pools (LBPs), a popular method for new projects to launch tokens. LBPs are designed to start with a high price that slowly decreases, which helps deter bots and allows for more organic price discovery. The ability to set custom swap fees also gives pool creators a strategic flexibility that early versions of Uniswap lacked.
The flexibility of Balancer's weighted pools, while powerful, introduces a broader range of potential misconfigurations. Incorrectly set weights, poor asset choices, or manipulated custom swap fees could lead to significant impermanent loss or even direct exploits. LBPs, while innovative for token launches, must be carefully designed to prevent front-running or sandwich attacks during the initial price discovery phase. The multi-asset nature also increases the surface area for generalized arbitrage bots to exploit subtle price discrepancies across various tokens within a single pool. For developers, building tools to model optimal pool weights and fee structures, while considering arbitrage profitability and attack vectors, is a significant opportunity.
Beyond the giants: The specialized AMM landscape
While Uniswap, Curve, and Balancer dominate much of the narrative, the DeFi ecosystem is rich with innovative smaller AMMs, each pushing the boundaries with unique designs and, consequently, unique security profiles. These platforms often introduce novel mechanisms aimed at specific problems, creating both exciting opportunities and new risks.
Bancor: The Impermanent Loss Protector (A Cautionary Tale)
Bancor's ambitious goal was to completely solve impermanent loss (IL) for LPs through its Impermanent Loss Protection (ILP) feature, also allowing for single-sided liquidity provision using its native BNT token. The protocol promised to cover any IL incurred by LPs by paying them in newly minted BNT.
However, this became a critical case study in economic model failure, not a smart contract hack. During the 2022 market crash, massive IL across all pools forced the protocol to mint huge amounts of BNT. As LPs sold this newly minted BNT, its price crashed, which in turn caused even more IL, creating a "death spiral." The feature was eventually suspended. This highlighted a crucial trade-off: aggressive LP protection at the cost of long-term economic sustainability. For developers, this underscores the importance of stress-testing economic models against black swan events, not just smart contract vulnerabilities. Our future articles will delve into tokenomics security and the perils of inflationary protection mechanisms.
DODO: The Oracle-Informed Market Maker
DODO's Proactive Market Maker (PMM) uses external price oracles (like Chainlink) to dynamically concentrate liquidity around the current real-world market price. This concentration results in extremely high capital efficiency and very low slippage for traders, as liquidity isn't spread out over an infinite price range.
However, DODO's design introduces a fundamental trade-off: efficiency versus trustlessness. Its security is inherently dependent on the integrity and reliability of the external oracle. If the oracle is manipulated or provides stale data, the PMM's concentrated liquidity can be easily exploited, potentially leading to significant losses or even draining the pool.
Developers integrating or building on oracle-dependent AMMs must prioritize robust oracle selection, fallback mechanisms, and real-time monitoring. We will dedicate an entire section to oracle manipulation attacks and defensive strategies in an upcoming protocol article.
Maverick Protocol: The Automated Liquidity Manager
Maverick aims to simplify and automate the complex, gas-intensive process of managing concentrated liquidity positions (popularized by Uniswap V3). LPs choose one of four automated Liquidity Movement Modes (e.g., bullish, bearish, range-bound). The protocol's smart contract then automatically moves the LP's concentrated liquidity to follow the market price, maximizing fee capture without the LP needing to manually rebalance and pay gas fees.
This offers a compelling trade-off: automation versus granular control. While it dramatically simplifies high-efficiency liquidity provision for the average user, it introduces the security considerations of automated smart contract logic. Bugs in the automated rebalancing logic, or unexpected market conditions, could lead to sub-optimal performance or unintended asset exposures for LPs. Developers have an opportunity to build increasingly sophisticated and resilient automated strategies, but with the added burden of ensuring the security and predictability of autonomous agents. Our security series will feature specific examples of automated strategy exploits and auditing considerations for such protocols.
At a glance: how the top AMMs stack up and their security implications
| Feature | Uniswap (V3) | Uniswap (V4 - Proposed) | Curve Finance | Balancer | Bancor (ILP) | DODO (PMM) | Maverick |
|---|---|---|---|---|---|---|---|
| Bonding Curve | Concentrated x * y = k | Customizable via hooks | Stableswap invariant (hybrid) | Weighted, multi-asset invariant | x * y = k with ILP | Oracle-informed PMM | Dynamic, automated concentrated liquidity |
| Capital Efficiency | Very high (within a chosen range) | Potentially higher (dynamic) | Extremely high (for like-asset pairs) | High (acts as an index fund) | Moderate | Very high | Very high (automated) |
| Ideal Use Case | General purpose, volatile asset pairs | Highly customized/specialized pools | Stablecoin & like-asset swaps | Portfolio management, token launches | Single-sided liquidity, IL protection | High-efficiency trading, new asset launches | Automated LP for volatile assets |
| LP Complexity | High (requires active management) | Very high (requires development) | Low to medium (deep tokenomics) | Medium (pool configuration is key) | Low (single-sided) | Low (automated concentration) | Low (automated modes) |
| Key Security Risk | Concentrated IL, oracle manipulation | Hook-based exploits, reentrancy | Governance manipulation, economic incentive exploits | Multi-asset attack vectors, misconfigured weights, LBP front-running | Economic collapse of ILP, BNT inflation | Oracle manipulation, economic exploits | Bugs in automation logic, unexpected market behavior |
| Developer Opportunity | LP management tools, IL mitigation | Secure hook development, MEV capture | Advanced analytics for tokenomics, yield optimization | Pool optimizers, LBP design tools, arbitrage bots | Sustainable economic models for ILP | Robust oracle integration, anti-manipulation | Secure automated strategies, advanced performance analytics |
Conclusion
The road from Uniswap V1's simple formula to V4's programmable hooks—alongside specialized giants like Curve and Balancer, and innovative smaller players like Bancor, DODO, and Maverick—shows a clear move toward complexity and specialization. By introducing game-changing ideas like concentrated liquidity, hybrid curves, weighted pools, IL protection, oracle-informed AMMs, and automated LP management, these platforms have become incredibly efficient.
But this innovation doesn't come for free. The added layers of complexity, from actively managing ranges in Uniswap V3 to navigating Curve's intricate tokenomics, or trusting external oracles and automated strategies, also create new risks and a larger attack surface for both traders and liquidity providers. Each design choice, while solving one problem, inevitably opens the door to another. This is where the ongoing battle for DeFi security truly lies.
Get in touch
At Zealynx, we live and breathe the complex AMM designs and economic models described above. Whether you're building a new protocol, auditing an existing one, or just want to talk through the security of your AMM project, our team is here to help — reach out.
Want more articles like this? Subscribe to our newsletter so you don’t miss the next parts of this series.
FAQ: Key concepts in modern DeFi platforms - Part 2
1. What exactly is concentrated liquidity?
Concentrated liquidity, which Uniswap V3 made famous, lets liquidity providers (LPs) put their money to work in a specific price range instead of spreading it thin from zero to infinity. This makes their capital much more efficient at earning fees, but it means LPs have to actively manage their positions to make sure they stay in the active trading range.
2. What are Liquidity Bootstrapping Pools (LBPs) and what are their risks?
Liquidity Bootstrapping Pools (LBPs) are a type of pool pioneered by Balancer, used primarily for launching new tokens. LBPs start with a high token price that gradually decreases, helping to prevent bot sniping and encourage fair price discovery. However, they can still be vulnerable to front-running and sandwich attacks if not carefully configured.
3. What is Impermanent Loss in concentrated liquidity?
Impermanent Loss (IL) is the difference in value between holding assets in a liquidity pool versus just holding them in your wallet. In a concentrated liquidity position, this risk is magnified. If the price moves outside an LP’s narrow range, they get stuck holding only the asset that has dropped in value, and the loss can become very real and permanent if not managed well.
4. What were the "Curve Wars" all about?
The "Curve Wars" was a battle between different DeFi protocols to acquire and lock up as much of Curve's CRV governance token as they could. By doing this, they gained voting power to direct CRV reward emissions to their own liquidity pools. This attracted more liquidity to their stablecoins or other assets, making them more stable and widely used across the DeFi world.
5. What is oracle manipulation, and why is it a concern for AMMs?
Oracle manipulation is a type of exploit where an attacker influences the price data provided by an external oracle, causing smart contracts to make incorrect decisions. AMMs like DODO, which rely on external oracles for pricing, are particularly vulnerable. If an oracle is compromised or provides stale data, attackers can drain liquidity or execute unfair trades.
6. What are Uniswap V4 "hooks"?
Hooks are the headline feature of the proposed Uniswap V4. They are external smart contracts that let developers run custom code at key moments in a swap's lifecycle. This could be used to create features like fees that change with volatility, true on-chain limit orders, or even built-in KYC checks for a liquidity pool.

