Monday, March 11, 2024

LvR, Impermanent Loss, Theta, and Arbitrage Profits

arbprofit

Columbia professor Ciamac Moallemi, Uniswap's Adams, Reynolds, and Dan Robinson released a paper last week on recapturing some of the LP convexity costs by having the arbitrageurs bid for the right to trade at a reduced rate. I wanted to dive into that, but I thought it would be helpful to see how arbitrage profits relate to LP convexity costs, as this is not obvious. Further, people in this space use different terms and formulas for what I am calling the LP convexity costs, and it would be useful to clarify how they differ.

Ultimately, loss vs. rebalancing (LvR), impermanent loss (IL), convexity costs, and theta, represent the same thing. The estimation method for these metrics will use daily data generating random errors that become irrelevant due to the Law of Large Numbers. That is, resetting the IL benchmark each day is like hedging once a day or using daily data to estimate variance.

Impermanent Loss

The OG term for the peculiar LP cost in constant product AMMs is 'impermanent loss.' It was called that because while an LP could have a loss relative to their initial LP position, they would not lose money if the price moved back, implying that loss was not permanent. One could say that about any mark-to-market loss, but whatever, it's a commonly used term, and generally, people know what it means.

The basic idea was to compare the LP's current pool position with the original LP token deposit, though one can compare it to the prior tokens at any time in the past. I will use ETH and USDC as the tokens in my example, but the analysis generalizes to any tokens A and B, making it easier to intuit.

An LP position is necessarily adversely selected, losing ETH when the price rises gaining ETH when its price falls. It is this change in token quantities that drives the IL.

IL=Value(initial LP position at current price)Value(LP at current price) IL= US D 0 ET H 0 p 1 US D 1 +ET H 1 p 1 IL= US D 1 US D 0 p 1 ET H 1 ET H 0 MathType@MTEF@5@5@+= feaahCart1ev3aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGceaqabeaacaWGjb Gaamitaiabg2da9iaadAfacaWGHbGaamiBaiaadwhacaWGLbGaaiik aiaadMgacaWGUbGaamyAaiaadshacaWGPbGaamyyaiaadYgacaqGGa GaamitaiaadcfacaqGGaGaamiCaiaad+gacaWGZbGaamyAaiaadsha caWGPbGaam4Baiaad6gacaqGGaGaamyyaiaadshacaqGGaGaam4yai aadwhacaWGYbGaamOCaiaadwgacaWGUbGaamiDaiaabccacaWGWbGa amOCaiaadMgacaWGJbGaamyzaiaacMcacqGHsislcaWGwbGaamyyai aadYgacaWG1bGaamyzaiaacIcacaWGmbGaamiuaiaabccacaWGHbGa amiDaiaabccacaWGJbGaamyDaiaadkhacaWGYbGaamyzaiaad6gaca WG0bGaaeiiaiaadchacaWGYbGaamyAaiaadogacaWGLbGaaiykaaqa aiaadMeacaWGmbGaeyypa0ZaaiWaaeaacaWGvbGaam4uaiaadseada WgaaWcbaGaaGimaaqabaGccqGHsislcaWGfbGaamivaiaadIeadaWg aaWcbaGaaGimaaqabaGccqGHflY1caWGWbWaaSbaaSqaaiaaigdaae qaaaGccaGL7bGaayzFaaGaeyOeI0YaaiWaaeaacaWGvbGaam4uaiaa dseadaWgaaWcbaGaaGymaaqabaGccqGHRaWkcaWGfbGaamivaiaadI eadaWgaaWcbaGaaGymaaqabaGccqGHflY1caWGWbWaaSbaaSqaaiaa igdaaeqaaaGccaGL7bGaayzFaaaabaGaamysaiaadYeacqGH9aqpda GadaqaaiaadwfacaWGtbGaamiramaaBaaaleaacaaIXaaabeaakiab gkHiTiaadwfacaWGtbGaamiramaaBaaaleaacaaIWaaabeaaaOGaay 5Eaiaaw2haaiabgkHiTiaadchadaWgaaWcbaGaaGymaaqabaGcdaGa daqaaiaadweacaWGubGaamisamaaBaaaleaacaaIXaaabeaakiabgk HiTiaadweacaWGubGaamisamaaBaaaleaacaaIWaaabeaaaOGaay5E aiaaw2haaaaaaa@AF65@

This simplifies to a net token change valued at the ending price

Equation (1) - net LP token change: IL=ΔUSD+ p 1 ΔETH MathType@MTEF@5@5@+= feaahCart1ev3aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaamysaiaadY eacqGH9aqpcqqHuoarcaWGvbGaam4uaiaadseacqGHRaWkcaWGWbWa aSbaaSqaaiaaigdaaeqaaOGaeyyXICTaeuiLdqKaamyraiaadsfaca WGibaaaa@4564@

The AMM generates simple formulas for ΔETH and ΔUSD as a function of liquidity and price changes. Note these are the pool token changes, excluding fees.

ΔETH=liq 1 p 1 1 p 0 ΔUSD=liq p 1 p 0 MathType@MTEF@5@5@+= feaahCart1ev3aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGceaqabeaacqqHuo arcaWGfbGaamivaiaadIeacqGH9aqpcaWGSbGaamyAaiaadghacqGH flY1daqadaqaamaaliaabaGaaGymaaqaamaakaaabaGaamiCamaaBa aaleaacaaIXaaabeaaaeqaaaaakiabgkHiTmaaliaabaGaaGymaaqa amaakaaabaGaamiCamaaBaaaleaacaaIWaaabeaaaeqaaaaaaOGaay jkaiaawMcaaaqaaiabfs5aejaadwfacaWGtbGaamiraiabg2da9iaa dYgacaWGPbGaamyCaiabgwSixpaabmaabaWaaOaaaeaacaWGWbWaaS baaSqaaiaaigdaaeqaaaqabaGccqGHsisldaGcaaqaaiaadchadaWg aaWcbaGaaGimaaqabaaabeaaaOGaayjkaiaawMcaaaaaaa@585A@

