Chapter 4 Dollar-Cost Averaging (DCA)
In chapter 2, I had you open a UniV3 LP position with $25 of ETH and $25 of USDC. I also showed you how to measure its performance by
- comparing against its initial value at position open time, and
- comparing against the hypothetical scenario of holding the coins in wallet.
Let’s formally introduce the metrics:
- position Capital Gain or Loss (CGL) = Current Liquidity Value - Initial Liquidity Value.
- Impermanent Loss (IL) = Current Liquidity Value - Current Hodl Value.
Mathematically, these can be written as
- pCGL(t)=LV(t)−LV(t0), where LV stands for Liquidity Value.
- IL(t)=LV(t)−HV(t), where HV stands for Hodl Value.
Let’s also throw in the mix a third metric:
- hodl Capital Gain or Loss (CGL) = Current Hodl Value - Initial Hodl Value, and its math equation is hCGL(t)=HV(t)−HV(t0), where HV stands for Hodl Value.
Remark:
- Initial Hodl Value is equal to Initial Liquidity Value, i.e., HV(t0)=LV(t0).
- pCGL(t)−hCGL(t)=(LV(t)−HV(t))+(HV(t0)−LV(t0))=LV(t)−HV(t)=IL(t).
Let’s understand pCGL, hCGL, and IL better through two fictitious examples where we ignore fees and gas.
4.1 One-sided liquidity provision
The simplest concentrated liquidity provision involves a volatile coin1 and a stablecoin2 and has either one of the following setups:
Open a one-sided position by sending only the volatile coin to the liquidity pool and setting the position’s lower bound just above the volatile coin’s price. So the position starts with 100% volatile coin. When the price of the volatile coin moves above the position’s lower bound (p0), the position will start earning fees. As the price goes higher, the position will hold less of the volatile coin but more of the stablecoin. When the price finally surpasses the position’s upper bound (p1), the position will be 100% in the stablecoin. The effective sell price (i.e., DCA-out price) is √p0∗p1.
Open a one-sided position by sending only the stablecoin to the liquidity pool and setting the position’s upper bound just below the volatile coin’s price. So the position starts with 100% stablecoin. When the price of the volatile coin falls below the position’s upper bound (p1), the position will start earning fees. As the price goes lower, the position will hold less of the stablecoin but more of the volatile coin. When the price finally drops below the position’s lower bound (p0), the position will be 100% in the volatile coin. The effective buy price (i.e., DCA-in price) is √p0∗p1.
Any two-sided positions can be decomposed into two one-sided positions. We’ll prove this in later chapters. Right now, let’s look at two fictitious one-sided ETH-USDC positions.
4.1.1 DCA out of ETH via ETH-USDC LP
We bought 0.05 ETH at $3100 and sent them to an ETH-USDC liquidity pool and opened a position between $3100 and $3300, with a DCA-out price of $3198.44. Ten days later, ETH price jumped to $3800; we closed the position and got back 159.92 USDC, realizing a position capital gain of $4.9. Had we held the 0.05 ETH, it’d be worth $190, giving a hodl capital gain of $35. The position’s impermanent loss was -$30.08, exactly the difference between position and hodl capital gains.

When entering a LP position one-sided from the bottom with volatile coins, the size of IL is often much bigger than that of pCGL:
- If price pumps, you will have a positive pCGL but a much bigger negative IL. You will regret for having LP’d.
- If price dumps, you will have a negative pCGL and 0 IL. You will wonder if you will end up bag-holding the volatile coin into oblivion.
The second scenario is objectively worse than the first one, although you may still feel bad if the first one occurs. The best scenario is when price goes up and down but stays within your position’s range for a long time, and then you pull liquidity and get the volatile coin back with 0 IL, and the price moons soon after and you sell your bag at ATH. But you really need luck in order for the best scenario to happen. I wouldn’t count on it.
4.1.2 DCA into ETH via ETH-USDC LP
ETH price was at $3800. We sent 200 USDC to an ETH-USDC liquidity pool opened a position between $3800 and $3600, with a DCA-in price of $3698.65. Ten days later, ETH price dropped to $3100; we closed the position and got back 0.05407 ETH (worth only $167.63), giving us a position capital loss of -$32.37. Had we held the 200 USDC, we wouldn’t have lost a penny. The position’s impermanent loss was also -$32.37, once again, exactly the difference between position and hodl capital losses.

