LP Impermanent Loss is a misunderstood problem you would like to have

-DvD-
9 min readNov 3, 2021

--

Everybody is scared by this Impermanent Loss because — who ever would want a loss, Right? Wrong.

Let's start from the basics.

How people buy stocks in legacy finance

In LeFi (Legacy Finance) if you want to buy or sell a stock you have two options to make it happen: on market order or on limit order.

Let's see how a limit order works. There is a place, usually a stock exchange, that keeps a book of all the order people make. A limit order is something like "Dear Mr stock exchange please note in your order book that I would like to buy 100 issue of such stock at maximum $10.00 not a cent more, buy if you reach to make me pay less, thank you!".

The stock exchange official will take note on the book of this order, and of all the other buy and sell order of all the stocks listed in the exchange.

An actual swap will only take place if a sell and buy order matches for quantities and for price; this is not always the case and we have situation where someone would like to sell a quantity but there is no one on the book willing to buy that quantity: illiquid stocks are hard to deal with.

Market orders on the other hand are orders where one say "Dear Mr stock exchange, I'd like to buy (or sell) 100 of such a stock at whatever price you find available on the book". This can be problematic because if there are few stocks at the price he see he may end buying (or selling) at a price far distant from the starting one.

Let's see this another way: imagine the order book like a road with shops on the sides. Each shop on the right side sell the same article, a lighting bulb but at a different price: the first shop sell it at $1.00, the second at $2.00, the third at 3.00 and so on. Why would one go to the shops that sell at $3.00 when there is one the sells at $1.00? Liquidity.

Not all shops have the same quantity of lighting bulbs available: the first has 10, the second has 20, the third has 30.

So the "Price" of a lighting bulb is 1.00 only if you buy 10 or less, but if you want to buy 15 you have to buy 10 at $1.00 and 5 at $2.00, and so on.

This is how a book order works, you have stocks instead of lighting bulbs and a certain number of orders in queue to sell or buy that stock at a certain price.

When on "shop" get sold out the price of the lighting bulb changes to that of the next shop. In our example the next person that wants to buy even a single lighting bulb will have to buy it at $2.00 minimum.

How people buy tokens in DeFi

DeFi (Decentralized Finance) it's all about spreading to common people what formerly were earnings of big entities like banks, market makers, stock exchanges, etc…

We want to solve the problem of low liquidity stocks and we want to give back to the people the earning of the swapping (buy and sell) fees. DeFi did it.

On DeFi there is no centralized exchanges (there are outside DeFi: Binance, Coinbase, etc… those are called CEX) there are Decentralized Exchanges (called DEX). The first DEX was https://uniswap.org/. Let's see how Uniswap solved those problems.