Plugging this in and doing algebra, we get a square-root function that, multiplied by liquidity, generates the second metric for the LP's convexity cost:

IL=liq p 1 p 0 + p 1 liq 1 p 1 1 p 0 IL=liq p 1 p 0 + p 1 p 1 p 0 IL=liq 2 p 1 p 0 p 1 p 0 IL=liq 2 p 0 p 1 p 0 p 1 p 0 MathType@MTEF@5@5@+= feaahCart1ev3aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGceaqabeaacaWGjb Gaamitaiabg2da9iaadYgacaWGPbGaamyCaiabgwSixpaabmaabaWa aOaaaeaacaWGWbWaaSbaaSqaaiaaigdaaeqaaaqabaGccqGHsislda GcaaqaaiaadchadaWgaaWcbaGaaGimaaqabaaabeaaaOGaayjkaiaa wMcaaiabgUcaRiaadchadaWgaaWcbaGaaGymaaqabaGccqGHflY1ca WGSbGaamyAaiaadghacqGHflY1daqadaqaamaaliaabaGaaGymaaqa amaakaaabaGaamiCamaaBaaaleaacaaIXaaabeaaaeqaaaaakiabgk HiTmaaliaabaGaaGymaaqaamaakaaabaGaamiCamaaBaaaleaacaaI WaaabeaaaeqaaaaaaOGaayjkaiaawMcaaaqaaiaadMeacaWGmbGaey ypa0JaamiBaiaadMgacaWGXbGaeyyXIC9aaeWaaeaadaGcaaqaaiaa dchadaWgaaWcbaGaaGymaaqabaaabeaakiabgkHiTmaakaaabaGaam iCamaaBaaaleaacaaIWaaabeaaaeqaaOGaey4kaSYaaOaaaeaacaWG WbWaaSbaaSqaaiaaigdaaeqaaaqabaGccqGHsisldaWccaqaaiaadc hadaWgaaWcbaGaaGymaaqabaaakeaadaGcaaqaaiaadchadaWgaaWc baGaaGimaaqabaaabeaaaaaakiaawIcacaGLPaaaaeaacaWGjbGaam itaiabg2da9iaadYgacaWGPbGaamyCaiabgwSixpaabmaabaGaaGOm amaakaaabaGaamiCamaaBaaaleaacaaIXaaabeaaaeqaaOGaeyOeI0 YaaOaaaeaacaWGWbWaaSbaaSqaaiaaicdaaeqaaaqabaGccqGHsisl daWccaqaaiaadchadaWgaaWcbaGaaGymaaqabaaakeaadaGcaaqaai aadchadaWgaaWcbaGaaGimaaqabaaabeaaaaaakiaawIcacaGLPaaa aeaacaWGjbGaamitaiabg2da9iaadYgacaWGPbGaamyCaiabgwSixp aalaaabaWaaeWaaeaacaaIYaWaaOaaaeaacaWGWbWaaSbaaSqaaiaa icdaaeqaaOGaamiCamaaBaaaleaacaaIXaaabeaaaeqaaOGaeyOeI0 IaamiCamaaBaaaleaacaaIWaaabeaakiabgkHiTiaadchadaWgaaWc baGaaGymaaqabaaakiaawIcacaGLPaaaaeaadaGcaaqaaiaadchada WgaaWcbaGaaGimaaqabaaabeaaaaaaaaa@9566@

equation (2) - square of square roots: IL=liq p 1 p 0 2 p 0 MathType@MTEF@5@5@+= feaahCart1ev3aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaamysaiaadY eacqGH9aqpcqGHsislcaWGSbGaamyAaiaadghacqGHflY1daWcaaqa amaabmaabaWaaOaaaeaacaWGWbWaaSbaaSqaaiaaigdaaeqaaaqaba GccqGHsisldaGcaaqaaiaadchadaWgaaWcbaGaaGimaaqabaaabeaa aOGaayjkaiaawMcaamaaCaaaleqabaGaaGOmaaaaaOqaamaakaaaba GaamiCamaaBaaaleaacaaIWaaabeaaaeqaaaaaaaa@47F6@

Arbitrage Profit

As the LP's IL is based on net tokens coming in, someone took the opposite side; if the LPs net +1 ETH and 4000 USDC, traders net +1 ETH and 4000 USDC. As the LPs always lose money, the trader collective always makes money pre-fees.

The arbitrage profit is how much the arb is traded times the price changes.

ArbitragePnL=ΔETH p 1 fillPrice MathType@MTEF@5@5@+= feaahCart1ev3aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaamyqaiaadk hacaWGIbGaamyAaiaadshacaWGYbGaamyyaiaadEgacaWGLbGaamiu aiaad6gacaWGmbGaeyypa0JaeuiLdqKaamyraiaadsfacaWGibGaey yXIC9aaeWaaeaacaWGWbWaaSbaaSqaaiaaigdaaeqaaOGaeyOeI0Ia amOzaiaadMgacaWGSbGaamiBaiaadcfacaWGYbGaamyAaiaadogaca WGLbaacaGLOaGaayzkaaaaaa@5496@

