Coming soon: The only portfolio tracker you’ll ever need. Find out more

Liquidity Pools

Diving into DeFi: A Beginner’s Guide to Liquidity Pools

Learn how liquidity pools work under the surface and how they impact the decentralized finance ecosystem.

The decentralized finance (DeFi) movement envisions a world where borrowing, trading, and other transactions occur without a centralized intermediary. At its heart, DeFi protocols rely on smart contracts and liquidity pools – or communal pots of tokens – to facilitate transactions without matching individual buyers and sellers.

In this article, you’ll learn how liquidity pools work under the surface and how that impacts the DeFi ecosystem, including investors, borrowers, and other participants.

Why Liquidity Matters

Liquidity refers to the ease with which someone can convert an asset into cash without affecting its market price. You can quickly sell highly liquid assets without causing a significant price change, an essential characteristic of any financial market. Financial markets become inefficient and less useful for participants without ample liquidity.

In conventional financial markets, centralized intermediaries provide liquidity. For example, banks will lend you money without matching dollar-for-dollar with depositors. And stock exchanges use specialists and market maker incentives to encourage trading and liquidity. In exchange, they extract fees for these services.

DeFi protocols enable liquidity providers (LPs) to deposit assets into liquidity pools. Rather than using a centralized intermediary, liquidity pools use smart contracts to dynamically incentivize LPs, ensuring there’s always a counterparty willing to take a trade (at some cost) and sufficient liquidity in the market for traders and investors.

How Liquidity Pools Work

Liquidity pools are at the heart of the decentralized finance ecosystem.

Liquidity pools enable anyone to contribute tokens and become a liquidity provider. By doing so, they can receive fees collected from borrowers or traders that dip into the pool. Generally, the income they generate depends on their contribution to the pool. Those contributing more receive a larger share of the rewards.

There are many reasons someone might need a liquidity pool:

  • Traders – Suppose you want to exchange one token for another. Instead of waiting for someone who wants to make the exact opposite trade, you can swap your tokens from the liquidity pool.
  • Borrowers – Suppose you want to borrow a token. Rather than soliciting bids from multiple lenders, you can borrow tokens from the liquidity pool that sets a fair rate based on supply and demand.

Consider a liquidity pool that accepts two tokens: Token A and Token B. You want to swap 10 Token A for some Token B. The pool uses a formula to determine how much Token B you get. And once the trade is done, the pool has more of Token A and less of Token B. The price of the tokens adjusts depending on real-time supply and demand.

Approaches & Challenges

Liquidity pools come in many shapes and sizes. Different platforms and protocols have unique models for managing liquidity pools while providing liquidity for various markets and assets. At the same time, investors have their own incentives for interacting with liquidity pools – often seeking higher yields across different markets.

Common Approaches

Constant product models, like Uniswap’s, are the most common approach to building liquidity pools. To understand how they work, picture a see-saw in a playground. No matter how much the two sides go up and down, the product of the weights on both sides stays constant. Similarly, Uniswap and other protocols use the product of two tokens to set the price.

6467a0a2c31fdec35e6dc4ef uniswap
Example of a Uniswap transaction. Source: Uniswap

In this example from Uniswap, the price of Token A increases from 1,200 to 1,203.03, which decreases the value of Token B to 399 to preserve the constant of 3. After the transaction, the liquidity shares are worth 3.015 after adding transaction fees.

While constant products work for exchanging tokens, stablecoin models facilitate borrowing and lending activities. Many liquidity pools focus on matching stablecoin borrowers and lenders at optimal interest rates, enabling investors to earn yield and borrowers to access capital or leverage without resorting to fiat currencies.

Investor Incentives

Liquidity pools operate in a highly competitive environment where competitors constantly chase higher yields. According to Nansen, more than 40% of yield farmers providing liquidity to a pool on launch day exit within 24 hours. And by the third day, nearly three-quarters of initial investors are gone chasing other yields.

Unfortunately, this “mercenary capital” undermines DeFi protocols’ sustainability for the entire ecosystem. While some protocols have attempted to implement protocol-owned liquidity or other techniques, the transactional nature of liquidity and the race to higher yields continue to be challenging for the DeFi space.

Risks & Rewards for LPs

Liquidity pools enable traders and investors to generate income from their crypto assets. In fact, the incentive structures of liquidity pools have given rise to an entire crypto investment strategy known as yield farming, where investors move assets across different protocols to generate as much yield as possible over time.

Some protocols even automate the yield farming process. For instance, Yearn Finance offers a yield farming and aggregation tool with a development team that’s always working on new strategies to earn users higher yields. The platform has more than 30 Curve pools where investors can deposit five different cryptocurrencies into smart contracts.

Despite the potential for returns, liquidity pools aren’t risk-free investments. They are prone to impermanent loss, where the price of tokens in a liquidity pool differs from the price outside. This can lead to situations where, despite earning fees, you might have been better off just holding the tokens in the open market.

There’s also a risk that the smart contracts underlying DeFi protocols could be hacked, exposing funds locked in the protocol. For example, ChainSec’s logs show a total of nearly 150 DeFi exploits amounting to more than $4 billion in lost funds. And in many cases, these funds are either non-recoverable or only partially recoverable.

The Bottom Line

Liquidity pools are at the heart of the decentralized finance (DeFi) ecosystem. In addition to making markets without a centralized intermediary, these platforms offer investors a hard-to-find yield on their crypto assets. As a result, they’ve become prevalent among both individual and institutional traders and investors.

If you trade crypto assets, ZenLedger can help you organize everything for tax time. The platform automatically aggregates transactions across wallets and exchanges, computes your overall capital gain or loss, and generates the tax forms you need to file each year.

Get started for free today!

Justin Kuepper