Liquidity Mining: How Deep is Deep Enough?

Atis E
10 min readAug 14, 2024

--

Liquidity mining (LM) has been a staple feature of DeFi since the summer of 2020. However, since the DeFi summer, we have become much better at predicting and measuring the costs of providing liquidity in AMMs. This article looks at LM campaigns from this liquidity cost perspective, and uses sustainability of liquidity after the end of a campaign as a key metric. Under this perspective, it becomes possible to arrive at concrete numerical estimates of the expected revenue and PnL depending on the liquidity depth, and optimize LM campaigns for sustainable and competitive depth levels.

The code behind this article is available on GitHub.

A tale of a town and a pool

One time, the residents of the town of Allegoria decided to build a swimming pool. There were some swimming pools around, but the townsfolk wanted to have their own, and they had the means to pay the builders. Once the decision was made, a debate broke out in the town hall about the details. Some said that the pool should be made mostly for the local kids, who would be fine with splashing around in shallow water. Others argued for building a deeper pool where adults could relax and sportsmen could train.

The treasurer reminded everyone that deeper pools are not only more expensive to build, but heating and refreshing the increased amounts of water would also cost proportionally more. The people rebutted that adult swimmers had more money to pay than children, so their entry ticket prices could be larger. Someone raised the point that there were some experienced trampoline divers in the town, who were currently driving elsewhere to train. Surely these people would be happy to pay a lot if the pool were deep enough for their dives? As the fantasies of the bright future ran wild, people argued for increasingly ambitious plans. Perhaps the town should build the deepest pool in the continental region, so that it would become a curiosity that would attract tourists from afar, ready to pay a fortune for a visit?

The arguing went on. Finally, the people decided to visit the local wise old man for advice. (Since these are modern times, the local wise old man was, in reality, a personalized LLM, running in the town hall’s basement.)

It listened to the problem and finally said: “It seems to me that for each depth of the pool, you can predict the numbers of different customers and the revenue from these customers. No doubt, you can similarly predict the heating and water exchange costs for each liter of water in the pool. Yet, at some level of depth, you will run out of additional customers, while you will never run out of costs for each extra liter of water. There is always a point where the pool begins to incur losses. There is little benefit in building a deeper pool than that, and then only filling it halfway to save on the costs. But let me ask you this: does the town intend to rely on the income from entry tickets to the pool?”

The people discussed among themselves and clarified that no, while that would be nice, the main hope was that the presence of the pool itself would bring more visitors and shops to the town, rather than be a source of income directly. The goal would be to sell as many pool entrance tickets as possible, while remaining financially responsible.

“Then you should also not dig the pool shallower than the level at which it is sustainable. For, at this level, the costs of maintaining the pool would be equal to what the customers are willing to pay, and neither the town nor the utility companies would get any additional surplus, but the number of customers would be maximized.”

Experimental results

1. Price impact model

First, let’s analyze how much of the target market can be captured at each level of liquidity depth.

Let’s consider an xy=k AMM. In this AMM, the price impact I of a swap with size S is approximated by the formula I ~= S / (L sqrt(P)), where L is the liquidity and P is the price.

If we fix the maximum permitted price impact I, we can predict the minimum required L to support swap size S, or the maximum swap size S at a given level of liquidity.

How to interpret what the fixed price impact I actually means in this model? It’s something like “if a customer sees that the expected price impact is more than some %, they either skip the trade completely; look for another DEX on which to swap; or do something else to obtain the desired tokens — for instance, bridge them from another chain.”

In reality, a single large DEX trade can always be divided in a number of smaller ones, split out across time, with reduced price impact. However, it introduces significant friction for DEX users, and is unlikely to happen in practice until the DEX UX makes it much more seamless.

If we fix the maximum permitted price impact, liquidity depth is proportional to the maximum swap size.

Let’s further assume that the swap amounts of the prospective DEX users are determined by the log-normal distribution — few tiny swaps, few huge swaps, with the majority in the range from $10 to $1000, biased towards the smaller sizes. Under this distribution, the proportion of transactions that are rejected due to excessive price impact is shown in the figure below.

Deeper liquidity means that fewer transaction as rejected.

The number of rejected transactions can be quite small: at liquidity depth of $1M, it’s just a few percent for I≤0.01%. However, the rejected transactions are the largest ones. Hence, their impact to the swap volume is quite significant; in fact, around half of all swap volume is rejected at L=$1M and I≤0.01%.

2. Revenue and income model in a single-pool setup

The cost of keeping liquidity in an AMM pool is determined by a number of variables, including:

  • volatility of the asset
  • pool’s fee tier
  • gas cost for a swap
  • chain’s block time
  • pool’s bonding curve

However, assuming all of the above is fixed, the cost is directly proportional to the time in the pool and the depth of liquidity, as shown below:

LP cost is directly proportional to the depth of the liquidity. Arbitrage-only transactions simulated to quantify the costs on their own; “noise” trading not present.

The costs from providing liquidity in an AMM setup is typically described either by the impermanent loss model or loss-versus-rebalancing (LVR) model. In the end, the selected model should not matter if we’re talking about predicting the LP performance. Under the assumption that the price process is a martingale (so not for e.g. stablecoins or pegged asset pairs) all models should yield the same results. (To sketch an argument why: IL estimates the costs for unhedged LPs, while LVR estimates the costs for fully hedged LPs. If the price process is a martingale, no trading strategy can generate positive expected returns on average after accounting for costs. Consequently, hedging cannot be a strategy that generates positive returns over not hedging. It follows that EV[LVR] = EV[IL]. Of course, hedging can still reduce the variance and risk.)