We have the ΔETH function noted above, so we need the AMM fill price. This is the geometric mean of the starting and ending price.

fillPrice= ΔUSD ΔETH = liq p 1 p 0 liq 1 p 1 1 p 0 = p 1 p 0 p 1 p 0 p 1 p 0 1 p 1 1 p 0 fillPrice= p 1 + p 0 2 p 1 p 0 2 p 0 p 1 p 1 p 0 fillPrice= p 1 p 0 p 1 p 0 + p 0 p 1 2 2 p 0 p 1 p 1 p 0 fillPrice= p 1 p 0 MathType@MTEF@5@5@+= feaahCart1ev3aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGceaqabeaacaWGMb GaamyAaiaadYgacaWGSbGaamiuaiaadkhacaWGPbGaam4yaiaadwga cqGH9aqpdaWcaaqaaiabfs5aejaadwfacaWGtbGaamiraaqaaiabfs 5aejaadweacaWGubGaamisaaaacqGH9aqpdaWcaaqaaiaadYgacaWG PbGaamyCaiabgwSixpaabmaabaWaaOaaaeaacaWGWbWaaSbaaSqaai aaigdaaeqaaaqabaGccqGHsisldaGcaaqaaiaadchadaWgaaWcbaGa aGimaaqabaaabeaaaOGaayjkaiaawMcaaaqaaiaadYgacaWGPbGaam yCaiabgwSixpaabmaabaWaaSGaaeaacaaIXaaabaWaaOaaaeaacaWG WbWaaSbaaSqaaiaaigdaaeqaaaqabaaaaOGaeyOeI0YaaSGaaeaaca aIXaaabaWaaOaaaeaacaWGWbWaaSbaaSqaaiaaicdaaeqaaaqabaaa aaGccaGLOaGaayzkaaaaaiabg2da9maalaaabaWaaeWaaeaadaGcaa qaaiaadchadaWgaaWcbaGaaGymaaqabaaabeaakiabgkHiTmaakaaa baGaamiCamaaBaaaleaacaaIWaaabeaaaeqaaaGccaGLOaGaayzkaa aabaWaaeWaaeaadaGcaaqaaiaadchadaWgaaWcbaGaaGymaaqabaaa beaakiabgkHiTmaakaaabaGaamiCamaaBaaaleaacaaIWaaabeaaae qaaaGccaGLOaGaayzkaaaaaiabgwSixpaalaaabaWaaeWaaeaadaGc aaqaaiaadchadaWgaaWcbaGaaGymaaqabaaabeaakiabgkHiTmaaka aabaGaamiCamaaBaaaleaacaaIWaaabeaaaeqaaaGccaGLOaGaayzk aaaabaWaaeWaaeaadaWccaqaaiaaigdaaeaadaGcaaqaaiaadchada WgaaWcbaGaaGymaaqabaaabeaaaaGccqGHsisldaWccaqaaiaaigda aeaadaGcaaqaaiaadchadaWgaaWcbaGaaGimaaqabaaabeaaaaaaki aawIcacaGLPaaaaaaabaGaamOzaiaadMgacaWGSbGaamiBaiaadcfa caWGYbGaamyAaiaadogacaWGLbGaeyypa0ZaaSaaaeaacaWGWbWaaS baaSqaaiaaigdaaeqaaOGaey4kaSIaamiCamaaBaaaleaacaaIWaaa beaakiabgkHiTiaaikdadaGcaaqaaiaadchadaWgaaWcbaGaaGymaa qabaGccqGHflY1caWGWbWaaSbaaSqaaiaaicdaaeqaaaqabaaakeaa caaIYaGaeyOeI0YaaSGaaeaadaGcaaqaaiaadchadaWgaaWcbaGaaG imaaqabaaabeaaaOqaamaakaaabaGaamiCamaaBaaaleaacaaIXaaa beaaaeqaaaaakiabgkHiTmaaliaabaWaaOaaaeaacaWGWbWaaSbaaS qaaiaaigdaaeqaaaqabaaakeaadaGcaaqaaiaadchadaWgaaWcbaGa aGimaaqabaaabeaaaaaaaaGcbaGaamOzaiaadMgacaWGSbGaamiBai aadcfacaWGYbGaamyAaiaadogacaWGLbGaeyypa0ZaaSaaaeaadaGc aaqaaiaadchadaWgaaWcbaGaaGymaaqabaGccqGHflY1caWGWbWaaS baaSqaaiaaicdaaeqaaaqabaGccqGHflY1daqadaqaamaaliaabaWa aOaaaeaacaWGWbWaaSbaaSqaaiaaigdaaeqaaaqabaaakeaadaGcaa qaaiaadchadaWgaaWcbaGaaGimaaqabaaabeaaaaGccqGHRaWkdaWc caqaamaakaaabaGaamiCamaaBaaaleaacaaIWaaabeaaaeqaaaGcba WaaOaaaeaacaWGWbWaaSbaaSqaaiaaigdaaeqaaaqabaaaaOGaeyOe I0IaaGOmaaGaayjkaiaawMcaaaqaamaabmaabaGaaGOmaiabgkHiTm aaliaabaWaaOaaaeaacaWGWbWaaSbaaSqaaiaaicdaaeqaaaqabaaa keaadaGcaaqaaiaadchadaWgaaWcbaGaaGymaaqabaaabeaaaaGccq GHsisldaWccaqaamaakaaabaGaamiCamaaBaaaleaacaaIXaaabeaa aeqaaaGcbaWaaOaaaeaacaWGWbWaaSbaaSqaaiaaicdaaeqaaaqaba aaaaGccaGLOaGaayzkaaaaaaqaaiaadAgacaWGPbGaamiBaiaadYga caWGqbGaamOCaiaadMgacaWGJbGaamyzaiabg2da9maakaaabaGaam iCamaaBaaaleaacaaIXaaabeaakiabgwSixlaadchadaWgaaWcbaGa aGimaaqabaaabeaaaaaa@D914@

