DeFi’s Secret Weapon — Automated Market Makers (AMMs)

Cyber Strategy Institute
9 min readJun 16, 2021

Strategic Truths about Automated Market Makers (AMM) in Crypto

  • Order books of buy/sell orders No longer needed
  • Everyone can become a Market Maker & earn fees on trades
  • Algorithm(s) determine prices
  • Different models to automate prices
  • Variance between Liquidity asset pairs is guaranteed (aka Impermanent Loss (IL))
  • Variance between AMM platforms and assets is also guaranteed (aka Arbitrage opportunities)
  • No KYC
  • Fully Decentralized & User Driven
  • Anyone can launch a Token
  • User maintains 100% control of their asset

First and foremost, it is crucial to understand the concept of market making in the financial landscape.

As its name implies, market making connotes the process involved in defining the prices of assets and simultaneously providing liquidity to the market. In other words, a market maker does create liquidity for a financial asset. It must find a way of meeting the selling and buying requests of traders, which in turn plays into the pricing of the said asset.

The order matching system, on the other hand, matches and settles sell and buy orders. At any given time, the most recent price at which Ethereum was bought will automatically feature as the market price of the digital asset.

In some cases where there are not enough counterparties to trade with, the market is said to be illiquid or prone to slippage. Slippage occurs when the processing of large order volumes and low liquidity drives the prices of an asset up or down before an order can be filled. Causing a bid to be outside the range of its original submission and therefore not acquire the asset (e.g. Token).

As a user, you may have experienced this event first hand when your submission for an altcoin using Uniswap. This feature of market making has several risks and opportunities depending on how you look at them. A good review of those is highlighted in our Strategic Truths about the Ethereum Mempool.

To mitigate this occurrence, some crypto exchanges and even projects employ the services of professional market makers, such as traders in the form of brokers, banks, other institutional investors and even other Crypto DeFi projects to continuously provide liquidity. These liquidity providers ensure that there are always counterparties to trade with by providing bid-ask orders that would match the orders of traders. The process involved in providing liquidity is what we call market making, and those entities that deliver liquidity are market makers.

Now that you understand what market making is, it is easier to grasp the workings of an automated market maker.

What is an AMM?

Let’s start with what most of us on-ramp or enter the Crypto space to start trading Crypto. It was most likely through a centralized exchange (CEX) such as Coinbase, FTX, Binance, KuCoin or Kraken. On a CEX platform, buyers and sellers offer up different prices for an asset. When other users find a listed price to be acceptable, they execute a trade and that price becomes the asset’s market price. Stocks, gold, real estate, and most other assets rely on this traditional market structure for trading. However, AMMs have a different approach to trading assets.

An AMM is a type of decentralized exchange (DEX) protocol that relies on a mathematical formula to price assets. Instead of using an order book like a traditional exchange, assets are priced according to a pricing algorithm.

Thus, allowing for digital assets to be traded without permission and automatically by using a concept called liquidity pools instead of a traditional market of buyers and sellers. Liquidity pools are prefunded on-chain for both assets of the trading pair.

The liquidity is provided by other users who also earn passive income on their deposit through trading fees based on the percentage of the liquidity pool that they provide.

Traditional market making usually works with firms with vast resources and complex strategies. Market makers help you get a good price and tight bid-ask spread on an order book exchange. Automated market makers decentralize this process and let essentially anyone creates a market on a blockchain.

AMMs are a financial tool uniquely started on Ethereum and decentralized finance (DeFi). This new technology is decentralized, always available for trading, and does not rely on the traditional interaction between buyers and sellers. This new method of exchanging assets requires no one entity to control the system, and anyone can build new solutions and participate extremely rapidly.

Automated Market Maker Variations

There are many ways to trade tokens, since non-AMM exchanges were vital to keeping AMM prices accurate. There has been several developments or variations to the basic approach to AMMs.

This formula can vary with each protocol. To explain this further, let’s use Uniswap V2 as a case study.

“The protocol has used the popular x*y=k equation where X denotes the value of Asset A and Y represents that of Asset B. K is a constant value. Hence, regardless of changes in the value of assets A or B, their product must always be equal to a constant.”

Other AMMs will use other formulas for the specific use cases they target. The similarity between all of them, however, is that they determine the prices algorithmically. If this is a bit confusing right now, don’t worry; hopefully, it’ll all come together in the end.

Note that the Uniswap v2 equation highlighted as an example is just one of the existing formulas used to balance AMMs. Balancer uses a more complex formula that allows its protocol to bundle up to eight tokens in a single pool.

Like all technology, nothing stands still and AMMs are no different. There is a whole new generation of AMMs. Uniswap V3 again taking center stage in the market. Uniswap v3 focuses on harnessing liquidity within tight bands to drive capital efficiency. Others are providing bot defenses (against front running or sandwich attacks), others are leveraging arbitrage to reduce fees and some offer deep discounts or are even free based on not requiring Ethereum for gas (aka GWEI). We will do a follow-on article on the next generation of AMMs and other solutions to Ethereum’s current top challenges.

First lets baseline your understanding on the three dominant AMM models that have emerged: Uniswap v2, Curve, and Balancer.

· Uniswap v2: pioneering technology allows users to create a liquidity pool with any pair of ERC-20 tokens with a 50/50 ratio, and has become the most enduring AMM model on Ethereum.

· Curve: Specializes in creating liquidity pools of similar assets such as stable coins, and as a result, offers some of the lowest rates and most efficient trades in the industry while solving the problem of limited liquidity.

· Balancer: stretches the limits of Uniswap by allowing users to create dynamic liquidity pools of up to eight different assets in any ratio, thus expanding AMMs’ flexibility.

