with top10 as (select sum(ETH_VALUE) as volume,FROM_ADDRESS
from optimism.core.fact_transactions
where to_date(BLOCK_TIMESTAMP) > '2022-06-30' and to_date(BLOCK_TIMESTAMP) <= '2022-07-31' and STATUS='SUCCESS'
group by 2
order by 1 desc
limit 10)
select sum(ETH_VALUE) as volume,FROM_ADDRESS,to_date(BLOCK_TIMESTAMP)
from optimism.core.fact_transactions
where to_date(BLOCK_TIMESTAMP) > '2022-06-30' and to_date(BLOCK_TIMESTAMP) <= '2022-07-31' and STATUS='SUCCESS'
and FROM_ADDRESS in (select FROM_ADDRESS from top10)
group by 2,3