As the fill price is positive, I ignored the sign in the above algebra. Substituting the fill price and ETH delta formula into the original equation generates the negative of equation(2), the square root function above.

ArbitragePnL=liq 1 p 1 1 p 0 p 1 p 1 p 0 ArbitragePnL=liq p 1 p 1 p 0 p 0 + p 1 ArbitragePnL=liq 2 p 1 p 1 p 0 p 0 ArbitragePnL=liq 2 p 1 p 0 p 1 p 0 p 0 ArbitragePnL=liq p 1 p 0 2 p 0 MathType@MTEF@5@5@+= feaahCart1ev3aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGceaqabeaacaWGbb GaamOCaiaadkgacaWGPbGaamiDaiaadkhacaWGHbGaam4zaiaadwga caWGqbGaamOBaiaadYeacqGH9aqpcaWGSbGaamyAaiaadghacqGHfl Y1daqadaqaamaaliaabaGaaGymaaqaamaakaaabaGaamiCamaaBaaa leaacaaIXaaabeaaaeqaaaaakiabgkHiTmaaliaabaGaaGymaaqaam aakaaabaGaamiCamaaBaaaleaacaaIWaaabeaaaeqaaaaaaOGaayjk aiaawMcaaiabgwSixpaabmaabaGaamiCamaaBaaaleaacaaIXaaabe aakiabgkHiTmaakaaabaGaamiCamaaBaaaleaacaaIXaaabeaakiaa dchadaWgaaWcbaGaaGimaaqabaaabeaaaOGaayjkaiaawMcaaaqaai aadgeacaWGYbGaamOyaiaadMgacaWG0bGaamOCaiaadggacaWGNbGa amyzaiaadcfacaWGUbGaamitaiabg2da9iaadYgacaWGPbGaamyCai abgwSixpaabmaabaWaaOaaaeaacaWGWbWaaSbaaSqaaiaaigdaaeqa aaqabaGccqGHsisldaWccaqaaiaadchadaWgaaWcbaGaaGymaaqaba aakeaadaGcaaqaaiaadchadaWgaaWcbaGaaGimaaqabaaabeaaaaGc cqGHsisldaGcaaqaaiaadchadaWgaaWcbaGaaGimaaqabaaabeaaki abgUcaRmaakaaabaGaamiCamaaBaaaleaacaaIXaaabeaaaeqaaaGc caGLOaGaayzkaaaabaGaamyqaiaadkhacaWGIbGaamyAaiaadshaca WGYbGaamyyaiaadEgacaWGLbGaamiuaiaad6gacaWGmbGaeyypa0Ja amiBaiaadMgacaWGXbGaeyyXIC9aaeWaaeaacaaIYaWaaOaaaeaaca WGWbWaaSbaaSqaaiaaigdaaeqaaaqabaGccqGHsisldaWccaqaaiaa dchadaWgaaWcbaGaaGymaaqabaaakeaadaGcaaqaaiaadchadaWgaa WcbaGaaGimaaqabaaabeaaaaGccqGHsisldaGcaaqaaiaadchadaWg aaWcbaGaaGimaaqabaaabeaaaOGaayjkaiaawMcaaaqaaiaadgeaca WGYbGaamOyaiaadMgacaWG0bGaamOCaiaadggacaWGNbGaamyzaiaa dcfacaWGUbGaamitaiabg2da9iaadYgacaWGPbGaamyCaiabgwSixp aalaaabaWaaeWaaeaacaaIYaWaaOaaaeaacaWGWbWaaSbaaSqaaiaa igdaaeqaaOGaeyyXICTaamiCamaaBaaaleaacaaIWaaabeaaaeqaaO GaeyOeI0IaamiCamaaBaaaleaacaaIXaaabeaakiabgkHiTiaadcha daWgaaWcbaGaaGimaaqabaaakiaawIcacaGLPaaaaeaadaGcaaqaai aadchadaWgaaWcbaGaaGimaaqabaaabeaaaaaakeaacaWGbbGaamOC aiaadkgacaWGPbGaamiDaiaadkhacaWGHbGaam4zaiaadwgacaWGqb GaamOBaiaadYeacqGH9aqpcaWGSbGaamyAaiaadghacqGHflY1daWc aaqaamaabmaabaWaaOaaaeaacaWGWbWaaSbaaSqaaiaaigdaaeqaaa qabaGccqGHsisldaGcaaqaaiaadchadaWgaaWcbaGaaGimaaqabaaa beaaaOGaayjkaiaawMcaamaaCaaaleqabaGaaGOmaaaaaOqaamaaka aabaGaamiCamaaBaaaleaacaaIWaaabeaaaeqaaaaaaaaa@D0D5@

 

Remember this arbitrage pnl number excludes fees, which are an expense to the arbitrageur. Looking at a net price movement over an interval will also include incidentally lucky noise traders instead of true arbitrageurs. However, the critical point is that we can see the fundamental symmetry of arbitrage revenue and an LP's convexity expense.

