How do liquidity pools work?

in #tribes2 days ago

How do liquidity pools work.jpg

Basically a liquidity pool takes two tokens and pairs them to create a market. We have token A and token B. At the creation of the pool exactly 50% of value of token A and 50% of value of token B need to be added as liquidity to the pool. If after the pool creation, somebody swaps A to get B, we will see more tokens A in the pool than tokens B. However, the value of each token remains the same. In other words, token B will have gained value and token A will have lost value. This is not that easy to explain with words. So let's take this illustration:

Swap.jpg

After the swap we have more token A than before and less token B. Both tokens are still worth 50% of the value however. There are more tokens A for the same value and therefore the value of A went down. There are less tokens B for the same value and therefore the value of B went up.

With each transaction, things are recalculated and that's how at any time a liquidity pool can give a price to a token in respect to its paired token. This is actually such a big step forward from the traditional order book market where you could sell your title only if there was a buyer for the title. In addition to that, the price to buy and sell are the same. There is no spread other than the fee that for each pool is predefined. With traditional order books, you had to pay the spread and in addition to that fees that were added by the broker also called courtage.

The variables of liquidity pools

To understand liquidity pools better, it's important to look at what differentiates them. Of course we first to have to look at the tokens that are combined. You can have two stable coins paired. One stable coin and one volatile coin or two volatile coins. The look for the perfect pair of tokens is the most important factor when using liquidity pools.

Size of the liquidity

An important factor is how much liquidity is in a pool. When you want to swap tokens, it is very important to have a high liquidity. The more the better. With little liquidity, your swap can provoke a big change of price, also called slippage. If for example you have a pool with 10$ SOL and 10$ USDC, when you want to swap 5$ you will change the price dramatically and you will get a very bad change. If you have a pool with 100'000 $ of each token, your swap will have a minimal impact on the price and your exchange will be very close to market prices.

However, if you want to provide liquidity it is also important that there is not too much liquidity involved. The more liquidity, the more the fees will be spread among the liquidity providers.

Fees

Another important aspect are the fees that are deducted from each swap. These fees normally go in majority to the liquidity providers. For the person who swaps, little fees are an advantage but for somebody providing liquidity maybe a bit higher fees wouldn't be bad. What we should keep in mind is that very high fees will reduce the quantity of transactions. People will want to pay as little as possible for transacting and if the fees are too high, there will be less transactions and therefore few fees for liquidity providers.

The blockchain

It really matters where your liquidity pool is located. When providing liquidity or swapping tokens, you will need to pay network fees and there are big differences between the blockchains. Etherum is known for its high fees. Other chains like SUI or Solana have much lower fees. For swapping and providing liquidity its best to opt for chains with low fees.

The transaction volume

The quantity of transactions matters mainly if you want to provide liquidity. The more transactions, the more fees you will generate. When you need to chose, always go for the pool with more transactions.

The return

On the different platforms, you often get an indication of the return that you can expect in pools. This is often calculated on a historic basis over the last days and it can't be taken as guarantee for further returns. It's important to understand that on some platforms you get ab indication on the return per 24h and on others on a yearly return.

Concentrated vs normal liquidity pools

Most modern platforms offer nowadays the concept of concentrated liquidity pools. In the next post, I will explain the difference between a normal and a concentrated liquidity pool.


With @ph1102, I'm running the @liotes project.

Please consider supporting our Witness nodes:

Sort:  

We need more detailed posts like this, man, because it's a difficult subject to understand. At least it's impossible for a person who hasn't been on web3 before to understand it.

I've put a lot of hours in trying to understand how these things work. It's an amazing technology that is worth to explain in detail. I will try to make some more posts about the subject :-)

I'll read them too man, I want to understand it fully

Super interesting, I've bookmarked it so I can always look it up and read it when I need to. I learned a bit more about pools.

!PIZZA !BBH !LUV

@achim03, @shiftrox(2/5) sent you LUV. | tools | discord | community | HiveWiki | <>< daily

Made with LUV by crrdlx

Happy to hear that you found it useful :-)

Sorry, but how it's possible have 2 tokens with the same value... When you say 50% of A and B, that is in monetary value, not in tokens quantity?

The value is most of the time expressed in $. So you would need a certain amount of tokens A with the same value in $ than the according number of token B.

Let's say you pair USDT and Hive at hive 0.33$. You would need to pair 30 Hive with one 1 USDT. 30 x 0.33 = 1.

