In the first series of “Shortcut to DeFi”, I introduced the basic usage of a DEX – swap – and in this episode, I will try to explain the concept behind it as layman-friendly as possible.
Imagine in real life that you have an apple, and you would like to swap it for a peach. First off, you will need to find someone who has a peach. The deal couldn’t be complete without the eligible party. As an ordinary person, you might not have the resources to find the person that has the item you wanted to exchange for. So here comes the DEX. In this story, DEX is the middleman that helps with fruit dealing by charging a low percentage of trading fees of the total amount you swap.
However, DEX has an issue to solve – it needs to find a large number of stocks in order to run the exchange business. Therefore, DEX is paying incentives to depositors who deposit their fruits in the DEX storage. Things go a little bit differently here: instead of depositing a single type of fruit, you are required to deposit fruits in a pair, for instance, apple/peach, peach/orange, etc. Each pair of fruits form its own “pool”, and this is the so-called “liquidity pool” (LP) in DeFi term.
Let us switch the story to another side: Mike, the fruit farmer. On Mike’s farm, there are different types of fruit, apple, orange, peach, banana, grape, you name it. Mike has no intention to sell these fruits for now, but it is not ideal with them sitting on his farm idly, Mike has to work out something. After doing some research, he manages to find DEX as he can withdraw his fruits anytime he wants. In the meanwhile, he is earning yields by providing liquidity pools. DEX is the best platform in Mike’s current situation. He is now officially a liquidity pool provider (LP provider). Above is the story about DEX, LP, and LP provider.
The term “pooling” in crypto is different from traditional finance, as the latter only requires depositors to deposit a single asset. The idea of pooling is to add liquidity to tokens, the more liquidity the easier a token could be converted into fiat or other tokens. Liquidity plays an important role and it is one of the foundation innovations behind the whole DeFi ecosystem. P/S: Depositing a single asset in the crypto world is called “staking” instead of “saving”.
LP providers are able to earn trading fees as well as farming yields. The largest DEX by trading volume, Uniswap, is no longer offering yields but only trading fees to LP providers whereby most DEXes offer a percentage of yields to attract providers to deposit funds in their platform. Smaller DEXes even offer higher yields in order to compete with the big players.
After creating a liquidity pool, the LP provider will receive an LP token in the form of an NFT. DO NOT list or transfer this NFT on OpenSea or any other NFT marketplace as whoever owns the NFT owns full access to the liquidity pool. So be careful with it. With the LP token, the LP provider can proceed to stake it to generate more yields or even use it as collateral to borrow more funds. These borrowed funds can then use to create another pool, receive another LP token and borrow even more funds. Rinse and repeat until no funds can be borrowed anymore. This leverage thingy is the culprit that destroyed the crypto hedge fund 3AC as well as crypto lender Celsius. Both of them are the largest players in their respective fields.
All in all, DeFi is not as simple as you think it is. The whole idea is relatively new – less than 10 years in history – almost like an infant in comparison to the modern banking system that had been created hundreds of years ago. The technology is still considered immature at the current stage and a lot of inexperienced developers often had loopholes in the smart contract they coded. That’s the main reason why you can always see this DeFi protocol and that DeFi bridge were hacked and exploited. Indeed, small DeFi platforms offer attractive yields but also come with very high risk, you can never know how and when they become the target of hackers. It is better safe than sorry to deposit funds in top DeXes than then newer ones. At least when anything worse happens, users are much more likely to get a reimbursement.
I believe you have the whole concept of pooling right now. The point of this article isn’t to encourage you to start pooling but to learn about how DeFi works so that you can measure the risk before starting. The next thing I am going to write about is very crucial to liquidity pools, and that’s the automated market maker (AMM). Stay tuned!
Case study:
1. User “3978F6” wants to add a liquidity pool of USDC/WETH.
2. 3978F6 opts to receive a 0.05% trading fee by providing the liquidity pool.
3. The LP will only be effective to trade in between the price range of $1396.9/WETH to $1571.9/WETH.
4. 3978F6 wants to deposit 71.78 WETH, and he is required to deposit another pair of tokens in equivalent value. In this case, it’s $173,320 worth of USDC. The amount of USDC required may vary if the effective price range was adjusted in step 3.
5. After the LP is created, an LP token is then generated in the form of an NFT (ERC-721). Whoever holds this NFT will get access to this LP that is worth a whopping $173K.
OpenSea link:
https://opensea.io/assets/ethereum/0xc36442b4a4522e871399cd717abdd847ab11fe88/346682
Etherscan link:
https://etherscan.io/tx/0x829d8873e16f3ee84b03526b9383aa6c35d0f0b7f19eba34edb3174c6e2eae58