Delta Hedged LP PnL

The LP's position has a delta, or price risk, that can be hedged. We can apply this hedge to any frequency we want, where the complexity of handling more data offsets the benefit of more frequent hedging. Removing the delta generates a much more efficient estimate of an LP's pnl.

The initial LP position is just {ETH, USDC}, so it is long whatever amount of ETH they deposited. The LP can just eyeball his ETH position to determine his hedge amount.

Position = USD0 + ETH0*p0

The delta for an LP position can be confirmed by doing the math:

dValu e LP p =delta=Δ= liq p =ET H LP MathType@MTEF@5@5@+= feaahCart1ev3aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaWaaSaaaeaaca WGKbGaamOvaiaadggacaWGSbGaamyDaiaadwgadaWgaaWcbaGaamit aiaadcfaaeqaaaGcbaGaeyOaIyRaamiCaaaacqGH9aqpcaWGKbGaam yzaiaadYgacaWG0bGaamyyaiabg2da9iabfs5aejabg2da9maalaaa baGaamiBaiaadMgacaWGXbaabaWaaOaaaeaacaWGWbaaleqaaaaaki abg2da9iaadweacaWGubGaamisamaaBaaaleaacaWGmbGaamiuaaqa baaaaa@521E@

If we look at the change in the hedged LP position over time and assume we are looking at the change in ETH and USD without fees, we see it goes back to eq(1), the value of the net token change:

netLP=LPposition+hedge netL P 0 = US D 0 +ET H 0 p 0 ET H 0 p 0 =US D 0 netL P 1 = US D 1 +ET H 1 p 1 ET H 0 p 1 pnl=L P 1 L P 0 = US D 1 +ET H 1 p 1 ET H 0 p 1 US D 0 pnl=ΔUSD+ p 1 ΔETH MathType@MTEF@5@5@+= feaahCart1ev3aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGceaqabeaacaWGUb GaamyzaiaadshacaWGmbGaamiuaiabg2da9iaadYeacaWGqbGaamiC aiaad+gacaWGZbGaamyAaiaadshacaWGPbGaam4Baiaad6gacqGHRa WkcaWGObGaamyzaiaadsgacaWGNbGaamyzaaqaaiaad6gacaWGLbGa amiDaiaadYeacaWGqbWaaSbaaSqaaiaaicdaaeqaaOGaeyypa0Zaai WaaeaacaWGvbGaam4uaiaadseadaWgaaWcbaGaaGimaaqabaGccqGH RaWkcaWGfbGaamivaiaadIeadaWgaaWcbaGaaGimaaqabaGccqGHfl Y1caWGWbWaaSbaaSqaaiaaicdaaeqaaaGccaGL7bGaayzFaaGaeyOe I0IaamyraiaadsfacaWGibWaaSbaaSqaaiaaicdaaeqaaOGaeyyXIC TaamiCamaaBaaaleaacaaIWaaabeaakiabg2da9iaadwfacaWGtbGa amiramaaBaaaleaacaaIWaaabeaaaOqaaiaad6gacaWGLbGaamiDai aadYeacaWGqbWaaSbaaSqaaiaaigdaaeqaaOGaeyypa0ZaaiWaaeaa caWGvbGaam4uaiaadseadaWgaaWcbaGaaGymaaqabaGccqGHRaWkca WGfbGaamivaiaadIeadaWgaaWcbaGaaGymaaqabaGccqGHflY1caWG WbWaaSbaaSqaaiaaigdaaeqaaaGccaGL7bGaayzFaaGaeyOeI0Iaam yraiaadsfacaWGibWaaSbaaSqaaiaaicdaaeqaaOGaeyyXICTaamiC amaaBaaaleaacaaIXaaabeaaaOqaaiaadchacaWGUbGaamiBaiabg2 da9iaadYeacaWGqbWaaSbaaSqaaiaaigdaaeqaaOGaeyOeI0Iaamit aiaadcfadaWgaaWcbaGaaGimaaqabaGccqGH9aqpdaGadaqaaiaadw facaWGtbGaamiramaaBaaaleaacaaIXaaabeaakiabgUcaRiaadwea caWGubGaamisamaaBaaaleaacaaIXaaabeaakiabgwSixlaadchada WgaaWcbaGaaGymaaqabaaakiaawUhacaGL9baacqGHsislcaWGfbGa amivaiaadIeadaWgaaWcbaGaaGimaaqabaGccqGHflY1caWGWbWaaS baaSqaaiaaigdaaeqaaOGaeyOeI0IaamyvaiaadofacaWGebWaaSba aSqaaiaaicdaaeqaaaGcbaGaamiCaiaad6gacaWGSbGaeyypa0Jaeu iLdqKaamyvaiaadofacaWGebGaey4kaSIaamiCamaaBaaaleaacaaI XaaabeaakiabgwSixlabfs5aejaadweacaWGubGaamisaaaaaa@BF35@

Given this result, we can use the logic above to show that this is equivalent to the square of square roots formula. Thus, comparing an initial token position to an initial token position is the same as the net pnl for an LP position hedged at some earlier token position. It is a different way to think about impermanent loss.

Theta

Finally, the Black-Scholes approach uses theta, which equals the expected loss from convexity in equilibrium (profits = 0). In their proof, they create a riskless portfolio of an option and a synthetically replicated inverse of that option via a dynamic hedging strategy that targets the delta. Negative convexity generates an adverse delta change in the option, whether the price goes up or down, which generates losses for the hedged seller. If one rehedges frequently, the losses will be smaller, but there will be more of them, and on average, they generate the same expected return whether one rehedges daily or every second. A convex position's theta equals the position's gamma, or second derivative, times the underlying asset's variance, divided by 2.

