rajsAll Blockchains Growth # of New Users
    Updated 2023-01-23
    with terra_users as
    (
    SELECT
    'terra' as blockchain,
    tx_sender as user,
    min(block_timestamp) as date_joined
    from terra.core.fact_transactions
    group by 1,2
    )
    ,

    terra_new_users as
    (
    SELECT
    blockchain,
    date_trunc('{{Granularity}}', date_joined) as date,
    case when ('{{Granularity}}' = 'day' and date_trunc('{{Granularity}}', date_joined) = '2023-01-14') or
    ('{{Granularity}}' = 'hour' and date_trunc('{{Granularity}}', date_joined) = '2023-01-14 18:00:00.000')
    then '2. Announcement Date'
    when ('{{Granularity}}' = 'day' and date_trunc('{{Granularity}}', date_joined) < '2023-01-14') or
    ('{{Granularity}}' = 'hour' and date_trunc('{{Granularity}}', date_joined) < '2023-01-14 18:00:00.000')
    then '1. Before Announcement Date'
    when ('{{Granularity}}' = 'day' and date_trunc('{{Granularity}}', date_joined) > '2023-01-14') or
    ('{{Granularity}}' = 'hour' and date_trunc('{{Granularity}}', date_joined) > '2023-01-14 18:00:00.000')
    then '3. After Announcement Date'
    end as period,
    count(user) as no_of_new_users
    from terra_users
    where date_joined between '{{StartDate}}' and '{{EndDate}}'
    group by 1,2,3
    )
    ,

    arbitrum_users as
    (
    SELECT
    Run a query to Download Data