Skip to content
By using Twitter’s services you agree to our Cookies Use. We and our partners operate globally and use cookies, including for analytics, personalisation, and ads.
  • Home Home Home, current page.
  • About

Saved searches

  • Remove
  • In this conversation
    Verified accountProtected Tweets @
Suggested users
  • Verified accountProtected Tweets @
  • Verified accountProtected Tweets @
  • Language: English
    • Bahasa Indonesia
    • Bahasa Melayu
    • Català
    • Čeština
    • Dansk
    • Deutsch
    • English UK
    • Español
    • Filipino
    • Français
    • Hrvatski
    • Italiano
    • Magyar
    • Nederlands
    • Norsk
    • Polski
    • Português
    • Română
    • Slovenčina
    • Suomi
    • Svenska
    • Tiếng Việt
    • Türkçe
    • Ελληνικά
    • Български език
    • Русский
    • Српски
    • Українська мова
    • עִבְרִית
    • العربية
    • فارسی
    • मराठी
    • हिन्दी
    • বাংলা
    • ગુજરાતી
    • தமிழ்
    • ಕನ್ನಡ
    • ภาษาไทย
    • 한국어
    • 日本語
    • 简体中文
    • 繁體中文
  • Have an account? Log in
    Have an account?
    · Forgot password?

    New to Twitter?
    Sign up
macrocephalopod's profile
macrocephalopod
macrocephalopod
macrocephalopod
@macrocephalopod

Tweets

macrocephalopod

@macrocephalopod

Paul Allen, Vice President M&A, Pierce & Pierce (Sie/Hir) | Vegan | Silence is Violence | Women’s Rights Are Human Rights | ACAB (Assigned Cephalopod At Birth)

Joined December 2020

Tweets

  • © 2022 Twitter
  • About
  • Help Center
  • Terms
  • Privacy policy
  • Cookies
  • Ads info
Dismiss
Previous
Next

Go to a person's profile

Saved searches

  • Remove
  • In this conversation
    Verified accountProtected Tweets @
Suggested users
  • Verified accountProtected Tweets @
  • Verified accountProtected Tweets @

Promote this Tweet

