Liquid Momentum
(Article 3 in a series on decentralized exchanges and memecoins)
In the previous two articles, I looked at how withholding even a relatively insignificant proportion of a token can allow the holder to drain a decentralized exchange (DEX), and how a single large liquidity provider can cash out at the right time by reclaiming the liquidity they provided when the balance is in their favor.
This highlights the need for a genuine token project to have sensible vesting schedules for pre-allocated tokens, the pre-allocation to be small relative to the liquidity pool, and liquidity providers to be subject to redemption periods. If some or none of those are present, then the meme-coin you are “investing” in is nothing more than a rigged casino.
But there are further tricks that can be played with liquidity pools. In this article, I am going to examine how a wealthy and significant holder of a token can affect the rate at which prices change on a DEX. Whereas the earlier articles showed how unscrupulous project managers can make off with substantial profits, this process is about moving the needle toward that exit event, and examining it should help you understand DEX liquidity better.
Once again, I will illustrate what I am talking about with a fictitious meme-coin called YOLT (the “you only live twice” token), and we will ignore gas fees and commission fees to keep things simple.
Initial liquidity
For this example, I advertise my amazing YOLT project, mint a total of 200 YOLT tokens, keep 100 for myself, and add the remaining 100 YOLT to a DEX that I deploy. The second token of the liquidity pair I provide is 100 USDC, and as a result, there is a liquidity pool of 100 YOLT/100 USDC.
In return I get 100 tokens from the DEX that represent my claim on the liquidity pool — we’ll call that token lpYOLT, standing for “liquidity provider YOLT”.
Then the retail investors start piling in, buying $10 of YOLT each. Let’s look at what happens to the price:
Not bad. Within 5 trades the spot price per YOLT is 125% up from the start.
But we can do better. I have determined that there is significant interest in buying at the moment. The X advertising campaign is doing well, and I am seeing all sorts of wide-eyed and enthusiastic comments on CoinGecko.
Question: How can we make buying inflate the price more quickly?
Answer: Withdraw some liquidity.
World one
To illustrate this, we’ll split off into two worlds. In the first world I don’t touch the liquidity pool, and we examine what happens if five more speculators spend $10 each:
Brilliant! The spot price for YOLT is $4, four times the starting price.
World two
Now we examine the second world, in which I withdraw half the liquidity pool just before speculators six through ten make the same purchase:
This requires a bit of explaining:
- After speculator 5 buys their YOLT, I cash in half of my lpYOLT tokens, i.e. 50 lpYOLT, and get half of the liquidity pool back, i.e. 33.33 YOLT and $75.
- As a result, the new liquidity pool for the DEX is 33.33 YOLT/75 USDC.
- Because the pool is smaller, purchases of YOLT make the USDC price go up faster.
- A lot faster, as it turns out, because in world two, after speculators six through ten buy, the final price is $6.25 instead of $4.00.
One liquidity pool withdrawal that front-runs speculators six through ten results in a 6.25-fold instead of a 4-fold spot price rise!
Flip it and reverse it
The opposite is also true — by adding more liquidity I can slow down price changes. This is useful if I spot a temporary reversal in market opinion. For example, if trading upwards has been brisk for the last few days, and now some people are selling off and taking profits, I can prevent a price collapse by shoring up the DEX through the addition of more YOLT and USDC.
World one
Again, let’s look at two worlds in which speculators one through five buy YOLT, and then sell it all back. First, we examine world one:
Unsurprisingly, the liquidity pool returns to what it was at the start, as does the price per YOLT (in a real-world scenario there would be gas fees and commissions, but for simplicity, we are ignoring those).
World two
And now, world two, in which I add a further 100 YOLT to the pool, for which I must also provide matching USDC to keep the ratio between YOLT and USDC the same.
Before we had 66.67 YOLT and $150 USDC, so the ratio is 150 ÷ 66.67 = 2.25
Afterward we have 166.67 YOLT and x USDC, so x = 2.25 × 166.67 = $375
So the matching amount of USDC I have to add is $375 - $150 = $225
Adding liquidity means we also have to recompute a new bonding curve constant (see the previous article for an explanation of how that works). I get an extra 150 lpYOLT tokens — the calculation for this is left as an exercise for the reader.
Instead of collapsing back to the starting price, the spot price of one YOLT is only 69 cents less.
And look what happens if, instead of only holding 50% of the initial supply of YOLT, I held back over 90%, and then used it as liquidity to prevent a price collapse:
In this scenario, the price only drops 13 cents. The more YOLT I hold in reserve, the more I can slow down or speed up price changes on the DEX through the judicious addition and removal of liquidity.
But how do I, as a market manipulator, know when to do this?
Speculators and market makers
The speculators are mostly people sitting at home using MetaMask to conduct their transactions. That means they are clicking through one of the world’s most complicated and cluttered end-user blockchain wallet interfaces, waiting for gas fee estimates and for some third-party blockchain node provider like Infura or Alchemy to forward their transaction onto the rest of the blockchain’s peer-to-peer network.
In the meantime, the providers of the project are using an exchange management service that is running its own nodes and validators in various strategic locations around the planet, and that is monitoring the rate and quality of incoming transactions that interact with the DEX very closely.
This means that the project managers (or rather the service they are paying for) can front-run or sandwich significant transactions on the blockchain. When an unprocessed trade transaction is seen, they can submit liquidity pool-altering transactions with an appropriate gas fee directly to validators or miners to get those transactions included just before or just after the retail trade. It’s not guaranteed, but in aggregate, it all adds up in their favor, and not in yours.
As a retail investor, you are a day trader, and they are the equivalent of a high-frequency trading market maker.
In other words, you don’t stand a chance.
Coda
If you found this interesting or useful, you’ll probably enjoy my book, Evil Tokenomics. You can find out where to buy a copy for $4.67 in electronic format by following this link.