I am working on paper on Impermanent Loss, and I want to put a few thoughts out here to get them sorted before the paper proper is published
quick reminder: Impermanent Loss is what happens to you when you provide liquidity in an AMM, and it usually is everything but impermanent
IL is generated because an AMM sells the outperforming asset and buys the underperforming asset, so you miss out on the moon shots, but you are fully invested all the way down...
if you think this looks like a positive Gamma buy-low-sell-high strategy, you are absolutely right; except you aren't because AMMs only keep the IL, but a convexity gains are handed over to arbitrageurs.

I've written about it here drive.google.com/file/d/1en044m…
(which in turn shows why the "Impermanent" moniker is such a mixed bag: if MOONTKN goes 50x your AMM only goes 10x. That's your IL. It is permanent unless MOONTKN comes crashing down again
our traditional AMM works using a bonding curve. the traditional bonding curve is k=x*y where k is a konstant, and x,y are the token amounts in their native units; an AMM is happy to trade anywhere on this bonding curve
(pro-tip: if f(x,y) = const than g(f(x,y)) = const as well; if you can choose an f such that f(lam x, lam y) = lam f(x,y); you'll thank me later).

In other words: we nowadays use k=sqrt(x*y)
for the k=sqrt(x*y) traditional AMM we find the following IL curve (in a complete abuse of notation now x is the price ratio between the two assets)
this IL function looks asymmetric, but this is a pathology introduced by a choice of numeraire; on the right hand side your risk asset moons, on the left hand side your numeraire asset moons; but as you measure in the numeraire asset you don't see it
now Impermanent Loss sucks, so what can you do about it? Stay tuned, will continue later...
alright, so let’s talk about curves; that’s our standard k=x*y curve; it hugs the x and y axis so it can cover the entire price space, but at the cost of slippage and IL (more on both below)
that on the other hand is the k=x+y curve; it is special in that if offers up its entire liquidity at a fixed price, until it runs out at either end
the red curve here is the same constant exchange ratio curve _except_ that is has two stops: it does not deplete the entire pool, but it stops trading when the curve goes vertical or horizontal
the blue curve is essentially the Curve curve, for trading stable coins: very flat in the middle, so a lot of apparent liquidity over a relatively small range of prices, and then it stops
and now what y’all have been waiting for - the Uniswap v3 curve: v2 in the sheets, Curve in the streets

In other words: where it hugs the green curve it is just k=x*y; where it goes off it stops trading
in fact, the real Uniswap v3 curve is this one: it is the same curve, but the coordinate system has been shifted to the red one by removing all the tokens that can never be traded out of the pool
and if this reminds you something, you are right — it is almost like this Curve-style pool from the beginning that would move 100% from one side to the other, except there is some curvature so the price is not fully flat
(maybe I should have mentioned that the slope of the curve is the exchange ratio of x and y, ie the price)
alright, moving on. let’s look again at the IL for reference and stick some numbers to it. Note that exchange ratios are now normalised to 100 initially, and the y axis is IN PERCENT
what we see here is that IL is relatively benign for narrow ranges - it is below 2% for 65-140 and even smaller for 80-120 or 90-110
We now put this together with our Uniswap v3 restricted curve from earlier on. In this picture the range is about 60-140 so maximum IL is 2pc. Right? Radio Yerewan answers: in principle, yes. But…
The “but” here is that the 2pc are on the unlevered AMM that started with $100 of each of the assets, but we removed all the assets that can never leave the AMM. As a percentage of the smaller amount the percentage IL is significantly higher.
I am still working on presenting this more nicely for the paper; suffice to say that the numbers can be higher for narrow ranges.

So this is point 1. Whilst IL in narrow ranges is small, so is the liquidity required. Once leverage is taken into account number goes up.
In the paper we look at a number of positions. From memory- I don’t have my computer- it’s a 20pc range that started out of the money and went through to the other side.

For a 90-110 range the unlevered IL is only about 0.2%; however, because of leverage it becomes 5%
So in the paper we are looking in much more detail at the various scenarios. It actually becomes surprisingly complex — especially dealing with positions that have multiple additions and/or withdrawals is …. hard
A related issue is what you should do about positions that are out of the money. Reminder: when you move through the money you always get exchanged into the asset that is falling!
So let’s consider a levered stable-to-stable pool. There are mostly two scenarios. (1) the coins are range trading, and 90-110 seems very generous for two USD coins. (2) one of the coins is collapsing (algo coin; audit issue; the works)
So 90/110 protects you against losses, right? Well…

Firstly IL is measured against HODL. In an unlevered AMM that stops trading at 90 HOLD still loses 50pc and so do you. What the 90 limit does is preventing you from buying into a falling asset. Little IL, big loss.
Secondly on the levered AMM you are already 100pc in the collapsing asset at 90. So yeah — you don’t buy more of if, but you don’t have to. So is one side is collapsing you still lose everything.
that was a bit of a tangent but shows how complex IL can become in a levered AMM world. you started out with $100 and end up with zero. $50 are HODL losses, $45 are directional losses, and only $5 is IL.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Oscar D Þorson

Oscar D Þorson Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @odtorson

2 Oct
Continuing from yesterday’s thread on Impermanent Loss, and in particular IL for leveraged AMMs

as a recap, the Uniswap v3 style levered AMM is using the regular k=x*y curve, but it restricts it to a particular range Image
restricting it to a specific range a priori significantly reduces IL, eg to about 2pc for a 60…140 range.

However, this effect is undone by removing collateral that can’t be traded out of the AMM and IL is percentage of levered liquidity is high.
Read 12 tweets
30 Sep
Alright, how wants some fun analysis on Santander bikes? Image
@TfL has a great API and I have been polling it for almost two weeks now to get the detailed status.

Firstly, there are almost 21,000 docks but only 8,000 bikes, so max dock occupation is 38% Image
What surprised me that peak usage of the bikes is actually not that massive. Even at the lowest level of availability there were only 2,000 of the 8,000 bikes in use Image
Read 24 tweets
30 Sep
that’s an interesting ask — allow us to bring staff over for up to 6 months a year without requiring a visa. sensible at first sight, but….
in the new age of Zoom working, 6 months a year is essentially local staff. the obvious benefit here is nearshoring: employ staff in low cost locations but bring them over regularly
here I think the point is different though: keep your local coverage staff local to comply with regulations, and bring them over to London every other week to catch up with the wider team
Read 4 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(