THE EQONEX CRYPTO GUIDE AND LEARN HUB
Eqonomics

Understanding the value and limitations of Automated Market Makers

May 9, 2022

Adam Wise

Understanding the value and limitations of Automated Market Makers

Volatile conditions negatively impact the bid/ask spread and willingness of liquidity providers to offer depth of market.

Liquidity is paramount for any market to function. Centralized trading venues offer liquidity through limit order books. Bid and ask prices evolve as a function of market conditions and as market orders take liquidity from the book.

We wrote about this concept in March. If you are unfamiliar with how centralized exchanges function, “what makes a market?” offers an introduction.

Why doesn't this work in DeFi?

For most blockchains, throughput is too low to host a properly functioning order book market. There is also a cost to the decentralized nature of the market – each transaction needs to be confirmed on the network. For Ethereum, this cost is significant, and transaction confirmation times can be long.

Additionally, markets are highly fragmented. While it is relatively simple to create a token, it is much harder to spin up an effective market-making strategy – should anyone even want to list an unknown token on a centralized exchange.

What does work in DeFi?

These issues led to the invention of Decentralized Exchanges (“DEX”), offering liquidity via Automated Market Maker (“AMM”) pools.

AMM pools offer 24/7 permission-less liquidity via smart contracts, so there is no need for intermediaries.

The most popular implementation of AMMs is a simple mathematic formula, Constant Product:

x * y = k

x: Number of Token 1 in the pool

y: Number of Token 2 in the pool

k: Constant Product

When a user is swapping tokens, they are depositing tokens into the pool to remove a market rate amount of the other token. The effective price for the swap is determined by the ratio of tokens in the pool.

Example

Let’s take some example figures from 23rd April 2022, using the Uniswap V2 liquidity pool of ETH/USDC:

ETH

x

46,450

USDC

y

137,560,000

Constant Product

k

6,389,662,000,000

The current price of ETH in USDC can be calculated as:

y / x

137,560,000 / 46,450 = USDC 2,961

What happens if a user swaps 1,000,000 USDC for ETH?

This is a simple swap: no liquidity is added and the constant product [k] remains unchanged

The user is adding 1,000,000 USDC and the constant product remains the same, so that you can calculate the amount of ETH removed. For simplicity, fees are ignored.

ETH

x

?

USDC

y

138,560,000

Constant Product

k

6,389,662,000,000

ETH received: 6,389,662,000,000 / 138,560,000 = 46,115

The swap is executed at an effective price of USDC 3,005. This represents a slippage of around 1.5%.

Liquidity pools do not rely on external sources to price tokens. The price remains roughly in line with centralized exchanges through arbitrageurs adding and removing tokens.

Who can provide liquidity?

Anyone can provide liquidity. To incentivize this service, DEXs offer a share of any swapping fees earned.

To earn these fees, Liquidity Providers (“LP”) deposit two tokens of equal value into an AMM pool. In return, they receive an LP token representing their share of the pool’s liquidity. This acts as a receipt to prove their ownership when they wish to withdraw tokens.

DEXs can further incentivize liquidity by providing additional payments to LP token holders – usually in the form of a governance token. 

What are the drawbacks?

The number of tokens deposited to the smart contract provides the depth of liquidity. If this is low, swapping tokens will cause high slippage – in the same way, thin liquidity does on centralized exchanges. 

Fees can be high for more ‘exotic’ tokens, up to 1% generally. 

There are also gas fees, which are $10-20 on Ethereum at the time of writing. For other chains, such as Solana, gas fees are negligible. 

Lastly, you are interacting with a smart contract, so the usual risks apply there.

For liquidity providers, AMMs can be lucrative but difficult to hedge due to impermanent loss. This is outside the scope of this article, but we can cover it in a future Eqonomics.

Summary

AMMs are an effective but not faultless solution to providing liquidity in DeFi.

They offer:

  • A permission-less approach to trading
  • Constant liquidity
  • Full transparency on depth of market and expected outcome
  • The opportunity for anyone to provide liquidity

Related Articles

Eqonomics: Understanding Quantile Analysis

Eqonomics: Understanding Quantile Analysis

May 20, 2022

Adam Wise

This week we will take the concept of correlation a step further and explore another technique for visualizing the relationship between assets: quantile analysis.

Keep up with crypto through EQONEX!


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The Correlations in Crypto

The Correlations in Crypto

May 13, 2022

Adam Wise

As markets behave badly, we can observe how crypto correlations have developed. In this Eqonomics, we explore the timing and magnitude of the correlation between BTC & ETH.

All You Need to Know About Futures Combinations

All You Need to Know About Futures Combinations

April 29, 2022

Adam Wise

Following the launch of our latest BTC dated future contract, in this week's Eqonomics we provide a quick overview of our range.

Decentralized Collateralized Stablecoins

Decentralized Collateralized Stablecoins

April 22, 2022

Adam Wise

Today, we take an example of how a collateral-backed stablecoin in DeFi can be issued by anyone and how the peg is maintained. We start with how they are issued, including context from traditional finance.

THE EQONEX CRYPTO GUIDE AND LEARN HUB

Bringing digital assets to the world.

EQONEX is a digital assets financial services company focused on delivering a full, digital asset ecosystem that offers innovative, trusted, and transparent products and services.

Keep up with crypto through EQONEX!


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

© 2022 EQONEX Capital Pte Ltd
All rights reserved.

IS 749075