Liquidity Pools and what does it mean to be a Liquidity Provider

Liquidity Pools and what does it mean to be a Liquidity Provider
Photo by Jordan Madrid / Unsplash

Recently I researched the web on the hunt for news in the DeFi space. Accidentally, I stumbled upon a tech-savvy article describing an innovation that should ease the life of liquidity providers. The article outlined directional liquidity pooling in DeFi. Reading articles like that daily made me think that understanding them might be a challenge for people unfamiliar with the technology behind DeFi. Therefore, I decided to write this article in an attempt to lay out the fundamental knowledge about Liquidity Pools and Liquidity Providers briefly and painlessly so that the SwapDEX community and all readers can improve their DYOR (Do Your Own Research) skills.

What are Liquidity Pools?

If you ask Google about Liquidity Pools (LPs) you will be greeted by several attempts to answer that question. But answering a question and explaining a concept are two different things. Therefore, I will attempt to write an accessible explanation of LPs in the following paragraphs, and for me, an explanation needs an analogy.

So let's start with a simple and maybe not perfect analogy, but thinking alongside it helps you to drive the idea of LPs home.

Imagine you are walking through your local weekend market. You quickly notice different stands selling various items. For example, you spot an apple stand, selling apples to the public, and you decide to buy two or three of them. To do this, you need to visit the apple stand and see if they have two or three apples available, and you need to ask for the price. If the price seems fair to you, a transaction of goods will happen. The transaction will contain a swap between apples and dollars. So far, so good. Now, let's expand on this analogy. In a classical market situation, the seller is motivated to sell its items at the highest price possible to maximize profits. Contrarily, a buyer is looking for the cheapest price available. This can lead to some sticky situations. What happens if there is only one seller of apples and the seller quotes very high prices? Right! no exchange of goods will happen. This situation is called an illiquid market because there are apples on sale and people interested in buying them, yet no trade takes place unless another apple stand occurs, supplying the market with cheaper apples or the willingness to pay increases. But if this doesn't happen, you have supply and demand, but nothing moves.

I outlined above a phenomenon occurring in order-book models where sellers write the number of items and their price into an order book, and buyers write the number of items and the price they are willing to buy in the same book. Only if sell and buy orders match in quantity and price, both parties will agree, and a transaction is going to happen. Only in such cases do we witness movement in the market. In other words, we experience a liquid market.

To summarize, if you want to buy apples, you need to find a seller with enough apples for a price you are ok with. If you are successful, a liquid apple market will be created between you and the stand.

Tezos X Unsplash
Photo by Dylan Calluy / Unsplash

Let's now transfer this into the crypto world - where apples become the apple token (APL), and the weekend market becomes a central exchange (CEX). If you now try to sell or buy the APL token you will notice that magically and regardless of the time you want to buy or sell APL someone is actually buying APL or selling APL to you. Interesting right? But the magic has a name and we call it Market Makers. Let's pause for a second and acknowledge that you can already describe the job of Market Makers without me explaining them because their job is to make trades happen or to make markets liquid. But wait a minute you may ask - "How do market makers make a profit if their job is basically buying and selling the APL token from everybody at any given price?" That is a fair question. Market Makers make a profit by offering the CEX a so-called bid-ask spread, meaning they tell the CEX: "Listen, I'll buy every APL below price x and sell to everybody who wants to buy at price y. The difference between price x and price y is the spread, and yes, it's the old "Buy cheap, sell high" Scheme. The key is that CEXs ask for many market makers with different bid-ask spreads to join their exchange. And each market maker usually offers different bid-ask spreads to optimize for their profitability. So on the CEX and in the APL/BUSD market, three participants are meeting. We have Sellers, Buyers, and Market Makers. Sellers are looking to sell as high as possible and are placing limit-sell orders in the order book, buyers are trying to buy as low as possible and are placing limit-buy orders in the same order book, and Market Makers are accepting all market buy or market sell orders. And you will notice that you will be charged a small fee if you execute a market order because, besides the bid-ask spread, you pay for the service of being capable of buying or selling at any given time.

Sounds not so great anymore, right? Now let's move this from the world of Centralized Finance into DeFi and Decentralized Exchanges (DEX). Remember, decentralization means cutting out the middleman. That means you must cut out the entity that negotiates and centralizes all market makers that bring liquid markets to you. Sounds like a shot in the own foot, right?

But we are getting closer to the topic of Liquidity Pools so stay with me for another minute because we first need to understand how to decentralize Market Makers.

