TheLaughingMan[Optimism][Q10] Velodrome Daily Users
    Updated 2022-08-17
    with base as (
    SELECT ORIGIN_FROM_ADDRESS as sender, tx_hash, block_timestamp, 'staking action' as activity from optimism.velodrome.ez_staking_actions
    UNION ALL
    SELECT ORIGIN_FROM_ADDRESS as sender, tx_hash, block_timestamp, 'LP action' as activity from optimism.velodrome.ez_lp_actions
    UNION ALL
    SELECT ORIGIN_FROM_ADDRESS as sender, tx_hash, block_timestamp, 'claim rewards' as activity from optimism.velodrome.ez_claimed_rewards
    UNION ALL
    SELECT ORIGIN_FROM_ADDRESS as sender, tx_hash, block_timestamp, 'swaps' as activity from optimism.velodrome.ez_swaps
    UNION ALL
    SELECT ORIGIN_FROM_ADDRESS as sender, tx_hash, block_timestamp, 'VELO locks' as activity from optimism.velodrome.ez_velo_locks
    UNION ALL
    SELECT ORIGIN_FROM_ADDRESS as sender, tx_hash, block_timestamp, 'VELO votes' as activity from optimism.velodrome.ez_votes
    )

    SELECT
    block_timestamp::date as ddate,
    COUNT(DISTINCT tx_hash) as total_txns,
    COUNT(DISTINCT sender) as total_users
    from base
    group by ddate ORDER BY ddate asc