Please note that using the LVR model does not require one to commit to all the interpretations made by LVR proponents. It can simply be used as a more convenient for AMM costs, especially for predictive purposes, than the IL model, since the latter has more complex formulas and derivations, especially for the expected fee income from arbitrage.

The costs can either be predicted using formulas (e.g. from the LVR papers) or via price path simulations. This work uses the latter for two reasons:

  • the LVR formulas published at the moment still do not incorporate swap gas costs, which we believe to be a key factor in LP profitability;
  • the formulas approximating LVR-with-swap-fees are accurate only in a subset of the parameter space.

In our cost model, an AMM pool is sustainable if its income from “noise” trading fees is equal to or greater than this cost. However, looking at just the revenue of the AMM does not give a complete picture of that. For instance, the figure below shows a sustainable pool, but with relatively small revenue. However, it has a healthy distribution of the fees, where the “noise” trading fees dominate:

LP revenue at L=$1M

In contrast, the pool below has 10 times deeper liquidity. The revenue is both much higher and much less healthy, as the demand from “noise” traders has approached its limits and failed to rise with the additional depth of the pool:

LP revenue at L=$10M

When both arbitrage and “noise” trading transactions are taken into account for PnL simulations, the following result emerges:

The pool remains sustainable until approximately L=$6M, after which it sharply enters loss territory.

The results confirm the common experience of DeFi users: even in a blue ocean environment there is a critical liquidity depth. Going beyond this point means that liquidity provisioning becomes loss-making, unless subsidized. In our simulations, this depth is approximately $6M.

Does this mean that LM campaigns should never try to reach liquidity depth beyond this point? Not at all. LM campaign managers can, for instance:

  1. Speculate that the additional depth will bring in additional users to the ecosystem, bringing additional organic demand with them, creating a sort of flywheel effect.
  2. Try to push the liquidity supply high enough to pre-empt any competing DEXes from even thinking about taking away the market share.

However, LM managers should always keep the cost models in mind. In particular, if the goal is to generate a flywheel effect, a successful LM campaign should lead to directly measurable increase in organic demand. Real-time monitoring of such a campaign and dynamically adjusting the incentives based on the observed results seem to be a good idea.

3. Revenue and income model in a competitive setup

In reality, it’s far more typical to have blockchain ecosystems that have at least two AMM pools for the major asset pairs.

Under such a condition, we know that the larger pool is likely to attract most of the volume, but by a factor of how much? Turns out the attractiveness of the larger directly depends on the gas costs on the chain. If the gas cost for a swap is zero, every larger swap can be separated in two smaller ones, so that a portion of the larger swap goes through the smaller pool. (The portion can be zero-sized one, depending on the initial price in both pools.) If the cost is large, it only makes sense to do that for large swaps.

Let’s say that there is another pool of the same type in the ecosystem, with liquidity of $2M. This pool takes care of some part of the real demand in the ecosystem, but not all of it. As found out in the previous section, the maximum liquidity depth our ecosystem can support is approximately $6M.

The cost of competition is especially high for smaller pools, which have a more limited market share. The $1M pool below now has much less healthy revenue distribution, while the (already unprofitable) $10M pool is scarcely affected.

LP revenue at L=$1M, competitive environment.
LP revenue at L=$10M, competitive environment.

This is because the market share of “our” pool looks like a sigmoid when plotted on a graph with log-scale x axis. 50% share is achieved at L=$2M, i.e. liquidity dept that matches the other pool.

Market share of “our” pool in a competitive environment

However, the PnL metric shows that going to $5M or beyond is not profitable anymore. The zero-crossing point is now at approximately $3M, which gives a market share of slightly more than 50%.

LP PnL in a competitive environment are much reduced compared with a single-pool market.

There are two ways how to think about this from the LM perspective. One would be to follow the previous approach, and encourage liquidity depth until the critical point, but not more than that. The other would be to temporarily push the liquidity depth significantly beyond that via LM incentives, with the hope of dominating the DEX market share, and making the other pool even more unprofitable, so that LPs are forced to leave it.

Finally, what does it all look from the LP perspective? APR remains the most widely used LP metric to this day. When the APRs from swap fees are plotted, the following picture emerges:

Pool APR as seen by LPs

It’s clear that the APR metric fails to tell the full story, especially for the competitive environment. For instance, providing $20M of liquidity in “our” pool is going to generate dramatic losses (in absolute $ amounts), both for the LPs both in “our” pool and the other pool (with L=$2M). However, this fact is almost invisible in the APR graph.

Conclusion

To sum up:

  • There is a critical maximum liquidity depth that can be supported by the natural demand of an on-chain ecosystem.
  • This maximum profitable depth depends on both the cost of provisioning liquidity and the demand for it.
  • The cost can be quantified using models that have been developed and verified in the recent years.
  • Pushing the liquidity depth beyond the maximum sustainable depth via an LM campaign can still be a viable / good option, but requires some exogenous justification.
  • If the goal of a LM campaign is to generate a flywheel effect, the predicted increase of organic demand can and should be monitored during the campaign, to re-quantify the costs and benefits.
  • From both ecosystem’s and LP perspectives, neither LP revenue nor APRs are sufficient as target metrics for an LM campaign. Campaign and post-campaign analyses should either include order flow classification, or look at other LP metrics like markouts that capture the true cost of providing liquidity in a permissionless, decentralized environment.

--

--