Block

  • Tweet with a location

    You can add location information to your Tweets, such as your city or precise location, from the web and via third-party applications. You always have the option to delete your Tweet location history. Learn more

    Your lists

    Create a new list


    Under 100 characters, optional

    Privacy

    Copy link to Tweet

    Embed this Tweet

    Embed this Video

    Add this Tweet to your website by copying the code below. Learn more

    Add this video to your website by copying the code below. Learn more

    Hmm, there was a problem reaching the server.

    By embedding Twitter content in your website or app, you are agreeing to the Twitter Developer Agreement and Developer Policy.

    Preview

    Why you're seeing this ad

    Log in to Twitter

    · Forgot password?
    Don't have an account? Sign up »

    Sign up for Twitter

    Not on Twitter? Sign up, tune into the things you care about, and get updates as they happen.

    Sign up
    Have an account? Log in »

    Two-way (sending and receiving) short codes:

    Country Code For customers of
    United States 40404 (any)
    Canada 21212 (any)
    United Kingdom 86444 Vodafone, Orange, 3, O2
    Brazil 40404 Nextel, TIM
    Haiti 40404 Digicel, Voila
    Ireland 51210 Vodafone, O2
    India 53000 Bharti Airtel, Videocon, Reliance
    Indonesia 89887 AXIS, 3, Telkomsel, Indosat, XL Axiata
    Italy 4880804 Wind
    3424486444 Vodafone
    » See SMS short codes for other countries

    Confirmation

     

    Welcome home!

    This timeline is where you’ll spend most of your time, getting instant updates about what matters to you.

    Tweets not working for you?

    Hover over the profile pic and click the Following button to unfollow any account.

    Say a lot with a little

    When you see a Tweet you love, tap the heart — it lets the person who wrote it know you shared the love.

    Spread the word

    The fastest way to share someone else’s Tweet with your followers is with a Retweet. Tap the icon to send it instantly.

    Join the conversation

    Add your thoughts about any Tweet with a Reply. Find a topic you’re passionate about, and jump right in.

    Learn the latest

    Get instant insight into what people are talking about now.

    Get more of what you love

    Follow more accounts to get instant updates about topics you care about.

    Find what's happening

    See the latest conversations about any topic instantly.

    Never miss a Moment

    Catch up instantly on the best stories happening as they unfold.

    macrocephalopod‏ @macrocephalopod 12 Jul 2021

    High-level model for the returns to providing liquidity in Uniswap v2 liquidity pools. There are two assets X and Y in the pool with reserves x and y of each, with pool constant k = x * y and price p = x / y.

    10:35 AM - 12 Jul 2021
    • 16 Retweets
    • 147 Likes
    • GotTheTrumpCard Ziggy Darrin Aurelius Sihyeok | Stanford | 志翊 Greg Harris Kiran Ramachandran Drrr Дöнi Yuговić 野良犬
    6 replies 16 retweets 147 likes
      1. New conversation
      2. macrocephalopod‏ @macrocephalopod 12 Jul 2021

        Quick reminder, when someone swaps in the pool they deposit some X and receive some Y in return, with the output amount chosen so that the new reserves x' and y' still satisfy x' * y' = k

        1 reply 1 retweet 10 likes
        Show this thread
      3. macrocephalopod‏ @macrocephalopod 12 Jul 2021

        (Actually it's a little more complicated since k increases every time there is a swap, due to liquidity fees being subtracted from the incoming amount and added to the pool - I'll get to that)

        1 reply 1 retweet 8 likes
        Show this thread
      4. macrocephalopod‏ @macrocephalopod 12 Jul 2021

        The important thing is that you can express the reserves in terms of k, p as x = √(kp) and y = √(k/p), and whenever there is a price move the new reserves are x' = √(k'p') and y' = √(k'/p')

        1 reply 1 retweet 8 likes
        Show this thread
      5. macrocephalopod‏ @macrocephalopod 12 Jul 2021

        The total value of the pool is x + y * p = 2√(kp) and after a price move this has changed to x' +y' * p' = 2√(k'p') so the P&L is just 2√(k'p') - 2√(kp)

        1 reply 1 retweet 7 likes
        Show this thread
      6. macrocephalopod‏ @macrocephalopod 12 Jul 2021

        (Clearly you only have an ownership claim on a % of all the assets in the pool, but since everyone in the pool gets the same results, we may as well model the whole pool as a single liquidity provider)

        1 reply 1 retweet 7 likes
        Show this thread
      7. macrocephalopod‏ @macrocephalopod 12 Jul 2021

        Now most treatments I see compare this to an alternative where you just held assets X and Y outside of the liquidity pool. But I'm a market neutral kinda guy so let's assume you hedge the linear price exposure with a short futures position, which generates P&L of -y * (p' - p)

        1 reply 1 retweet 6 likes
        Show this thread
      8. macrocephalopod‏ @macrocephalopod 12 Jul 2021

        Call the price return r, so that p' = p(1+r), then your total P&L is 2√(k'p(1+r)) - 2√(kp) - √(kp) * r which, if you expand out the square root in powers of r, is 2√(kp) * [√(k'/k) * (1 + r/2 - r^2/8 + ...) - 1 - r/2] (the linear term cancels as expected)

        1 reply 1 retweet 5 likes
        Show this thread
      9. macrocephalopod‏ @macrocephalopod 12 Jul 2021

        Now remember that the pool constant k grows over time. The growth is proportional to the turnover of the pool and to the fees charged so we can write k' = k * (1 + t * f) where t is the turnover as a fraction of pool assets, and f is the liquidity fee (0.3% in Uniswap v2)

        1 reply 1 retweet 7 likes
        Show this thread
      10. macrocephalopod‏ @macrocephalopod 12 Jul 2021

        Using that in the expression for the P&L, expanding in powers of tf and simplifying, we get P&L = √(kp) * [tf - r^2/4] = x * (tf - r^2/4)

        1 reply 1 retweet 5 likes
        Show this thread
      11. macrocephalopod‏ @macrocephalopod 12 Jul 2021

        Taking an expectation on both sides and dividing through by x to get a return, we get E(return) = E(tf) - sigma^2/4. If you have estimates for the turnover in the pool and the realized volatility, this tells your your expected return for providing liquidity over one time period.

        1 reply 1 retweet 8 likes
        Show this thread
      12. macrocephalopod‏ @macrocephalopod 12 Jul 2021

        If you set that expected return to zero you get an "implied volatility" of sigma = 2 * √E(tf). Unlike option implied volatility you can't observe this directly (only indirectly in the form of time-series averages of pool turnover) but you /can/ compare it to your estimate ...

        1 reply 2 retweets 8 likes
        Show this thread
      13. macrocephalopod‏ @macrocephalopod 12 Jul 2021

        ... of realized volatility to determine whether providing liquidity in the pool is likely to be profitable or not. You can also calculate the "gamma" for the pool which tells you (a) how sensitive your P&L will be to price jumps and ...

        1 reply 1 retweet 9 likes
        Show this thread
      14. macrocephalopod‏ @macrocephalopod 12 Jul 2021

        ... (b) how often you need to adjust your futures position to remain market neutral.

        1 reply 1 retweet 6 likes
        Show this thread
      15. macrocephalopod‏ @macrocephalopod 12 Jul 2021

        Some extensions to this - 1. In some liquidity pools you receive governance tokens for participating, which increase the yield (assuming you sell them) 2. You may pay or receive funding fees on the futures position, which should be added/subtracted from the liquidity fee yield

        1 reply 1 retweet 8 likes
        Show this thread
      16. macrocephalopod‏ @macrocephalopod 12 Jul 2021

        3. It costs money to adjust your futures hedge so you shouldn't re-hedge too frequently, there is probably an interesting avenue of research for "optimal delta hedging" in liquidity pools.

        2 replies 1 retweet 16 likes
        Show this thread
      17. macrocephalopod‏ @macrocephalopod 12 Jul 2021

        Ugh - I wanted to shout out another account that did a thread about viewing liquidity pool stakes as covered calls and trading liquidity tokens as options, but I can't find it now. If someone could please link it that would be very helpful!

        7 replies 1 retweet 20 likes
        Show this thread
      18. End of conversation

    Loading seems to be taking a while.

    Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.

      Promoted Tweet

      false

      • © 2022 Twitter
      • About
      • Help Center
      • Terms
      • Privacy policy
      • Cookies
      • Ads info