When entering a LP position one-sided from the top with stablecoins, pCGL and IL are the same. This is because hodl value never changes in this case: it’s always the USD value of the amount of stablecoins sent to the pool.
4.2 Ignore IL, Focus on pCGL
Don’t be scared by IL.
Recall that pCGL happens when we compare an LP position’s value against its initial value, and IL happens when we compare its value against the counterfactual scenario of spot-holding. When the volatile coin’s price goes up, it’s easy to end up with a positive pCGL and a negative but much larger IL. This makes people unhappy because they would’ve made more money by holding the volatile coin. But what are the chances that you could have predicted the pump? You say, “80% because I’ve done the research and have a thesis and know the upcoming catalysts.” To that, I say, “good job, what if the catalysts came way later than you anticipated. Could you hold your bag for a year while watching price stay flat or drop without losing conviction?” You say, “yes, I’m very patient and believe in my conviction like a stubborn mule.” I say, “That’s impressive. Congratulation on capturing the entire pump. Now having sold your bag victoriously, what are you gonna do with the stablecoin proceeds?” You say, “I’ll off-ramp some and throw the rest in a stablecoin farm or lend them out or use them for airdrop farming until I find the next opportunity.” I say, “Stablecoin farms pay 10 - 15% at most and money markets pay less than 5%. These meager rates don’t justify the smart contract risk. Airdrop farming is a hit-and-miss, but with even higher (smart contract and rug) risks. What if I told you you could do psudo-stablecoin farming with concentrated LP positions to easily earn 50-300% APR with limited price risk?” You see, the crypto market stays flat or trends down the vast majority of the time, and only pumps super hard for maybe 5-10 weeks of the year. Liquidity providers eat well during ranging markets. In addition, LP is an excellent tool for acquiring high quality assets when price tanks. So always allocate some capital for LP, even when you have strong conviction in some coins and believe there is tremendous upside-just allocate a bigger % to spot-holding and a small % to LP.
Don’t try to beat IL.
People say your goal as a liquidity provider is to beat impermanent loss with swap fees and token incentives. That’s too lofty. It’s difficult to beat IL! That’s because when price ranges, especially in a depressed environment, trading volume is usually low, which leads to lackluster swap fees and hence low yield. High yield usually occurs when price pumps hard, but price often has big jumps during a few days, so LPs don’t get to eat the juicy yield for long before price goes out of range, resulting in some humongous IL.
It’s unfortunate that people only use IL for LP but not for trading, when in fact, every time the price reaches a new high and you don’t sell before it comes back down, you also experience another kind of IL3. People are scared of LP because of IL, not realizing that they get it worse in trading where they often don’t even get to experience the “impermanent” phase. How many times after selling your bag, price mooned another 20% or doubled or tripled? How many times have you lamented, “had I held on…”?
Your goal as an LP is NOT to beat IL, at least not for any one position4. In fact, you will almost surely experience IL as price climbs up. When price goes above your price range, let go of the volatile coin and close the position. There’s no perfect profit-taking, so take profit early and take profit often. Do not let IL distract you from taking profit, for if you do, you can get ruined.
The LUNA-UST Debacle
LUNA (Terra Luna Classic) and UST (Terra Classic USD) are worthless now. But they
had their glorious days. LUNA was wildly considered a blue-chip asset that would
hit $1000 by the end of 2022, and UST was the algorithmic stablecoin DeFi needed
for its decentralization promise. At the peak, UST had a market cap of 18.7
billion US dollars5 and LUNA reached $120. I was one of the suckers that
hoarded LUNA and refused to take profit. Price kept going up, community was strong,
and there were many opportunities to earn a good yield on LUNA and UST. For
example, V2 pools6 of LUNA-UST on Terraswap and Astroport yielded more than
20% APR all the time and sometimes as high as 150%. I LP’d LUNA and UST to these
pools whenever the yield was attractive. The screen below shows some of my record.
Let’s go through the top chunk:
- January 29, 2022: I opened a position with 11.73 LUNA (50%) and 616.95 UST (50%) when LUNA was at $52.59.
- February 4, 2022: I added 20.22 LUNA and 1039.10 UST at $51.38.
- February 8, 2022: I added 4.81 LUNA and 284.70 UST at $59.22.
- February 15, 2022: I removed 2.45 LUNA and 138.11 UST at $56.27.
- March 9, 2022: Luna price jumped to $92.81. I added 1.98 LUNA and 183.67 UST.
- March 15, 2022: I pulled 100% liquidity when LUNA price was at $93.05 and got back 29.12 LUNA and 2709.20 UST.
The net result was that I sold 7.17 LUNA at $100.82, accounting for swap fees.
In the second and third chunk, I net bought 1.91 and 1.96 LUNA at $71.46 and $58.01 respectively. Notice that the pools sold LUNA for UST when LUNA price went up and bought LUNA with UST when price went down. This means we can use liquidity pools to DCA out of or into a coin, while earning a yield. But I believed LUNA would hit at least $200, so when price jumped from $50 to $93, I pulled liquidity to avoid losing more of my “precious” LUNA and used the UST portion to buy more LUNA to put up as collateral to borrow more UST to buy more LUNA. Four months later, UST depegged and LUNA went to zero and I lost it all. In hindsight, even if I took profit, I would’ve taken profit in UST and faced the same result. The lesson here is to take profit often and into good coins.
Many people, including myself, are bad at selling because we want to sell at the top. LP is a good tool to overcome this obsession and lock in a positive PnL.
DCA out of ZRO via ZRO-ETH LP
At 14:59 UTC on 22 June 2024, I sent 246 ZRO, part of my LayerZero airdrop, to the 0.3% fee ZRO-ETH pool on Arbitrum. I wanted to sell them and earn a yield at the same time. Airdrop tokens, by and large, dump very hard upon Token Generation Events (TGE) and never recover. Luckily, ZRO was different. Its price (in ETH) actually ranged for 3 months after TGE and trended up.
Because I set a wide range, my LP position passively earned 25.3687 ZRO and
0.0319 ETH in fees over 81.3 days. The fees (less gas) were worth $166.93 when
I closed the position, which was composed of 0.2822 ETH (worth $659.88) and 0
ZRO. The 246 ZRO tokens were worth $772.69 at position open. So pCGL was
-$112.81 and I made $54.11 (-$112.81 + $166.93). Fast-forward to the present,
at the time of writing, the fees (less gas) are worth $189.83 and pCGL is
-$22.43 and their sum is $167.39.
Had I sold the 246 ZRO on on 22 June 2024, I would’ve only gotten 0.2205 ETH or $772.69. The LP position got me 0.2822 ETH plus 25.3687 ZRO and 0.0319 ETH in fees, which in total was worth $826.81 on closing day and $940.08 today.
What about impermanent loss? Well, IL was -$235.85 at closing time, bigger than fees earned ($166.93); under current prices, IL is -$268.51, still bigger than fees earned ($189.83). Had I held on to the 246 ZRO tokens, I would’ve made $70 or $80 more. Do I regret it? Absolutely not.
Summary
Every time the price goes above your cost basis, market is giving you an opportunity to take profit. Ignore it at your own peril. If you try to catch the top, you will almost surely7 get ruined. At any moment, price may dump and it may dump hard, and when it does, loss aversion will hold you hostage, making you reluctant to sell.
The sensible approach is to take some chips off the table as price goes up and stack some as price comes down. LP does that automatically and generates a yield at the same time. So the next time you want to sell a coin, consider a one-sided LP position from the bottom. If you want to accumulate a coin, enter a one-sided LP position with stables from the top. We will discuss strategies involving one-sided positions later in the book, but before we get there, I need to show you several more metrics and give you a Google sheet to track things. See you in the next chapter.
Volatile coins have prices not pegged to fiat currencies. Most cryptocurrencies are volatile coins. Examples include BTC, ETH, and SOL.↩︎
Stablecoins are fiat-pegged. Examples include USDT, USDC, and USDS.↩︎
Had you sold at the recent top, you would’ve made more money than holding. This loss will be erased if the price reaches a new high in the future, so it’s impermanent.↩︎
It’s possible and often not hard to beat IL in a sequence of positions. I’ll describe such a strategy in a later chapter.↩︎
Once upon a time, UST was the largest decentralized stablecoin and the third largest among all stablecoins. Quiz: what’s the largest decentralized stablecoin now?↩︎
V2 pools require 50-50 balanced entry, i.e., 50% in coin 1 and 50% in coin 2. V3 pools allow any split, for example, 0-100, 20-80, 25.8-74.2, 40-60, 50-50, 60-40, 74.2-25.8, 80-20, or 100-0.↩︎
Definition of “almost surely”: https://en.wikipedia.org/wiki/Almost_surely.↩︎