Ok, ready for DeFi?

Crowd of people cheering at a live concert
Photo by Tijs van Leur / Unsplash

Great! Let's try to get rid of the middleman. To do this, we need to somehow automate the logic of market makers and upload it to the blockchain to guarantee "ever-liquid" markets on a DEX otherwise, trading on a DEX would be a pretty stuttery experience. And we accomplish this by utilizing smart contracts (snippets of coded logic deployed to the blockchain). So, in essence, decentralized or Automated Market Makers (AMMs) are first and foremost smart contracts deployed on a blockchain, with no humans involved. But how does it work? This is where it can get technical very quickly, so to keep you with me, you need to understand the gist of an AMM, and that is that AMMs are making sure that if a seller or buyer visits the DEX they can conduct a trade at any size, and any time of the day. So what role does a Liquidity Pool play here?

Since AMMs are "just" snippets of code on the blockchain, they need to access funds to ensure that an asset pair is always liquid and can be traded on the front-end application. Those publicly available pockets of paired assets are Liquidity Pools (LPs). Similar to AMMs, LPs need to be decentralized and are smart contracts with specific rules. One rule, for example, is that those pockets can only be filled with the same value of both assets, meaning you cannot throw in $500 worth of APL and $250 worth of BUSD. You need to throw in the same value, so $500 worth of APL and $500 worth of BUSD into the pool. And yes, everybody who holds BUSD and APL can provide liquidity to any APL-BUSD pool. Let's tie this together - the combination of Liquidity Pools and AMMs results in something known as a Decentralized Exchange (DEX). The LPs hold the funds, and the AMMs determine the price and facilitate the trades. The AMM smart contract will tap into the Liquidity Pool to enable a trade by determining the amount of APL a buyer will receive and then will take the BUSD out of the buyer's wallet and put it into the LP. So a buying process will change the LP's ratio of APL to BUSD. To be clear, an APL buy will increase the amount of BUSD and decrease the amount of APL within the Pool. APL buys, therefore, lead to less APL and more BUSD in the pool, meaning one APL is now more "BUSD" worth, or in other words, the price of APL increased.

Let's give it another shot by looking at an APL sell process.

The exact opposite is going to happen. The AMM will take your APL and determine the amount of BUSD you can get. If you confirm the transaction, the AMM will take the amount of BUSD out of the pool and put it into your wallet. At the same time, the AMM will take your APL token and put it into the pool. So at the end of the interaction, the pool will have more APL tokens and less BUSD, which leads to a reduction of the APL price in this specific liquidity pool.

Why do I say specific? Because the chances are high that there are multiple APL-BUSD liquidity pools out there. And you are correct if you start to scratch your head thinking - "Wait a minute... does this mean that the price of the APL token might deviate from liquidity pool to liquidity pool?" You are absolutely correct about this thought. Let me expand on this idea a bit. What would you do if you saw that you could buy the APL token on Liquidity Pool A for $1 and sell it on another LP for $1.2? Yes, of course, you would use this opportunity to make profits, and you are not alone in thinking so - we call these opportunities Arbitrage Opportunities, and the mechanism is known as Arbitrage Trading. And Arbitrage Trading is very important for DeFi because it equalizes the prices between DEXs and CEXs.

What makes Liquidity Pools Important?

As we learned above, Liquidity Pools are smart contracts deployed on a blockchain and vital components of decentralized exchanges. That is because they interact with Automated Market Makers by being an accessible pocket of asset pairs that the AMMs can use to provide liquid markets to the users of the DEX. We also learned that everybody who holds both assets of a particular asset pair could contribute liquidity and thus deepen a liquidity pool. Contributing liquidity turns the person into a Liquidity Provider and, more importantly, into someone who enables decentralized finance.

What is going to happen if there were no Liquidity Pools?

So if we flip this statement on its head, we can see the importance of liquidity pools. Without LPs, there wouldn't be any Decentralized Exchanges, and crypto trading only would take place on centralized exchanges, which impose a set of requirements onto their users. Usually, you need to go through a KYC (know your customer) process and disclose your ID and address. Furthermore, the CEX gets to decide what tokens will be listed and available to the traders. This concentration of control within a central entity quite frankly defeats the general purpose of crypto, namely being decentralized by cutting out the middle man and empowering the individual, not a central authority.

Without Liquidity Pools, Liquidity Providers, and DEXs, crypto would be in a very bad place. Controlled by two or three big exchanges which can suspend trading or sanction users as they wish or desire.

