Impermanent Loss; Mainnet vs. Polygon (Sushiswap Bounty)
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. Withdrawals of liquidity can be ignored for now. Hints: Using Sushi USDC/WETH Pool on Mainnet: 1. Identify all liquidity deposits between ETH Block Number 14000000 and Block Number 15180000 into the mainnet pool 2. For each depositor-deposit get the ETH price in USDC at that deposit time (can use hourly_price table as a shortcut, but ideally, create a time weighted average price using SWAPS in the pool within the last 100 blocks of that deposit) and identify their ETH/USDC deposit ratio (how much ETH did they deposit, how much USDC, what is that total value in USDC terms) 3. Use the depositor-deposit ETH/USDC ratio at time of its deposit (changes for every depositor-deposit) to calculate the impermanent loss of each deposits at Block Number 15180000 The resulting table may look like this (tweak as needed, we have not done this query before so adjust to fit your analysis): BLOCK_NUMBER_OF_DEPOSIT | TX_HASH | Liquidity_Provider | Amount ETH Deposited in Pool | Amount USDC Deposited in Pool | ETH/USDC TWAP price at Block_Number_OF_DEPOSIT | ETH/USDC TWAP Price at BLOCK 15180000 | Impermanent Loss as of BLOCK 15180000 (in USDC) You can leverage this IL Calculator to help calculate IL without adjusting for revenue