--credit : alik110
with table1 as (select origin_from_address as newuser,min(block_timestamp) as mindate from optimism.velodrome.ez_votes group by 1)
select block_timestamp::date as date,
t1.vote_action,
count (distinct tx_hash),
count (distinct origin_from_address) as Unique_Voters,
count (distinct newuser) as New_Voters
from optimism.velodrome.ez_votes t1 join table1 t2 on t1.block_timestamp::date = t2.mindate::date-- and t1.vote_action = t2.vote_action
group by 1,2
order by 1