theta= 1 2 gammavariance MathType@MTEF@5@5@+= feaahCart1ev3aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaamiDaiaadI gacaWGLbGaamiDaiaadggacqGH9aqpcqGHsisldaWcaaqaaiaaigda aeaacaaIYaaaaiaadEgacaWGHbGaamyBaiaad2gacaWGHbGaeyyXIC TaamODaiaadggacaWGYbGaamyAaiaadggacaWGUbGaam4yaiaadwga aaa@4C76@

Here, the variance is scaled to whatever one's frequency is. For example, with daily data, one would take the annual variance divided by 365. Variance is linear in time, which is why people trade variance swaps and not volatility swaps. Fortunately, calculating gamma for AMMs from its primitive is simple, so it leads to the following:

LPvalu e LP =2liquidity p dLPvalu e LP p =delta=Δ= liq p =ET H LP d 2 LPvalu e LP p 2 =gamma=Γ= liq 2 p 1.5 theta= 1 2 gammavariance= 1 2 liq 2 p 1.5 p 2 σ 2 MathType@MTEF@5@5@+= feaahCart1ev3aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGceaqabeaacaWGmb GaamiuaiaadAhacaWGHbGaamiBaiaadwhacaWGLbWaaSbaaSqaaiaa dYeacaWGqbaabeaakiabg2da9iaaikdacqGHflY1caWGSbGaamyAai aadghacaWG1bGaamyAaiaadsgacaWGPbGaamiDaiaadMhacqGHflY1 daGcaaqaaiaadchaaSqabaaakeaadaWcaaqaaiaadsgacaWGmbGaam iuaiaadAhacaWGHbGaamiBaiaadwhacaWGLbWaaSbaaSqaaiaadYea caWGqbaabeaaaOqaaiabgkGi2kaadchaaaGaeyypa0Jaamizaiaadw gacaWGSbGaamiDaiaadggacqGH9aqpcqqHuoarcqGH9aqpdaWcaaqa aiaadYgacaWGPbGaamyCaaqaamaakaaabaGaamiCaaWcbeaaaaGccq GH9aqpcaWGfbGaamivaiaadIeadaWgaaWcbaGaamitaiaadcfaaeqa aaGcbaWaaSaaaeaacaWGKbWaaWbaaSqabeaacaaIYaaaaOGaamitai aadcfacaWG2bGaamyyaiaadYgacaWG1bGaamyzamaaBaaaleaacaWG mbGaamiuaaqabaaakeaacqGHciITcaWGWbWaaWbaaSqabeaacaaIYa aaaaaakiabg2da9iaadEgacaWGHbGaamyBaiaad2gacaWGHbGaeyyp a0Jaeu4KdCKaeyypa0JaeyOeI0YaaSaaaeaacaWGSbGaamyAaiaadg haaeaacaaIYaGaeyyXICTaamiCamaaCaaaleqabaGaaGymaiaac6ca caaI1aaaaaaaaOqaaiaadshacaWGObGaamyzaiaadshacaWGHbGaey ypa0JaeyOeI0YaaSaaaeaacaaIXaaabaGaaGOmaaaacaWGNbGaamyy aiaad2gacaWGTbGaamyyaiabgwSixlaadAhacaWGHbGaamOCaiaadM gacaWGHbGaamOBaiaadogacaWGLbGaeyypa0ZaaSaaaeaacaaIXaaa baGaaGOmaaaacqGHflY1daqadaqaamaalaaabaGaamiBaiaadMgaca WGXbaabaGaaGOmaiabgwSixlaadchadaahaaWcbeqaaiaaigdacaGG UaGaaGynaaaaaaaakiaawIcacaGLPaaacqGHflY1daqadaqaaiaadc hadaahaaWcbeqaaiaaikdaaaGccqGHflY1cqaHdpWCdaahaaWcbeqa aiaaikdaaaaakiaawIcacaGLPaaaaaaa@BDC0@

Simplifying, we get a function that uses a variance term:

Equation (3) -variance over 4: theta=liq p σ 2 4 MathType@MTEF@5@5@+= feaahCart1ev3aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaamiDaiaadI gacaWGLbGaamiDaiaadggacqGH9aqpcaWGSbGaamyAaiaadghacqGH flY1daWcaaqaamaakaaabaGaamiCaaWcbeaakiabgwSixlabeo8aZn aaCaaaleqabaGaaGOmaaaaaOqaaiaaisdaaaaaaa@47B2@

While AMMs, unlike option markets, do not have theta per se as there is no option premium to decay, it still captures the option cost for any short gamma position. This cost is a function of convexity, not the delta, so it presumes the position is delta-hedged.

The LvR function is identical to equation 3, though it looks different because the pool's market value is used to normalize it:

theta LPvalue = σ 2 8 MathType@MTEF@5@5@+= feaahCart1ev3aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaWaaSaaaeaaca WG0bGaamiAaiaadwgacaWG0bGaamyyaaqaaiaadYeacaWGqbGaamOD aiaadggacaWGSbGaamyDaiaadwgaaaGaeyypa0JaeyOeI0YaaSaaae aacqaHdpWCdaahaaWcbeqaaiaaikdaaaaakeaacaaI4aaaaaaa@468C@

