Please enable JavaScript.
Coggle requires JavaScript to display documents.
Liquidity Pools - Coggle Diagram
Liquidity Pools
What are they?
So what is it?
- These are smart contracts that allow traders to buy/sell tokens & coins even if there are no buyers/sellers out there
- It's a pool of money that contains both assets of what you're wanting to trade for
Problem
- Let's take the traditional stock market as an example
- It uses an order book model. All buyers/sellers right down and submit their orders
- When 2 buyer and seller meet at the price, a sale is made
- However, it takes a long time for the buyer to get the price at which the market (or seller) is ready to sell the respective stock and similarly, it takes a long time for the seller to sell his stock to the market (the buyer)
- The best bid & the best ask lines will meet at a point after some time. This is when the sale happens
Solution
- A liquidity pool that uses an algoritm
- With this algorithm, we will ALWAYS be able to buy or sell an asset,
a) no matter how high or low the price is
b) no matter what time of the day it is
c) no matter if there is a buyer or seller that meets our current needs
How does it work?
- The pool starts off with an EXACT ratio of 50-50. E.g. If you wanted to give the pool $500 so they can trade, you must give it $250 of AVAX and $250 gOHM.
- Then it employs the constant product automated market maker function (check the section on the left)
- As you buy more and more gOHM by giving it AVAX, it will slowly raise the price of gOHM
- NOTE: Every transaction has a tax which is a small % of every trade. E.g. Uniswap
Automated Market Maker
What is it?
- Allows traders to buy/sell coins using an algorithm that dictate how expensive something should be based on how much of it there is
- As someone buys one asset, it becomes more and more expensive as it's less of it
- Conversely, as someone sells one asset, it becomes more and more cheaper as there's more of it
- Basically, it is SUPPLY & DEMAND but using an algorithm instead of a traditional method that uses a person
The Apple-Potato Example
The CONSTANT PRODUCT
- 50K apples & 50K potatoes
- A store which keeps a perfect ratio of the value of both of the commodities
- Both of these numbers should be equal to 2.5 billion (50K * 50K)
- This formula is called the "The Constant Product" automated market maker
-> X * Y = K
Where X & Y are the quantities and K is the constant that always stays the same
- In this case K is $2.5 Bn
- Right now, there's a perfect 50:50 ratio that's because we've priced each potato and apple at $1. After we start trading, one of these become more valuable and thus it needs to be priced more than a dollar
Say a potato trader gave 7K potatoes, how much each asset cost in dollars?
- 43589 apples = $1.14 / apple
- 57K potatoes = 87.7 pennies / potatoes
- This is basic Supply and Demand
Say a potato farmer wants to trade by giving another 10K potatoes to the pool. Now how much each asset cost in dollars?
- Total no. of potatoes = 67K
- Total no. of apples = 43589
Formula => X * Y = K => Y => K / X => 2,500,000,000 / 67000 => Y = 37313 apples should be present in the store now
- but we have 43589 apples currently. So the difference needs to be given to the potato farmer => 6276 apples the farmer gets for 10K potatoes
Now the price change
- Since there's an increase in demand for apples, there will be a price change
- 37313 apples = $1.34/apple
- 67K potatoes = 0.74/potato
Bottomline
- A real liquidity pool can have millions of worth of assets in it
- More money in a liquidity pool, the stabler the price is
- If there's half a million of apples, and half a million potatoes and you still want to trade only 2K potatoes, the price difference wouldn't as much
- Liquidity pools reward investors. People who put in the money get a small fraction of each trade in their platform
Risks
Permanent Loss
- Will only happen to people who provide liquidity to a liquidity pool
Context: You put 100 ETH & $10000 in a liquidity pool. Let's assume 1 ETH = $100. So there's $10K ETH and $10K stable coin in a liquidity pool
Scenario - 1
- Let's say the price of the ETH raises to $110
- A trader keeps buying ETH from your pool at $100 and sells them to coinbase at $110 until he keeps stop making money
- This is a typical "arbitrage opportunity" for a trader
- Now what if the trader had just held the stable coin and ETH instead of investing in the pool. Would he have made more money? If yes, then it's a classic impermanent loss situation
- Impermanent loss is caused when the difference between the two assets in the pool has changed. Has this change increases, so does the loss
- We call it impermanent loss because the loss is permanent only when you cash out the token
Scenario 2
- ETH price drops from $100 to $60 in Binance
- Now you buy ETH from Binance and sells it to our liquidity pool
- Our liquidity pool keeps buying it over and over until the price reaches $60
Tips
- It's good for any LP when two assets that you're investing in stay roughly the same price up
- When one goes up and the other stays the same, the LP experiences IL and can only recover from the loss if the 1st asset comes down to the previous state
- When both assets prices start moving, the LP starts to lose money quickly if they go in opposite directions
- Or if the prices increase/decrease at the same rate, no IL. You can start reaping rewards
-
-
-
-
Providers
- Uniswap
- Pancake swap (Binance smart chain)
- Quick swap (Matic tokens)