Impermanent Loss; Mainnet vs. Polygon

    Question:

    Compare impermanent loss on Sushi pools on Mainnet vs. on Polygon, and create visualizations to illustrate the comparison.

    You are free to draw your own conclusions on the comparison analysis, but the goal here is to put your skills to the test and help us develop a TWAP methodology that allows for understanding changes in LP value (not adjusted for fee revenue) over time at the deposit level. Since each deposit happens at a different time, there must be something specific to each deposit.

    Overview of essay:

    In this essay, the impermanent loss on Sushi pools like ETH/USDC pool on Mainnet and Polygon. The USD value and percentage of impermanent loss have been presented in the results table.

    The major aim of this essay is to test and verify the TWAP methodology on impermanent loss of liquidity pools.

    The impermanent loss has been defined in next chapter of this essay. Also, the rest of essay has been divided into two major sections for Mainnet and Polygon. Specific block numbers have been picked up to analyze the impermanent loss of selected pools.

    What is Impermanent Loss?

    Impermanent loss is a concept in the decentralized financial system, or DeFi, and is equivalent to the word temporary, which indicates the return of capital of liquidity providers after loss. Unsustainable loss occurs when the price of tokens has decreased compared to their price at the time of deposit in the liquidity pool. The greater the price reduction, the bigger the loss. Therefore, despite the fact that providing liquidity for the liquidity pool is considered a profitable action, the impermanent loss should be considered. The difference between the price of the funds kept in AMM and the funds in the wallets is considered Impermanent Loss. Price fluctuations, which cause unstable losses, cause the loss of people's capital and assets, and the reason for this is the instability of trading currency pairs.

    So why do liquidity providers continue to provide liquidity despite the possibility of losses? In response to this question, it can be said that losses can be compensated with trading fees, which may be quite exposed to sudden losses, can be profitable with the help of fees.

    Pools such as stablecoins or wrapped versions, whose assets have a limited price range, experience less Impermanent Loss than other pools. In any case, there is a certain amount of risk in this market, but what makes investors stay in this market is that the trading fees usually compensate to some extent the effects of Impermanent Loss. The second way is to join pools where people can deposit according to their desired weight. That is, users can enter their assets into the pool with ratios of 50/50, 20/80 and 2/98, thus reducing the effect of unstable losses.

    Impermanent Loss: Mainnet

    Approach:

    • Add liquidity to USDC/WETH Pool on Mainnet:

      select * from ethereum.core.ez_token_transfers where to_address ilike '0x397ff1542f962076d0bfe58ea045ffa2d347aca0' and ORIGIN_FUNCTION_SIGNATURE = '0xf305d719' and block_number between 14000000 and 15180000

    • ETH price in USDC at that deposit time

      select HOUR, price as ETH_price from ethereum.core.fact_hourly_token_prices where SYMBOL='WETH'

    • Identify their ETH/USDC deposit ratio

    • Calculate the impermanent loss of each deposits at Block Number 15180000

    Loading...
    Loading...
    Loading...
    Loading...

    Key findings 1:

    1. The daily deposit to the liquidity pool (USDC/WETH) shown the highest volume was around 10 million USD.
    2. The table presents the impermanent loss of USDC/WETH pool on Sushiswap per blocks.
    3. Like said in the introduction of impermanent loss, the biggest loss happened when the difference of price on deposit time and selected time is getting larger.
    4. The highest impermanent loss happened on block (14525227) and 2022-04-05 with 8.10% of loss.
    5. The depositors with high impermanent loss shown the users with more than two deposit times experienced about 16% of loss.
    6. The ETH/USDC ratio per block followed the same pattern as impermanent loss per block and its expected.
    Loading...

    Impermanent Loss: Polygon

    Loading...
    Loading...
    Loading...
    Loading...

    Key findings 2:

    1. The daily deposit to the liquidity pool (USDC/WETH) shown the highest volume was around 4.6 million USD on June 20th.
    2. The table presents the impermanent loss of USDC/WETH pool on Sushiswap per blocks on Polygon.
    3. By increasing the price difference of ETH at time of deposit and current date, the impermanent loss has been enhanced.
    4. The highest USD value of impermanent loss depends on various aspects like price difference and USD value of deposit on liquidity pool.
    5. The highest impermanent loss happened on block (29725985) and 2022-06-18 with 2.98% of loss.
    6. The ETH/USDC ratio per block has followed the reducing pattern due to the decreasing ETH price on blocks.
    7. The highest difference caused biggest impermanent loss as can be seen in both graphs on Polygon.

    Approach:

    • Add liquidity to USDC/WETH Pool on Polygon:

      select * from flipside_prod_db.polygon.udm_events where TO_ADDRESS='0x34965ba0ac2451a34a0471f04cca3f990b8dea27' and TO_ADDRESS_NAME='sushiswap usdc/weth pool' and EVENT_NAME='transfer' and ORIGIN_FUNCTION_SIGNATURE='0xf5e405a7' and BLOCK_TIMESTAMP between '2022-01-14' and '2022-07-20’

    • ETH price in USDC at that deposit time

      select HOUR, price as ETH_price from ethereum.core.fact_hourly_token_prices where SYMBOL='WETH'

    • Identify their ETH/USDC deposit ratio

    • Calculate the impermanent loss of each deposits at Block Number 15180000