This is a handy formula, as volatility per day for many coins is 5%; it generates a cost 3.125 basis points per day, a fun fact. In practice, however, we need to get the liquidity and price data anyway to get the market value we would apply this to anyway. Given the LP market value function

LPvalue=2liq p MathType@MTEF@5@5@+= feaahCart1ev3aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaamitaiaadc facaWG2bGaamyyaiaadYgacaWG1bGaamyzaiabg2da9iaaikdacqGH flY1caWGSbGaamyAaiaadghacqGHflY1daGcaaqaaiaadchaaSqaba aaaa@468D@

If we multiply variance/8 by the LP value, we get equation (3), the variance function for the LP's convexity cost.

Unfortunately, my math/stats skills are insufficient to prove equations 2 and 3 are the same, but they are (or at least 99% approximations of each other).

liq p 1 p 0 2 p 0 liq p 0 σ 2 4 MathType@MTEF@5@5@+= feaahCart1ev3aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaamiBaiaadM gacaWGXbGaeyyXIC9aaSaaaeaadaqadaqaamaakaaabaGaamiCamaa BaaaleaacaaIXaaabeaaaeqaaOGaeyOeI0YaaOaaaeaacaWGWbWaaS baaSqaaiaaicdaaeqaaaqabaaakiaawIcacaGLPaaadaahaaWcbeqa aiaaikdaaaaakeaadaGcaaqaaiaadchadaWgaaWcbaGaaGimaaqaba aabeaaaaGccqGHijYUcaWGSbGaamyAaiaadghacqGHflY1daWcaaqa amaakaaabaGaamiCamaaBaaaleaacaaIWaaabeaaaeqaaOGaeyyXIC Taeq4Wdm3aaWbaaSqabeaacaaIYaaaaaGcbaGaaGinaaaaaaa@5301@

This gives us three ways to calculate IL. If we use the same starting and ending times, they should be the same. That is, the variance term should use the variance in the [0,1] interval, and the ΔETH and ΔUSDC should also use the [0, 1] interval.

net token change:ΔUS D 0,1 + p 1 ΔET H 0,1 MathType@MTEF@5@5@+= feaahCart1ev3aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaamOBaiaadw gacaWG0bGaaeiiaiaadshacaWGVbGaam4AaiaadwgacaWGUbGaaeii aiaadogacaWGObGaamyyaiaad6gacaWGNbGaamyzaiaacQdacqqHuo arcaWGvbGaam4uaiaadseadaWgaaWcbaGaaGimaiaacYcacaaIXaaa beaakiabgUcaRiaadchadaWgaaWcbaGaaGymaaqabaGccqGHflY1cq qHuoarcaWGfbGaamivaiaadIeadaWgaaWcbaGaaGimaiaacYcacaaI Xaaabeaaaaa@5683@

square of square root:liq p 1 p 0 2 p 0 MathType@MTEF@5@5@+= feaahCart1ev3aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaam4Caiaadg hacaWG1bGaamyyaiaadkhacaWGLbGaaeiiaiaad+gacaWGMbGaaeii aiaadohacaWGXbGaamyDaiaadggacaWGYbGaamyzaiaabccacaWGYb Gaam4Baiaad+gacaWG0bGaaiOoaiaadYgacaWGPbGaamyCaiabgwSi xpaalaaabaWaaeWaaeaadaGcaaqaaiaadchadaWgaaWcbaGaaGymaa qabaaabeaakiabgkHiTmaakaaabaGaamiCamaaBaaaleaacaaIWaaa beaaaeqaaaGccaGLOaGaayzkaaWaaWbaaSqabeaacaaIYaaaaaGcba WaaOaaaeaacaWGWbWaaSbaaSqaaiaaicdaaeqaaaqabaaaaaaa@5820@

variance over 4:liq p 0 σ 0,1 2 4 MathType@MTEF@5@5@+= feaahCart1ev3aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaamODaiaadg gacaWGYbGaamyAaiaadggacaWGUbGaam4yaiaadwgacaqGGaGaam4B aiaadAhacaWGLbGaamOCaiaabccacaaI0aGaaiOoaiaadYgacaWGPb GaamyCaiabgwSixpaalaaabaWaaOaaaeaacaWGWbWaaSbaaSqaaiaa icdaaeqaaaqabaGccqGHflY1cqaHdpWCdaqhaaWcbaGaaGimaiaacY cacaaIXaaabaGaaGOmaaaaaOqaaiaaisdaaaaaaa@5300@

These are all costs to the LP and need to be subtracted from the LP fees to get the LP's total profitability. However, in practice, the net token change data from Uniswap's 'swap' event logs includes fees, so one does not need the daily volume to generate the net LP pnl; removing the fees would take more work. Thus, we do not need to add fee revenue if we use the swap data to get the LP's net token changes.

net token change PnL:ΔUS D 0,1 + p 1 ΔET H 0,1 MathType@MTEF@5@5@+= feaahCart1ev3aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaamOBaiaadw gacaWG0bGaaeiiaiaadshacaWGVbGaam4AaiaadwgacaWGUbGaaeii aiaadogacaWGObGaamyyaiaad6gacaWGNbGaamyzaiaabccacaWGqb GaamOBaiaadYeacaGG6aGaeuiLdqKaamyvaiaadofacaWGebWaaSba aSqaaiaaicdacaGGSaGaaGymaaqabaGccqGHRaWkcaWGWbWaaSbaaS qaaiaaigdaaeqaaOGaeyyXICTaeuiLdqKaamyraiaadsfacaWGibWa aSbaaSqaaiaaicdacaGGSaGaaGymaaqabaaaaa@59BF@

