An easy primer on Price Curves and Liquidity Pools
Automated Market Makers (AMM) are critical to Decentralized Finance (DeFi) but the math that makes them work often remains a mystery. This article aims to explain the basics in simple terms so that you might have a better understanding of your investments and what to expect.
In traditional finance (such as central exchanges) prices are determined by buyers and sellers finding common ground within an orderbook arranged by the exchange, a third party; this presents a number of potential problems, one of which is trusting the exchange not to engage in any shenanigans like price manipulations, artificial volume, somehow preventing you from trading like the Robinhood fiasco, or simply going under and taking your funds with them.
DeFi allows us to buy and sell more easily without involving any third parties by utilizing Automated Market Makers. Instead of an orderbook and a bunch of potential buyers and sellers, AMMs use what are known as Liquidity Pools. Rather than matching an offer to a buyer/seller in an orderbook, we instead conduct transactions directly with the liquidity pool contract which quotes us a predictable price automatically. The liquidity pool is always ready to buy, and always ready to sell, 24/7/365.
Setting a price, x*y=k
The principles outlined here will apply to any liquidity pool, so let’s use an imaginary token as an example and keep the prices in relatable numbers. More often you’ll encounter huge numbers of circulating supply, tiny fractions of a cent in value, and much deeper liquidity in the real world.
To keep this simple let’s imagine that you have created a token named MyToken and you want to create a liquidity pool with MyToken and BUSD. You decide that you want each MyToken priced at $1 initially, so you pair 100 MyToken with 100 BUSD in a liquidity pool.
Using the formula in the heading, x*y=k, we enter for x 100 of MyToken, for y 100 BUSD, and this results in k=100*100, or k=10000.
Now no matter how many MyToken or BUSD is added or removed from the liquidity pool, the number k=10000 will always remain constant, which determines the quantity of the other token that you will receive in exchange. Make sense so far? Let’s use some examples.
From our initial pool, we can say that the price of MyToken is $1, since there are 100 each of MyToken and BUSD. 100/100 = 1.
You might think that you could buy 2 MyToken for $2, but this is where the math comes into play. Let’s add 2 BUSD to the LP and see how many MyToken need to be removed in order for x*y=10000 to remain true:
x*(100+2)=10000; x=10000/102; x=98.039
So by adding 2 BUSD to the pool, exactly 98.039 MyToken must remain in order to maintain the balance; this means that you will receive only 1.961 MyToken for your 2 BUSD purchase, and the new price would be 102 BUSD / 98.039 MyToken, or 1.04 BUSD per MyToken.
The key takeaway here is that in an AMM the quantity of your purchase always affects the price. This leads us to the next topic:
Liquidity is king.
The deeper the liquidity pool is, the less price impact a transaction has. Remember this, it is very important in understanding how prices fluctuate.
Let’s look at a price chart for the MyToken/BUSD liquidity pair, adding 10 BUSD at every step. Your initial impression might be that you could buy all of the MyToken in the pool for 100 BUSD, however as the previous example showed the price goes up as you buy more of it.
As you can see, adding 100 BUSD to this liquidity pool would only give you 50 MyToken in return, and would set the new price point at $4 even though you paid on average $2 per token for your 50 MyTokens. This brings us to another point; the listed price is now $4 per token and you have 50 of them, so you might expect to receive $4 x 50 tokens = $200. However if you were to return (sell) the 50 MyToken to the pool, you would only get $100 back!
Now let’s imagine this same pool began with 1000 MyToken and 1000 BUSD, and buy the same 10 BUSD increments:
Now 100 BUSD buys you 90.9091 MyToken instead of only 50 from the previous example. Also, the price impact of the same 100 BUSD purchase has resulted in the price only changing to $1.21 rather than $4.
In the same way that deeper liquidity means less price impact for buys, it also means less price impact for sells. This is very important to remember because so many tokens in DeFi are traded on relatively thin liquidity, which means that they are extremely volatile. In other words their price goes up and down a lot on relatively small buys.
LP’s always produce exponential price curves
Let’s look at the price curve in another way in order to better demonstrate what happens when most of the tokens have been taken out of the liquidity pool. The chart below shows the price in BUSD as 5% of MyToken are purchased from the pool at each step.
Notice how the price changes ever so slightly at first, then a little bit more, then more, then it shoots almost straight up? Going from 1000 MyToken to 950 only changed the price by $0.11, but going from 100 to 50 changed the price by $300!
This is what we refer to as a “supply shock”; that is, when comparatively few of the tokens remain in the liquidity pool, the price impact becomes much more pronounced.
There’s something else worth noticing as well; take note of the BUSD portion of the pool and corresponding price when BUSD went from 1000 to 2000, and from 4000 to 5000. In both instances only $1000 was added to the BUSD pool, but the first time caused the MyToken price to increase from $1 to $4, while the second caused it to increase from $16 to $25! So we see that as the LP pool squeezes out more MyToken, the price increases much more drastically from the same amount of funds added to the pool.
Wait, do I want drastic price moves or not?
In the beginning of this article I warned against tokens with shallow liquidity because it’s too easy to move the price with relatively small buys. Then I enthusiastically pointed out that once the liquidity pools reach a supply shock, the price can move very easily with less effort on an exponential curve.
This may seem like a bit of a contradiction, but there is one more key item to consider; holder distribution.
Holder distribution refers to how well distributed the tokens are. Ideally what you should be looking for are tokens where no one single holder is in a position to sell so many tokens that he can cause the price to drop significantly; once that happens, other holders tend to panic and sell their holdings and then the price really starts to fall rapidly. This happens time and time again in many different markets, not limited to crypto. The nice thing about crypto is that we can easily check and see how many tokens a wallet owns, and avoid or at least be cautious about those with an unbalanced holder distribution.
If you are confident that no lone holder is in a position to cause a massive price drop, then that supply shock phenomenon becomes much more appealing. When a well distributed token has enough upward momentum that it can go deep into the supply shock area of the price curve, and it has adequate liquidity to support the inevitable sales from some early buyers taking some profits, that is an ideal situation for a long term investment which could potentially reach 10x, 100x, 1000x, or more.
A perfect example; ELEPHANT token
It is a very, very rare case when all of these elements come together under one project; at the moment, I know of only one such example.
Take a look at the holder distribution for the ELEPHANT token: https://bscscan.com/token/0xe283d0e3b8c102badf5e8166b73e02d96d92f688#balances
The top 2 holders are contracts which only sell very small amounts when absolutely necessary; holders number three and four are liquidity pools; finally, at the #5 position is our first human holder, controlling only 0.8289% of the circulating supply. The next biggest holder has only half as much at 0.4139%, with subsequent holders controlling even less. In total, there are (as of this writing) over 20,000 individual holders and that number has been steadily growing, creating wider distribution over time.
Now let’s explore the liquidity of ELEPHANT token.
Note: There are two different methods of reporting liquidity, and different sites use different methods. Be aware of which method is used so that you are making apples to apples comparisons.
Some resources, such as poocoin.app, will report the liquidity value based upon only the value of the token backing the native token. In other words, per our example above, the liquidity of MyToken would be reported as only the BUSD value in the liquidity pair. To me this is the most intuitive method, as MyToken has no intrinsic value without the liquidity pool and you can never obtain more BUSD from the pool than exists within the pool.
Many/most other resources will combine the values of BOTH tokens in the liquidity pool. So from the first example above it might report that there exists $100 of MyToken and $100 of BUSD for a combined liquidity of $200. Although this is probably the most common method, to me it seems slightly misleading to claim an LP has $200 worth of liquidity when you can extract no more than $100 from it, but that is also a customary and accepted reporting method.
The important thing to remember is simply to make sure that when comparing liquidity of two different pools, that you’re using the same method for both.
Look in the left column of this ELEPHANT Money chart. You will see three entries for LP’s, one as ELEPHANT/BNB LP, one as ELEPHANT BUSD LP, and another much smaller LP we can ignore. Combining the numbers displayed, as of this writing there is over $33 million worth of BNB and BUSD supporting the liquidity of ELEPHANT token.
This means that there exists a tremendous amount of liquidity to support the price of ELEPHANT token, so some normal amounts of buys and sells aren’t going to move the price very much. In fact, the ELEPHANT/BNB LP contract is now the second largest holder of BNB on the entire Binance blockchain!
Despite the massive liquidity and excellent holder distribution, if we zoom out to the daily chart we can see a very strong lengthy trend of upward price movement; this is a good indication that many buyers are eager to buy and hold the token, which bodes well for price appreciation. Furthermore, if we observe the trendlines on the daily chart, a parabolic rise in price becomes evident, indicating that the LP pool is getting into the supply shock area where the rise in price can become very significant very quickly!
One last point; the chart above plots the price of ELEPHANT within the BNB pool but priced in terms of USD. Since the price of BNB has been fluctuating somewhat lately, we might want to consider looking at the same chart priced in terms of BNB rather than USD. This gives us a better idea of whether the price is in a “supply shock” part of the curve, and gives us better insight as to what the USD price chart might look like if/when the BNB price improves:
We can see from this chart that despite the price of BNB going through a bit of a rough patch lately, ELEPHANT is so deep into the supply shock that it is overpowering the decline in BNB’s price. Imagine what will happen to ELEPHANT price if BNB recovers and doubles or triples its price!
If this has piqued your interest in ELEPHANT token I’d urge you to do your own research and then hop on over to Elephant.Money if you decide to buy some.
If you found this article useful a clap and a follow would really help me out. Thanks for reading and I look forward to bringing you the next one!
Disclaimer: None of this should be considered financial advice, I am not a licensed financial advisor and present this information for educational and entertainment purposes only. All crypto involves risk and typically proves most fun when you don’t invest more than you’re willing to lose. I may have a financial interest in the product(s) referenced and could benefit from your purchase.