carlesmontalavelodrome health 4
    Updated 2023-04-13
    with
    pools as (
    select
    pool_name,
    sum(case when lp_token_action = 'mint' then (token0_amount_usd + token1_amount_usd) else 0 end) as minted,
    sum(case when lp_token_action like 'burn' then (token0_amount_usd + token1_amount_usd) * -1 else 0 end) as burnt,
    minted+burnt as netflow,
    minted-burnt as total_volume
    from optimism.velodrome.ez_lp_actions
    where trunc(block_timestamp,'day') between CURRENT_DATE-90 and current_date - 1
    group by 1 having minted>0
    order by 5 desc
    limit 10
    )

    select
    pool_name,
    minted,
    burnt,
    round(((minted + burnt) / minted) * 100, 2) as pcg_diff
    from pools

    Run a query to Download Data