Most users in the decentralized finance (DeFi) space are more than familiar with using Uniswap (UNI) to trade their favorite ERC-20 tokens. Despite this, many remain unfamiliar with the magic behind Uniswap liquidity pools (LPs) and how they are fundamental to ensuring a smooth operating experience when trading on a decentralized exchange (DEX) such as the Uniswap protocol.
The Basics of Liquidity Pool Tokens
Every asset available for trade on Uniswap is backed by its respective ERC-20 token pairing. These tradeable assets contribute to liquidity pools in exchange for what are known as liquidity pool tokens (LPTs)
By providing liquidity pairs using Ethereum (ETH) and another ERC-20 token, liquidity providers can exchange their held assets for liquidity pool tokens in return for a percentage of the trading fees accrued as trades are executed using the provided liquidity. When a new pool contract is created, it must first provide an equal amount of each side of the trade – the total value of the token listed must be matched with an equal amount of ETH.
The Fundamentals of Liquidity Pools
Liquidity providers create new pools by depositing a pair of ERC-20 tokens. The first liquidity provider is the one who sets the initial price parameters of the pool, and they are incentivized to deposit an equal value of both tokens. For example, consider a case where the first liquidity provider deposits tokens at a different ratio from the current market rate. This creates a profitable opportunity for arbitrage that would more than likely be taken advantage of by an external party.
Thus, liquidity providers must deposit token pairs in proportion to the current price when adding liquidity to an existing pool. Neglecting this may cause their added liquidity to become at risk of being arbitraged, due to the price differential between the liquidity and market.
Liquidity Pool Tokenomics
Earlier in the article, we briefly touched on liquidity pool tokens (LPT). Expanding on the concept of LPTs, it is important to understand their use-case and function within various LP ecosystems. Laid out below are the tokenomics of LPTs:
- Liquidity pool tokens are minted to the address of the provider proportionate to how much liquidity was contributed to the LP. These tokens represent a liquidity provider’s contribution to the pool.
- Whenever a trade occurs, a 0.3% fee is levied and distributed to all liquidity providers.
- To retrieve their underlying assets, liquidity providers must burn their respective LPTs. This is essentially a reversal of the initial minting process.
It is worth noting that liquidity providers can also choose to sell or transfer their LPTs in any way they would like.
Why Liquidity Pools?
LPs make Uniswap unique in that an order book is not required to derive the price of an asset trading on the ETH blockchain. Instead of matching buyers with sellers to fulfill orders, UNI solves this dilemma by using LPs. In typical markets, liquidity is provided by individuals placing orders to buy or sell on a centrally operating order book, and participants looking to provide liquidity are known as market makers. Unlike UNI’s decentralized protocol for automated liquidity provision, traditional market makers must actively monitor their orders and update them continuously in response to fluctuations in the marketplace.
Liquidity Pools Just Work
Order books were invented for a financial world with far fewer assets in mind, and unsurprisingly, this is not the ideal supporting infrastructure for an ecosystem like the ETH network where anybody can create their own token – many of which often have very low liquidity. Infrastructural trade-offs presented by the ETH platform make a strong case against using order books for the native architecture when implementing liquidity protocols on the blockchain.
While order books are foundational to traditional trading markets, they suffer from many limitations. This especially becomes apparent when scaled to a DeFi or blockchain-natured infrastructure. Due to the intermediary infrastructure required by order books to match buy and sell orders, centralized points of control add another layer of increased complexity.
It is important to understand that an LP is just a user-operated smart contract for calling various options, and by interacting with the UNI protocol through the user-interface (UI), market participants can execute buy and sell orders seamlessly without the use of an order book through utilizing LPs.