nsa2000swap metrics
    Updated 2022-11-16
    with table1 as (
    select mindate::date as day,
    count (distinct newuser) as new_users,
    sum (new_users) over (order by day) as total_users
    from (select origin_from_address as newuser,min(block_timestamp) as mindate from optimism.velodrome.ez_swaps group by 1)
    group by 1)

    select block_timestamp::date as date,
    new_users,
    total_users,
    count (distinct tx_hash) as TX_Count,
    count (distinct tx_hash)/1440 as TPM,
    count (distinct tx_hash)/86400 as TPS,
    count (distinct tx_hash)/24 as TPH,
    sum (tx_count) over (order by date) as Cumulative_TX_Count,
    count (distinct origin_from_address) as Users_Count,
    sum (amount_in_usd) as USD_Volume,
    sum (lp_fee_usd) as swap_fee,
    sum (swap_fee) over (order by date) as cumulative_swap_fee,
    sum (USD_Volume) over (order by date) as Cumulative_USD_Volume
    from optimism.velodrome.ez_swaps t1 join table1 t2 on t1.block_timestamp::date = t2.day
    group by 1,2,3
    order by 1

    Run a query to Download Data