Hope it makes sense :-)

Yeah, I got it now 😆 Thanks for your patience!

!INDEED
!PIZZA

Now I understand better how liquidity pools work, thank you for the explanation.

!BBH
!WINE

I'm happy you found it useful. Thanks for stopping by!

Being a crypto dummy, this really helps me to understand the concept of liquidity pools better, thanks for that.

One outstanding question for me, is how does the liquidity pool start off at 50/50 equal value? Say if I were to start a liquidity pool for Hive and my fictitious token LUT which is worth $0.00001, would I have to get people to put in Hive and LUT worth equal amounts in the pool before starts to operate? Are these the liquidity providers you mentioned?

I'm happy you could learn something from the post :-).

The two tokens that you pair together need to have the same dollar value to start with. Let's take your example of Hive and LUT at LUT being worth 0.00001.

Let's say for this example that hive is worth 0.33 $ and you want to put 100$ worth of each token as liquidity into the pool. You would therefore need to put:
100 / 0.33 hive and 100 / 0.00001 LUT -> 303 Hive and 10'000'000 LUT
That's the ratio that you would put at the start to create the pool. It could be any multiple of it.

Hope this answers your question :-)

Thanks. What I mean is, as the person creating the liquidity pool, do I have to fund it all myself or do I get other people to put their funds the pool?

But wait... ignore my question, because I think I've figured it out....

I remember when I invested in the Zing liquidity pool, which is the only one I invested in, and I had no idea what I was doing, I invested a few times in the pool, and everytime I had to put both Zing and Hive in the pool, and every time the actual amount, or the relative price of the two differed. And when I eventually divested, it differed again. I think it's all coming together like jigsaw puzzle now.

Look forward to the next post. thanks!

You got it correctly. With the pools that we have on hive, you always need to put in or pull out 50% of value in both coins. Since both coins evolve differently in price, you will always have a different ratio.

It's an interesting model and I do like how it works. I know that diesel pools and Defi pools (in the past) can give extra rewards. Has that changed in the newer pools?

Rewards are another aspects of these pools. On other blockchains they call them farms and they offer quite a lot of options.

More information about LP... Noted! 🗒️

Ty for the information~

!ALIVE
!PIZZA

You are welcome and thanks for stopping by :-)

I understand that you are referring to entering an infinite pool because if it is limited in price then you can choose any percentage.

Exactly. These are traditional liquidity pools like you find them on hive. What you are referring to, I will make a post specifically about them :-)

Even having been exposed to liquidity pools for quite some time, the idea of impermanent losses still confound me, but of course, the problem only really sets in when those impermanent losses actually become permanent! 💸

The concept of impermanent loss is actually not as complicated as it is often shown. Basically you compare the situation by holding both tokens in you wallet with the situation with both tokens in the pool. If both tokens evolve in parallel, in the second situation you don't make any losses. However when both tokens don't evolve at the same speed, having them in the pool will leave you with less value than if you have both tokens in the wallet :-)

Thank you for the explanation. It helps those of us who are know to understand how things work here. Thank you.

I'm happy you found it useful :-)

This post has been manually curated by @steemflow from Indiaunited community. Join us on our Discord Server.

Do you know that you can earn a passive income by delegating to @indiaunited. We share more than 100 % of the curation rewards with the delegators in the form of IUC tokens. HP delegators and IUC token holders also get upto 20% additional vote weight.

Here are some handy links for delegations: 100HP, 250HP, 500HP, 1000HP.

image.png

100% of the rewards from this comment goes to the curator for their manual curation efforts. Please encourage the curator @steemflow by upvoting this comment and support the community by voting the posts made by @indiaunited.

Thanks for the curation!

Great information on liquidity pools @achim03 wishing you a successful week ahead

Made in Canva
!ALIVE

- @benthomaswwd - Moderator


This post has been curated by the Alive And Thriving Team, we curate good content in the We Are Alive Tribe that is on topic for #aliveandthriving, and it's included in our daily curation report on @aliveandthriving, plus @youarealive is following our Curation Trail.

Thanks for the curation!

Well written explanation, thanks, makes it all a bit clearer for me
!BBH

I'm happy to hear that. Thanks for stopping by!

I have also joined something like this where things are put in and getting some profit every month but when prices are higher the quantity is reduced and calculated if Both things are running equally.