NuveveCryptoArchivedVelodrome Deposits vs. Withdraws
    Updated 2022-11-07
    with deposits as (
    select
    date_trunc('month', block_timestamp) as month,
    sum(token0_amount_usd + token1_amount_usd) as total_usd
    from optimism.velodrome.ez_lp_actions
    where lp_action = 'deposit'
    group by month
    ),

    withdraws as (
    select
    date_trunc('month', block_timestamp) as month,
    sum(token0_amount_usd + token1_amount_usd) as total_usd
    from optimism.velodrome.ez_lp_actions
    where lp_action = 'withdraw'
    group by month
    ),

    cum_d as (
    select
    month,
    sum(total_usd) over(order by month) as total_usd
    from deposits
    ),

    cum_w as (
    select
    month,
    sum(total_usd) over(order by month) as total_usd
    from withdraws
    )

    select
    cum_d.month as month,
    cum_d.total_usd as deposits,
    cum_w.total_usd as withdraws
    Run a query to Download Data