Oscar D Þorson 🇺🇦🇮🇱 Profile picture
Oct 1, 2021 31 tweets 8 min read Read on X
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

Mar 20, 2023
So after the short commute related interruption let’s get to the meat of the story: how come you can write down AT1 without writing down equity and what does it have to do with the GFC
the pre-history of hybrid capital, its relation to Basel, and the issues of T2 capital experienced in the GFC are here
So the T2 issue was they it did not work without letting the institutions default; people were thinking of scrapping T2 altogether but this would have either meant lowering capital requirements or raising even more massive amounts of equity, none of which sounded nice
Read 32 tweets
Mar 20, 2023
A brief history of Cocos and other AT1 instruments — and how come you can write them down when there is still equity left?
the short answer first: the pecking order most people are thinking of establishes the GONE concern (bankruptcy) waterfall; we are talking about GOING concern events here so they don’t have to be the same
Tier 1 and Tier 2 capital instruments were established under Basel 1 when many banks had to shore up their capital position dramatically. The infamous 8pc was actually 4pc Tier 1 and 4pc Tier 2
Read 13 tweets
Dec 19, 2022
Why AMM Gamma is different from derivatives Gamma

medium.com/@odtorson/why-…
In this article I am looking at the difference in Gamma bleed (or Gamma income) from AMMs and from Black-Scholes-Merton style hedging
As a reminder: when hedging an option, the hedge portfolio is linear (cash+risk asset) and therefore matches the level and slope of the payoff profile; the residual is therefore quadratic

Here we hedge around x=1
Read 12 tweets
Dec 17, 2022
Here a meta-thread, pulling all the AMM Triangle threads together Image
1/ The original thread, introducing the AMM Triangle
2/ The relationship between the AMM Triangle, IL, and LVR
Read 6 tweets
Dec 17, 2022
What we all got wrong about calculating Impermanent Loss

link.medium.com/SWtnmtlzPvb
Essentially, the current definition of IL is this one, and it is impermanent in the sense that it vanishes at xi=1, ie when prices return to their initial value Image
The key operational points are here
1. the AMM portfolio is alway 50/50 in each token
2. the AMM portfolio value is sqrt(xi)

Note that (1) is equivalent to (2) -- (1) is the delta hedging "replicating portfolio" of the square root profile (2) Image
Read 7 tweets
Dec 13, 2022
I wrote a little note on liquidity providers, options and AMMs, following up on today's discussion with @guil_lambert and @MBRichardson87

medium.com/@odtorson/liqu…
It has no real conclusion yet, but I wanted to introduce that AMM Triangle which I feel can become important to understand how to replicate options with AMMs
TLDR:
- liquidity provider: long fees, short options (aka IL)
- arbitrageur: short fees, long Gamma
- option trader: long option, short Gamma
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

Don't want to be a Premium member but still want to support us?

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

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(