You can interact with Uniswap (and any other DEX like https://sushi.com/) as a "customer" that buys a token paying a fee (0.3% of the swap), or as a "bank" that collects that fee. Yes: you can take the role of a Bank.

A DEX is a collection of currency exchanges kiosks like those you find the airports. What does a currency exchange kiosk do? Let's take the EUR USD example: they take your USD to give you EUR, or they take your EUR to give you USD, for an exchange fee, at the current exchange price. At the start of the day they have a drawer with some EUR and some USD, and all the day they take some EUR in and USD out, and USD in and EUR out: the total value they have in the drawer is always getting bigger because they add the transaction fee to stash. They may run out of USD and close for the day, until they found someone willing to give them some USD in exchange for EUR, when they are desperate they even could lower the price of EUR to get back some USD in the drawer.

A DEX pair is *exactly* the same concept. A pair can be $YEL/$MATIC. That pair is just a drawer containing half $YEL and half $MATIC.
Ok, you say, but half what? Half number? Half weight? Half time?
Half value.

Each pool (drawer) at the beginning of the day will have half dollar value in a token and half dollar value in the other token. In our example if we have $10.000 in that $YEL/$MATIC pool we will have $5.000 of $YEL and $5.000 of $Matic.

Then comes the first client and ask to swap some $Matic for some $YEL (we say he is buying $YEL, but he is just swapping one token for another), now what happens? There is a problem!

We don't have 50% one token and 50% the other no more, right? Wrong!

The quantity of the two tokens changed but to keep the rule of half and half the DEX changed also the price of both tokens. $YEL got out of the pool so now we have less: $YEL price got higher; $Matic got inside the pool so we have more: the price got lower. We still have half dollar value of one token and half dollar value of the other, just different quantities.

You see where we are going? If many people buy $YEL the price of YEL has to compensate getting higher and higher, eventually the price will be so high that people will stop buying. This is what make the price change in DeFi. Each single swap people make move the price a little bit. The greater the swap in proportion to the liquidity in the pool the greater the price movement.

In our example we had $10.000 in the pool: swapping $5.000 of value in that pool would have moved the price of the bought token a lot — I mean A LOT like 50%. Also selling a token would have moved the price the same way.

If we had $1.000.000 on the same pool swapping $5.000 of value would have had a price impact irrelevant. This is the price impact value that you find in the DEX when you try to make a swap.

Back to our one person depositing half $YEL and half $Matic in the pool: for each swap the pool ask 0.3% of the swapped token as swapping fee, and this token gets added to the pool. If we don't consider the price change of the tokens in the pool — but remember that it's the pool that makes the price change: as long that a token gains value it's quantity decreases in the pool — at the end of each day the value in the pool increases of the fee amount collected.

Since this is DeFi there will not be a single person depositing liquidity in a pool, but many people collaborating: the fees will be shared by all the participants, and each one depositing liquidity (half dollar value one token, half dollar value the other token) will receive a receipt of the deposit: the LP token. Each LP token is a share of the pool, and the fees gets added directly to the pool.

LP Tokens

When you deposit liquidity in a pair you receive a token from the DEX called LP. That token is used to take back your money form the pool. What you own though is not a fixed certain amount of each token, but just a percentage of the pool. If you enter with $10.000 of dollar value in a pair pool that had $90.000 of value you now are owner of 10% of that pool.

Remember that the pool is always half dollar value of one token and half dollar value of the other (this is what makes the price of the tokens change) and that the pool in constantly receiving new money coming from the swapping fees.

When you want all or part of your position back you give the DEX all or some of your LP tokens and you take the relative percentage of dollar value of the pool — whatever the actual tokens value are.

Of course, if after you enters another person with $100.000 dollar value of liquidity, your percentage become 5%.

As you can see the total value of the LP token is a complex: if both tokens price increases more or less the same the LP will be worth more, if both tokens lose value it will be worth less, if one grows way more than the other the LP token will still be worth more. To all this increase and also decrease of token value we must add the swap fees: you will collect swap fees even when the market crash — actually during a crash there is a spike in volumes, so a spike in swap fees!

Staking LPs

If you managed to read until here, congratulations! You now know that a token with little liquidity cannot be sold or bought without disrupting the price.

Projects needs to have pairs with deep liquidity and incentivize people depositing liquidity on their pairs (pairs that have the governance token) usually versus the chain currency. So Yel.finance that is at the moment of writing on four chains will incentivize the $YEL/$ETH pool on Ethereum, $YEL/$Matic on Polygon and so on.

How this incentive works?
Usually they pay a certain amount of governance token if you own a LP position of their token. Yel.finance at the moment is paying 14,985 $YEL each day to people depositing their LP on the LP staking.

How many $YEL will you get if you deposit your percentage of the total LP deposited. It' s self stabilizing: if there are few LP deposited the depositors gets a bigger chunk of the payment, the there are a lot they take less, until they take so little that they exit the staking pool, increasing the APR for people remaining.

This is why you see APR changing in the staking pools it changes following people entering and leaving the pool even if the daily drop stay constant.

Conclusions

A LP position will collect swapping fees for each single swap that happens. You don't need to manually collect them (Uni V3 is an exception, all dexes are Uni V2 clones so it's all right) they all get added to your LP position.

You will get swap fees in any market conditions: up, down, lateral. Especially during selloffs you take a lot of fees.

If you stake your LP in a project incentive pool (staking LP pool) you will get governance tokens on top of fees for double passive income!

If you want to take your share of the liquidity pool back you need to give back your LP to the DEX. If you deposited those LP in a staking pool you first need to unstake from there, and then hand back the LP to the DEX.

"Wait a minute!" — you say: "and the Impermanent Loss, wasn't all the article about the impermanent loss?" Yes it was but I did not talk about Impermanent Loss because there is nothing to talk about.

Impermanent loss is the missed opportunity cost of holding a LP position instead of holding one of the two tokens of the pair: if you are in a $YEL/$Matic LP and $YEL makes +50% and $Matic makes +0$ in that case you only make +25%, not considering all the swap fees you collect, all the LP staking drops you make, all the possibility to make earning even if the market turns bearish.

A real example: at the beginning of $YEL some people did not put money in the $YEL/$FTM liquidity pool because "Oh my god I risk impermanent loss when $YEL goes 1000% if I LP!". You know what happened $YEL stayed stationary for two months, and $FTM went from $0.30 to $3.00. Who had Impermanent Loss, defined at the missed opportunity of investing somewhere else?
$YEL is a super cool token and later, at the time of writing, got in par with $FTM. This is just an example out of many.

If one has to reason in this contort ex post way, one can have Impermanent Loss even just holding $BTC: there will always be a token performing better than another, so what?

Impermanent Loss is just Opportunity Cost. Let's talk of something else, please.

Hi, I’m -DvD-. I’m a mod in the Yel.finance Discord — this is why I invested on Yel.finance. Being on that Discord I realized which are the most misunderstood concepts of DeFi and here I try to simplify them.

I believe that knowledge should be free and accessible for all, but if you wish to offer me whatever beverage is good in your culture you can tip me at: 0xebDBbca4744C66E3aE39F997fD5fB7dE29874ce5, I’ll be super happy to know I helped someone! Cheers!

--

--