Impermanent Loss on Sushiswap pools

    Overview

    Impermanent loss is a loss that funds are exposed to when they are in a liquidity pool. This loss typically occurs when the ratio of the tokens in the liquidity pool becomes uneven.

    This dashboard enables users to take a look at deposits into liquidity pools and measure their impermanent loss at a specific point in time (end block number).

    References:

    Methods

    Using swaps data from the selected pool, we’ll take the ratio of USDC and the other token to get the other token’s price in USDC.

    We’ll average swap prices per block number to get a price sample.

    For each block number, we’ll take a time-weighted average price from 100 blocks prior up to corresponding block. The TWAP formula is as follows:

    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    db_img

    For each deposit, we’ll take note of the price ratio (other token’s price in USDC) at 2 points in time: the time of deposit and the time of the end_block.

    Using the formula on the right, we’ll calculate the impermanent loss (%IL and loss amount) for each deposit.

    db_img

    In order to obtain your desired results, you will have to follow these steps:

    1. Select a pool address to explore their impermanent loss metrics. You will have to get both the pool address on Ethereum and also on Polygon.
    2. Paste the pool address in the pool_address parameter above.
    3. Click the "Apply All Parameters button".
    4. Impermanent loss at the time of the end_block is shown.

    The charts you are observing are:

    1. Derived time-weighted average token prices (TWAP) using swaps data from a liquidity pool.

    2. Calculated impermanent loss since the start of the year.

    3. Characterized impermanent loss with respect to:

      1. token price
      2. percent change in relative price
      3. time of deposit
    4. Built an interactive dashboard to compare impermanent loss per deposit for any USDC pool in Ethereum and Polygon on Sushiswap.