with t1 as (
select
case when PROJECT_NAME ilike '%astro%' then 'Astroport' else PROJECT_NAME end as projects,
min(block_timestamp) as deploy_day,
count(distinct tx_id) as transactions,
count(distinct tx_sender) as users
from terra.core.dim_address_labels
join terra.core.fact_transactions
on address=tx:body:messages[0]:contract
where tx_succeeded= TRUE
group by 1
)
SELECT*
from t1
order by 3 desc
limit 50