Automated market makers, liquidity pools and LP tokens 101
In this article the iYield team is bringing you a generalized look at traditional market makers, automated market makers, liquidity pools and LP tokens as we believe it is important for our users to be able to inform themselves on these topics to understand how DeFi brings unprecedented financial freedom to the individual user and how it differs from the centralized solutions both in traditional finance and crypto.
First, let’s have a look at conventional market makers from the world of traditional finance— who they are and what they do.
A market maker which can also be called a liquidity provider is an individual or a firm that actively quotes simultaneously a bid price and an ask price in (for example) a commodity trading pair - in essence, this individual or a firm is placing orders on both sides of the order book with the goal to profit on the spread.
But what exactly is a spread?
In traditionally structured order books, such as that of a stock exchange or a centralized cryptocurrency exchange, the difference between bid and ask prices is called the spread. Spread is a key indicator of the liquidity of a given asset. Assets with poor liquidity will have a big spread and vice versa. In other words, you could also define spread by looking at an order book of any trading pair, taking the lowest price sellers are willing to sell at and subtract from that price the highest price buyers are willing to buy at — after the subtraction, the number you are left with is the spread.
So what is an automated market maker in DeFi, where the traditionally structured order book has been completely omitted? Let’s have a look!
Automated market makers (AMM)
AMM is a type of decentralized exchange.
In the example above with conventional market makers, there is a need for a direct counter-party to be able to execute a trade, no matter the liquidity and market price of an asset — if you are selling, another individual or a firm is buying. This is not the case for AMM. Instead, you interact with a smart contract which is tapped into a liquidity pool — more on liquidity pools below.
An AMM works similarly to a centralized exchange in that there are still trading pairs, for example ETH/USDC. However, as stated above, the trade is executed based on an interaction with a smart contract deployed on the Ethereum network. In the case of the ETH/USDC example, you would send a selected amount of funds, let’s say USDC, to this contract, and the contract dictates how much of ETH you get back in return. The contract dictates how much exactly are you getting and it does this autonomously based on a mathematic formula. For the sake of simplicity, we should focus on the “constant product” formula which is the formula Uniswap uses.
x * y = k
x is the supply of the first token in the trading pair
y is the supply of the second token in the trading pair
k is called product or constant product
It is important to note that the “supply” of x and y refers to the supply of tokens in that respective liquidity pool of that associated trading pair, not the total or circulating supply of the token.
After each trade, Uniswap adjusts the price based on how much the trade size shifts the x:y ratio where k stays constant. This x:y ratio will always dictate the exchange rate, i.e. the price between the two assets in a given trading pair. This formula ensures that big trades (relative to the liquidity pool’s reserves) execute at exponentially worse rates than smaller ones.
Uniswap relies on external arbitrage to keep the price of the Uniswap trading pairs in-check with the rest of the market.
Centralized exchanges rely on market makers to provide sufficient liquidity — that much we have established. So how do AMMs execute trades? In other words, what or who “makes” the market for an AMM-based decentralized exchange? The same way centralized exchanges rely on market makers for liquidity, AMMs rely on liquidity pools for liquidity.
For ease of understanding, you could visualize a liquidity pool as an actual swimming pool that people as a collective pour their money into instead of water. People who pour their money into this pool are called liquidity providers.
But what incentive do they have to pour their money into this pool? For each trade that happens using that pool as liquidity to execute the trade, a percentage-based fee is charged to the person interacting with the AMM smart contract. This fee is then distributed to all liquidity providers proportionally based on how much liquidity they are overall providing compared to the size of the rest of the pool.
A practical, simplified example:
Yield Bank’s ecosystem will have a wide variety of highly liquid pools where our yCASH pools will be supporting our yB pools, overall stabilizing our ecosystem with Yield Bank’s liquidity pools seamlessly looped into each other, providing stable yields to our users for many years to come.
When you put your money into a liquidity pool thus becoming a liquidity provider, you are in return given LP tokens. You could think of this LP token as a sort of IOU coupon that you can at any time exchange back for the money you put into the liquidity pool. In essence, the amount of LP tokens you were given represents the value of the money you put into the pool.
Uniswap LP tokens
So now we know that when you put your money into this pool, you are earning a fee on every trade that is executed through this pool’s liquidity (of which you own a part).
Wait a minute. I put my money into this pool in exchange for passive income, and now it’s gone forever? Well, it depends.
Uniswap LP tokens are minted when a user joins the pool and burned to withdraw from the pool. The rate at which they are minted and burned is such that you will always be able to withdraw your proportional contribution and your proportional share of each fee since you joined.
Yield Bank LP tokens
Yield Bank’s model, based on CORE’s base functions, is such that you cannot exchange your LP tokens back for the money you put in i.e. the liquidity you provided.
Once you put your money into a pool, that money is locked there forever. The LP token you have received when you initially put your money into the pool is now used to represent the value of the money you put into the pool as well as the passive income potential the LP token has. In essence, the LP represents the monetary value of the liquidity you provided and you use and trade the LP tokens instead.
Trading LP tokens
This is where Yield Bank comes in. We will create a market for LP tokens on our platform. A much more varied, accessible and liquid market for LP tokens than ever available before in DeFi backed by our liquidity pools, the sheer size of our platform and its volume. By locking the liquidity in our pools forever, we are creating a positive feedback loop of ever-increasing liquidity — liquidity can only increase with time and never decrease.
This will, in conjunction with the elaborate deflationary mechanics both of our tokens have, create a positive feedback loop of always increasing the liquidity in our pools, therefore rising prices of our tokens, therefore increased interest in our platform which in turn results in new users buying our tokens to enter our ecosystem (and pushing the price upwards) and putting that money into our pools once again increasing liquidity — thus the said positive feedback loop is achieved. Our ecosystem is bound to establish itself within the top ranks of DeFi and this is just one of many reasons why it will do so.
Follow us on any of our social media accounts listed below to stay updated. Liquidity Episode date will be announced in the coming weeks.
The article and any other associated content of Yield Bank does not constitute as financial advice. Cryptocurrencies are a high risk investment and may not be suitable for all members of the public and all types of investors. This is an experiment in DeFi yield aggregating to bring longer and steadier yields to its users.
Next article coming up: yB and yCASH tokenomics