0xaimanImpermanent Loss/Gain Uniswap v3
    Updated 2023-08-13
    with top_pool as (
    with tvl as (
    select
    pool_name,
    pool_address,
    avg(token0_balance_usd +token1_balance_usd) as tvl_USD
    from ethereum.uniswapv3.ez_pool_stats
    where block_timestamp>=dateadd(day,-1,CURRENT_DATE)
    group by 1 ,2 order by 3 desc
    )

    select *
    from tvl
    where tvl_USD is not null
    order by 3 desc

    limit 5
    ),


    lpa as (select ezlpa.*
    from ethereum.uniswapv3.ez_lp_actions ezlpa
    inner join top_pool on ezlpa.pool_address=top_pool.pool_address),

    add_liquidity as
    (
    select
    block_timestamp,
    liquidity_provider,
    pool_name,
    token0_symbol,
    amount0_adjusted,
    amount0_usd,
    token1_symbol,
    amount1_adjusted,
    Run a query to Download Data