Walk Me Through How to use an AMM

First and foremost, you now know that AMMs use preset mathematical formulas to discover and maintain the prices of paired cryptocurrencies. An incredible feature is that AMMs allow anyone to provide liquidity for paired assets. Thus, allowing anyone to become a liquidity provider (LP) for that AMM instantly allowing for trading of that token.

While there are a variety of approaches to AMMs as exemplified by Uniswap and Balancer, the fact remains that they require liquidity to function properly and negate slippages. As such, these protocols incentivize liquidity providers by offering them a share of the commission generated by liquidity pools and governance tokens. In other words, you get to receive transaction fees when you provide capital for running liquidity pools.

Once you stake your funds, you will receive a receipt as a liquidity provider (LP) token(s) that denote your share of the liquidity deposited in the pool your funds were added. These LP tokens also make you eligible to receive transaction fees as passive income. You may deposit these tokens on other protocols that accept them for more yield farming opportunities, more on this in future articles. To withdraw your liquidity from the pool, you would have to turn in your LP tokens.

AMMs flipped the idea of a CEXs on their heads in 3 ways.

1) AMM makes it easy and user-friendly for anyone to provide liquidity for new ERC20 tokens paired with ETH or a stable-token like USDC, DAI, or USDT.

  • The days of waiting for a CEX to list a token are gone! As soon as teams launch a token, they can deposit the token into a new pool in Uniswap and traders can instantly begin buying and selling the token. This is what we mean when we say Uniswap, Pancakeswap and AMMs are special due to their permission less nature.

2) AMMs shift from a CEX collecting 100% of trading fees to a community-owned DEX.

  • Those providing liquidity earn all the fees! AMMs empower their users with the ability to provide liquidity for any token and start trading tokens instantly–those who provide liquidity earn a portion of fees paid by those trading.
  • In Uniswap, it’s been a simple flat 0.3% fee and so if I hold 1% of the liquidity in a pool like ETH — DAI, then I earn 1% of all fees paid by traders. Historically, the most volatile days in crypto, especially market crashes, have only benefited CEXs collecting record revenue on record trading volume.
  • With Uniswap, suddenly the AMM community that powers all liquidity provisions can earn record fees on record trading volume days. This is part of the reason behind the attraction to Uniswap and other AMMs.

3) AMMs provided DeFi users a parallel to legacy finance where you can maintain 100% control of your funds.

  • When you trade on a CEX, there’s always risk in depositing because you have to trust a CEX to not lose your funds. With AMMs like Uniswap, you trust no one but the code.
  • In the case of Uniswap, it’s battle-tested code with billions of trade volume over the years, and countless audits. There’s still risk to using Uniswap and other AMMs, but you escape the need for KYC or any sort of sign-up.

AMM Risks & Opportunities Summarized:

With these flexible features there is both risk and opportunities. I have highlighted the opportunities above, but we do need to highlight the risks as well. With anyone having the capability to release a token and add liquidity, many scammers have done this either before launches targeting legitimate projects or wearing sheep’s wool and eventually rugging everyone by pulling liquidity or dumping all their tokens at once or over time into the market driving price down 90% or more.

The other big risk people talk about is variance or IL when adding pairs to liquidity pools on AMMs or other DeFi platforms. This is the very essence of being a market maker, you are allowing for price discovery between 2-assets while earning fees. Some suggest that this can be bad especially if the price declines, as you will lose one asset and gain another. But felt this way in the beginning as well, as I bought into that narrative. I have since changed my mind, especially with all the liquidity mining opportunities. But if you are a LP for a pair of tokens let’s say BTC:ETH, LINK:ETH, or USDC:ETH you are really saying that you back both these assets. If you back both assets, are you really losing something through variance or are you really gaining a larger position in both as you earn fees and the prices fluctuate? Variance is a fact when becoming a market maker but with earning fees and farming opportunities by good projects your money will earn in a compounding way.

An opportunity you should know about with regard to AMMs is that they are ideal for arbitrageurs. For those that are unfamiliar with this term, arbitrageurs profit off inefficiencies in financial markets. Whenever there are disparities between the prices of pooled tokens and the exchange rate of external markets, arbitrageurs can sell or buy such tokens until the market inefficiency is eliminated or to marginal level where there is no longer value in driving efficiency any further (e.g. the work out ways the profit that could be made). They buy assets at a lower price on one exchange and sell them instantly on another platform offering slightly higher rates.

Strategic Truths about Automated Market Makers (AMM) in Crypto

  • Order books of buy/sell orders No longer needed
  • Everyone can become a Market Maker & earn fees on trades
  • Algorithm(s) determine prices
  • Different models to automate prices
  • Variance between Liquidity asset pairs is guaranteed (aka Impermanent Loss (IL))
  • Variance between AMM platforms and assets is also guaranteed (aka Arbitrage opportunities)
  • No KYC
  • Fully Decentralized & User Driven
  • Anyone can launch a Token
  • User maintains 100% control of their asset

It is important to realize that with decentralization through automated systems we gain tremendous flexibility. Such as not having to wait for another’s permission before doing something, maintaining control of our assets, and not relying on outdated models. There are some risks you need to be on the lookout for, but many more opportunities in the end.

As we have now looked at AMMs, Ethereum Gas and Mempool we can start to frame contextually the Strategic Truths about Ethereum. Now we need to evaluate further the features we have discovered, define the risks we face against the opportunities and link these to the most promising projects that are about to leverage this space. We have several in mind but am always interested to hear what you think we should evaluate. So ask away…

--

--

Cyber Strategy Institute

Bringing Clarity to Cyber Strategy! Future Security is through Blockchain & Crypto...