For the other approaches, we can multiply the absolute value of the USDC traded by the fees to get LP revenue. While the fees are paid in whatever token is sold to the pool, using the numeraire is an efficient approximation.

square of square root PnL:USDCvolumetradedfeeliq p 1 p 0 2 p 0 MathType@MTEF@5@5@+= feaahCart1ev3aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaam4Caiaadg hacaWG1bGaamyyaiaadkhacaWGLbGaaeiiaiaad+gacaWGMbGaaeii aiaadohacaWGXbGaamyDaiaadggacaWGYbGaamyzaiaabccacaWGYb Gaam4Baiaad+gacaWG0bGaaeiiaiaadcfacaWGUbGaamitaiaacQda caWGvbGaam4uaiaadseacaWGdbGaamODaiaad+gacaWGSbGaamyDai aad2gacaWGLbGaamiDaiaadkhacaWGHbGaamizaiaadwgacaWGKbGa eyyXICTaamOzaiaadwgacaWGLbGaeyOeI0IaamiBaiaadMgacaWGXb GaeyyXIC9aaSaaaeaadaqadaqaamaakaaabaGaamiCamaaBaaaleaa caaIXaaabeaaaeqaaOGaeyOeI0YaaOaaaeaacaWGWbWaaSbaaSqaai aaicdaaeqaaaqabaaakiaawIcacaGLPaaadaahaaWcbeqaaiaaikda aaaakeaadaGcaaqaaiaadchadaWgaaWcbaGaaGimaaqabaaabeaaaa aaaa@6FDD@

variance over 4 PnL:USDCvolumetradedfeeliq p 0 σ 0,1 2 4 MathType@MTEF@5@5@+= feaahCart1ev3aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaamODaiaadg gacaWGYbGaamyAaiaadggacaWGUbGaam4yaiaadwgacaqGGaGaam4B aiaadAhacaWGLbGaamOCaiaabccacaaI0aGaaeiiaiaadcfacaWGUb GaamitaiaacQdacaWGvbGaam4uaiaadseacaWGdbGaamODaiaad+ga caWGSbGaamyDaiaad2gacaWGLbGaamiDaiaadkhacaWGHbGaamizai aadwgacaWGKbGaeyyXICTaamOzaiaadwgacaWGLbGaeyOeI0IaamiB aiaadMgacaWGXbGaeyyXIC9aaSaaaeaadaGcaaqaaiaadchadaWgaa WcbaGaaGimaaqabaaabeaakiabgwSixlabeo8aZnaaDaaaleaacaaI WaGaaiilaiaaigdaaeaacaaIYaaaaaGcbaGaaGinaaaaaaa@6ABD@

The nice thing about the net token change approach is that you can avoid the noise generated by the fact that liquidity is not constant, especially in restricted-range pools, where it can vary quite a bit over the day. Unless you calculate these data using each trade, any liquidity number you use will be approximate and generate noise in one's estimate. Thus, I prefer the net token change approach.

I estimated the daily pnl for a pool and used the day's price return squared for the variance number.

Uniswap ETH-USDC v2 pool on Ethereum Mainnet

1/1/23-3/5/24

Net token change pnl:             $7,231

Square root pnl:                       $7,152

Variance pnl:                           $7,097

As the standard deviation in this period was $12k, these estimates are in complete agreement. The correlation between the square root and variance metrics is 99.9%, while the token change pnl correlation with those two is around 99.6%

Impermanent Loss != LvR ?

For reasons I find irrelevant, Milionis, Moallemi, Roughgarden, and Zhang emphasize their LvR approach (the variance function) as superior to the square root function. First, they note that IL depends on the initial position, as it uses a squared term, so the magnitude is different for given starting prices.

Impermanent Loss=liq p 1 p 0 2 p 0 MathType@MTEF@5@5@+= feaahCart1ev3aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaamysaiaad2 gacaWGWbGaamyzaiaadkhacaWGTbGaamyyaiaad6gacaWGLbGaamOB aiaadshacaqGGaGaamitaiaad+gacaWGZbGaam4Caiabg2da9iaadY gacaWGPbGaamyCaiabgwSixpaalaaabaWaaeWaaeaadaGcaaqaaiaa dchadaWgaaWcbaGaaGymaaqabaaabeaakiabgkHiTmaakaaabaGaam iCamaaBaaaleaacaaIWaaabeaaaeqaaaGccaGLOaGaayzkaaWaaWba aSqabeaacaaIYaaaaaGcbaWaaOaaaeaacaWGWbWaaSbaaSqaaiaaic daaeqaaaqabaaaaaaa@53F9@

This is like saying the return on a stock that moved from 100 to 150 is different for someone who bought it at 50 and someone who bought it at 100: one made 100%, the other only 50% over that price increase. In practice, we apply consistent starting prices for the collective of those long and short, or all the LPs, which is intuitive and straightforward. It is like assuming they delta hedge once each period.

Another concern is that the square root function is noisier. Yet, one can apply any of these formulas at whatever frequency you want: by minute, hour, day. Using hourly data is a lot more work with negligible benefit. The errors generated will be normally distributed and diversify away in the same way regardless of one's approach. If you use daily data to generate variance or generate your square of square roots, you lose the information from the intra-period price spike, but when you have hundreds of daily observations, the benefits of greater granularity are trivial.

What you call the LP's convexity cost does not matter. What matters is you use something close to daily data intervals and eliminate the LP's delta risk, as all the above metrics do.

No comments: