with maintable as (
select block_timestamp,
tx_from,
row_number () over (partition by tx_from order by block_timestamp asc) as rn
from lava.core.fact_transactions
where block_timestamp >= '2024-07-30 11:00:00.000')
select date_trunc ({{Time_Interval}},block_timestamp) as date,
case when rn = '1' then 'New Users' else 'Existing Users' end as type,
count (distinct tx_from) as Users
from maintable
group by 1,2
order by 1 desc