How does a Liquidity Provider make Profits?

By now, you should have a rough understanding of a liquidity provider. In the previous paragraph, you also learned that Liquidity Providers are essential to DeFi and are the underpinning of Decentralized Exchanges. Despite how noble Liquidity Providers might be, I think it goes without saying that they wouldn't do it if there weren't a chance to make some profits - at the end of the day, DEXs require liquidity, so it's fair if the providers of liquidity get a cut and that's precisely what happens.

If you ever swapped two tokens on a DEX, you also paid fees for that transaction, and I'm not talking about the gas fees here. Gas fees are highly blockchain dependent and incentivize miners or validators to process and prioritize pending transactions. This is needed because only a limited amount of transactions can be written into a block. Therefore, miners need a way to pick some transactions over others. And what would be a better way than picking the transactions that pay the most gas fees? Therefore, gas fees are rising with the traffic on the blockchain because users are willing to pay more gas to ensure their pending transactions are processed and written into the blockchain.

Back to the DEXs, they are charging a separate transaction fee that sits on top of the "tech imposed" gas fees. This separate transaction fee is then used to reward the liquidity providers. So let's look at this a bit closer. If you research liquidity pools, you will be confronted with a couple of metrics, the following two being the most important: Total Locked Value (TLV) and Trading Volume. Trading volume gives you a good idea of how much money was moved in and out of a specific pool and how many transaction fees were paid by the traders. TLV tells you how deep the liquidity is and how stable the price is. For example, if the TLV is $100m and a $1000 trade is facilitated, the price impact is very small compared to a liquidity pool that may have $50,000 TLV. But what makes this important?

Two reasons: First, the higher the TLV, the more liquidity you need to provide to make a decent cut from the transaction fees because the rewards from transaction fees are proportional to the amount of liquidity you provide. Second, providing liquidity comes with an attached risk of Impermanent Loss, and to avoid Impermanent Loss, you want to have a stable price of the assets, or if a price movement happens, then you want it to happen for both assets in the same direction.

Without stressing this too much, as a Liquidity Provider, you make profits by getting a proportional cut of the transaction fees, and you avoid impermanent loss by stable asset prices. The more liquidity you can provide, the more rewards you get. The greater the price action the more impermanent loss you suffer.

What is Impermanent Loss?

Good job reading this far! To round this up, I want you to understand impermanent loss. First, let's translate impermanent loss into something we can understand and memorize. Impermanent means "not permanent" or, in other words, "not realized". So Impermanent Loss actually means "not realized" loss. The loss only becomes permanent (realized) if you pull your tokens out of the liquidity pool.

"Not realized" loss occurs if you compare how much profit you could have made by just holding the assets compared to providing your assets to a liquidity pool. Remember, by providing liquidity, you essentially send your assets to a smart contract managed by an AMM. That AMM increases or decreases the number of tokens inside the pool based on the trades facilitated on the DEX. If, for example, an arbitrage opportunity is created between your pool and a CEX- arbitrage traders will pop up, buying your APL out of your pool to sell it on the CEX for BUSD. The AMM will give them your "cheap" APL tokens in exchange for BUSD, and the arbitrage traders will continue to buy from your pool until the price of APL in your LP matches the price on the CEX. Of course, you will realize profits from the transaction fees the arbitrage traders pay. On top of that, you also see profits because the price of APL in your pool rose due to their buy action but, and this is big but, if you now pull your APL and BUSD token out, you will realize that you will get fewer APL out than you put in. This is because the arbitrate guys caused the APL/BUSD ratio to shift within the pool. You should ask yourself now: "How much profit would I have made if I just held my APL tokens?" Because you could have also sold your APL tokens on the CEX. To leave you off the hook, if the profits by holding the tokens exceed the profit you make from your share of the transaction fees you experience "not-realized" loss or impermanent loss. So as a liquidity provider, you don't want to see much price action. You instead want high trading volume at a stable price to harvest the transaction fees.

And there you go. At this point, I hope I have managed to enlighten you a bit on the tech behind DeFi. If I now tell you that I recently stumbled upon an article that described an innovation that allows liquidity providers to bet on a price movement of their provided assets to avoid impermanent loss and to cash in some extra profits, you hopefully would be a bit excited to learn more about directional liquidity pooling.

If you liked this article please consider sharing it with your friends and join the SwapDex community on our Discord server.