AMMs are the algorithmic pillars that supportSupport A price level where buying pressure is expected to be strong enough to prevent further price declines. the infrastructure of decentralized exchanges (DEXs) in the decentralized finance (DeFiDeFi DeFi services use smart contracts, decentralized protocols, and tokens to offer a range of financial services that can sometimes replace those offered by banks, such as lending/borrowing, asset management, insurance, or asset exchange.) universe.
These automated mechanisms revolutionize how assets are traded online by providing an innovative alternative to traditional order bookOrder Book A book displaying buy (bids) and sell (asks) orders on a market. models, eliminating the need for centralized actors to facilitate trades.
In traditional finance, marketplaces are managed by private entities, such as the New York Stock Exchange (NYSE). The NYSE allows participants to trade on the secondary marketMarket A place where assets are bought and sold. during defined trading hours. LiquidityLiquidity The ease with which an asset can be bought or sold without affecting its price. is provided by supply and demand, along with the work of market specialists (Designated Market Makers) and floor brokers.
What is an AMMAMM An algorithm used in decentralized trading platforms (DEX) to provide liquidity using pools. Liquidity providers deposit into these pools and receive a share of the fees generated by transactions. The algorithm determines the asset price based on supply and demand in the pool.?
An AMM is a protocol that enables the automatic and decentralized exchange of digital assets. AMMs use mathematical algorithms and predefined liquidity pools to facilitate trades.
Since the market is governed by autonomous algorithms and intermittent liquidity provision, there are no specific trading hours, and trading can occur at any time. Without a centralized authority to approve or disapprove trades or liquidity provision, anyone can interact with the platform.
This also means that no professionals are required to ensure the proper guarantee and liquidity of pairs, so trading without checking the following two points can be risky:
- Verify Tokens: Fraudulent tokenToken A digital asset issued on a blockchain, representing various utilities, rights, or value. creators may produce fake tokens with similar names to deceive buyers. It’s essential to check the token’s contract addressAddress A unique string of characters that identifies an entity or account on a blockchain network, allowing the sending and receiving of cryptocurrencies. (official link from the project’s site or Twitter, and verify consistency with displayed liquidity and market capMarket Cap The total value of a cryptocurrency, calculated by multiplying its price by its circulating supply.).
- Liquidity Concerns: For lesser-known tokens, liquidity might be low (low volume, less attractive for liquidity providers), and buying or selling a significant amount could result in substantial slippageSlippage The difference between the expected price of a trade and the actual price at which it is executed, often occurring during periods of high volatility or low liquidity. (the actual trading price may differ from the indicated price due to inadequate counterparty supply at the desired price).
Liquidity Pools
Liquidity pools are central to AMMs. They consist of pairs of assets deposited by users, known as liquidity providers (LPs). In exchange for their deposits, LPs earn transaction fees generated from the trades occurring in the pool.
For a detailed understanding of liquidity provision, see articles on stakingStaking The act of participating in a Proof of Stake network by locking up tokens as collateral to validate transactions and secure the network. and lendingLending The act of lending cryptocurrency for interest. and impermanent loss.
Algorithmic Models
Several algorithmic models are used by AMMs, with the most popular being the Constant Product Market MakerMaker An entity that provides liquidity to a market by placing limit orders. (CPMM) model, based on the formula: x⋅y=kx \cdot y = kx⋅y=k where xxx and yyy are the quantities of the two assets in the pool, and kkk is a constant.
Other algorithmic models include:
- Constant Sum Market Maker (CSMM)
- Constant Mean Market Maker (CMMM), used by Balancer
- Advanced Hybrid Constant Function Market Maker (CFMM), used by PancakeSwap
- Dynamic Automated Market Maker (DAMM)
Notable AMMs include Uniswap, PancakeSwap, Osmosis, and CurveDAO.
Advantages and Challenges
AMMs offer permanent liquidity, facilitate market access and participation, and reduce transaction costs and delays. However, they also present challenges such as impermanent loss, where liquidity providers may see the value of their deposited assets decrease due to price fluctuations.
To address this issue, some DEXs have had to reinvent themselves. For instance, Uniswap, Ethereum’s leading DEXDEX A decentralized exchange platform without a central authority, often using AMMs to enable trades., introduced a new version:
- Uniswap V3: LPs can concentrate their liquidity within specific price ranges, unlike previous versions where liquidity was distributed across the entire price curve. This allows LPs to provide liquidity only in the price ranges where they expect most trades to occur, thereby increasing capital efficiency.
Example: Suppose an LP wants to provide liquidity for an ETH/DAI pair. Instead of spreading their capital across the entire price curve, they can concentrate it between 1,000 and 2,000 DAI per ETH, thereby maximizing returns if most trades happen within this rangeRange The difference between the highest and lowest prices of an asset within a specific period.. - Flexible Fees: Uniswap V3 introduces flexible fees, allowing LPs to choose from three different fee tiers to compensate for the risks associated with each trading pair. This enables LPs to tailor their strategies according to the expected volatilityVolatility The degree of variation in an asset's price over time. of the trading pair.
- Enhanced Oracles: Uniswap V3’s oracles are optimized to calculate the time-weighted average price (TWAP) more efficiently and over longer periods, facilitating integration and use by other DeFi protocols.
- Non-Fungible Liquidity: In Uniswap V3, liquidity positions are represented by non-fungible tokens (NFTs), reflecting the unique nature of each liquidity position due to the ability to specify price ranges.
Conclusion
AMMs represent a major technological advancement in DeFi by automating and democratizing access to digital assetAsset Any digital asset, including cryptocurrencies. exchanges. By understanding the mechanisms and algorithms behind them, users and investors can take advantage of several opportunities:
- Buy or sell tokens without waiting for them to be listed on a centralized exchange, and without needing the exchange’s approval. Bots (such as Unibot, Maestro) are even available for investing at new pair listings.
- Implement farming strategies and grow the cryptocurrencies held.