# What color does Uniswap bleed?

I started writing a paper on the Uniswap protocol, and in particularly how it imposes a *bleed* on its liquidity providers, akin to the bleed option traders with negative Gamma experience. The full paper is here but below is the non-technical summary and conclusion.

In this paper we have looked at the Uniswap protocol which is an automated market making protocol currently implemented on the Ethereum blockchain. This protocol is based on so-called *“liquidity pools”* which are smart contracts containing two different tokens, and who are willing to trade with everyone who comes along according to a pre-determined formula.

This formula is based on the invariant *x*y=k* where *x,y* are the respective token amounts (in their own native units) of the tokens *X,Y* held in the contract, and *k* is a constant. The key property of the Uniswap contract is that the invariant function is its *indifference function* as well - the contract will engage into any trades *X* vs *Y* that respect the invariant (for the avoidance of doubt this ignores fees the contract might charge).

The first result we found that in presence of a deep and liquid market that is exchanging *X* vs *Y* at a price *p* arbitrageurs will make sure that the monetary value of the *X* tokens in the contract equals the monetary value of the *Y* tokens as for any other pool composition the price the pool offers allows an arbitrage opportunity. We did not prove this, but the arbitrage result is a generic result that holds for many different invariant functions (not all lead to equal monetary value howoever. In fact, our hypothesis is that every function that is (a) strictly decreasing, and (b) has the x and y axis’ as asymptotics is valid as invariant.

The second result we found was that a pool that is currently arbitraged at a price *p0* will offer to trade at a price *sqrt(p0 p1)* if the market price moves to *p1*. Note that this is an arbitrage opportunity for others as they can trade in the market at the price *p1*. This arbitrage opportunity is by design as it ensures that the pool will be in its correct state after each move. Coming back to our hypothesis, the result with the *geometric average* is not generic. However, in the generic case the price offered by the pool will be an average of *p0* and *p1* and the arbitrage persists.

We then made a key observation that is generally overlooked in the discussion about the benefits of contributing ones assets to a Uniswap pool. It is important to separate the gains and losses from the underlying position from the benefits of the arbitrage strategy. To take a step back: if someone is providing liquidity to a Uniswap pool they are forcibly long the two pool assets and therefore are exposed to the volatility in the value of those assets. In order to understand the benefits of contributing to a pool we need to strip out the effect of that long position and need to look at the pool effect only.

In order to do this adjustment we assume that the liquidity provider run an equivalent short strategy outside the pool. More precisely, they start out with a short position of equal monetary size at the current price *p0* and after every market movement they adjust their position to be again at equal monetary size *at the then prevailing price p1*. This last sentence in italics is key: to maintain their market neutral position they execute the trades on the short side at the then prevailing market price *p1*; however, the pool trades with the market at a price that is an average of *p0*, *p1* which is by construction and design more favourable than *p1*.

**The above means that at every finite adjustment that fully hedged strategy suffers a value bleed.** This is a well known phenomenon in finance, and specifically option pricing theory, which is known as *“negative Gamma”* where the position bleeds value at every adjustment of the hedge.

We found that the value bleed is quadratic in $dp$, meaning that a twice bigger move leads to four times the bleed. This is important as it exaggerates the impact of big moves, and it diminishes the impact of small moves. On the face of it this suggest that whilst it exists for finite moves we can make the bleed arbitrarily small by changing the adjustment frequency (and we argued that in a competitive markets arbitrageurs would not be able to collude and wait until the moves are bigger to reap more value).

We looked at this proposition that the bleed disappears as long as the position is adjusted frequently enough for three distinct cases: a smooth random process, a Brownian motion, and a jump process. We found that our intuition held only in the case of the smooth random process, which unfortunately is not a realistic description of market dynamics.

In case of a **Brownian motion** market dynamics (the same that is being used in the Black Scholes option pricing universe) we found that the bleed of the Uniswap pool is proportional to *sigma^2 T* where *sigma* is the volatility of returns, and *T* is the accrual period. We also found that in case of the Brownian motion that bleed is deterministic, just like the bleed on a constant-Gamma position in a Black Scholes world is deterministic.

We also looked at the **jump process** market dynamics, which in some respect is the opposite of a Brownian dynamics: for the Brownian motion the main uncertainty is very small movements over a very short timescale, but over a longer scale the uncertainty is contained. For the jump process on the other hand the uncertainty is restricted to specific moments in time – most of the time the process is smooth and nothing happens. However, when things are happening they are violent. At best there is a finite discontinuity in the process, but nothing prevents the jumps from being extremely violent and *fat tailed*. We found that if the jump distribution has infinite variance (as is usually the case for fat tailed distributions) then the expected bleed is infinite.

As we said above, the difference between a jump distribution and a Brownian motion is that in the former the bleed is stochastic. This means that for a certain period of time we can expect to see non-catastrophic jumps that, within measurement boundaries, can be interpreted of being as the benign *finite-variance* type. However, at one point we can expect a massive jump (and/or a series thereof) that completely wipes out the value to the liquidity providers.

#### Conclusion

We have shown that by design Uniswap liquidity providers suffer a bleed whenever the pool is adjusted after market movements. This bleed is a necessary component for Uniswap to function as it attracts the arbitrage traders who ultimately keep the pool up to date. For most liquidity providers this bleed is hidden within the volatility of their systemic long position. However, when looking at it on a market neutral basis with all the token risk hedged out the bleed is a net cost to the liquidity providers.

A priori this does not have to be a problem: this bleed is very similar to that suffered by option traders, and for which the option premium is the compensation. Just like in the option trading case it is important that the bleed is covered by the market making fees.

This however leads to a number of important conclusions.

Firstly, market making fees are not all

*profit*as they need to be adjusted for bleed.Secondly, as the bleed is proportional to the square of the volatility of the price process $\sigma^2$, a change in that volatility will lead to a change in profitability for the market makers unless the fees are adjusted dynamically

Finally, in the presence of fat-tailed jumps, notably jumps with infinite variance, there is no level of market making fee that can compensate, and liquidity providers will ultimately face ruin.

## References

- https://theshortstory-podcast.com/2020/08/what-color-does-uniswap-bleed/202008-LOESCH-What-color-does-Uniswap-bleed.pdf
- https://ethresear.ch/t/improving-front-running-resistance-of-x-y-k-market-makers/1281
- https://hackmd.io/@HaydenAdams/HJ9jLsfTz#🦄-Uniswap-Whitepaper