mattkstewVelodrome Health 7
    Updated 2022-11-15
    with tab1 as (
    select
    pool_name,
    sum(Case
    when lp_action like 'deposit' then token0_amount_usd
    else token0_amount_usd * -1
    end)


    from optimism.velodrome.ez_lp_actions
    where token0_amount_usd is not null
    group by 1
    order by 2 DESC
    limit 10 )


    select
    date_trunc('day', block_timestamp),
    pool_name,
    sum(Case
    when lp_action like 'deposit' then token0_amount_usd
    else token0_amount_usd * -1
    end)


    from optimism.velodrome.ez_lp_actions
    where token0_amount_usd is not null
    and pool_name in (select pool_name from tab1)
    group by 1, 2

    Run a query to Download Data