Yousefi_1994Terra 6 - Daily Transactions by New User
    Updated 2023-01-10
    with new_users as (
    select
    tx_sender as wallet_address,
    min(block_timestamp)::date as creation_date
    from terra.core.fact_transactions
    group by wallet_address
    ),
    new_user_list as (
    select
    wallet_address,
    creation_date
    from new_users
    where creation_date >= '2022-12-12'
    and creation_date < '2023-01-7'
    ),
    transactions as (
    select
    block_timestamp,
    tx_id,
    tx_sender,
    fee
    from terra.core.fact_transactions
    where block_timestamp::date >= '2022-12-12'
    and block_timestamp::date < '2023-01-7'
    ),
    final_result as (
    select
    block_timestamp,
    case
    when tx_sender in (select wallet_address from new_user_list) then 'By New Users'
    else 'By Old Users'
    end as "Users Type",
    case
    when block_timestamp::date >= '2022-12-12' and block_timestamp::date < '2022-12-25' then 'Before Christmas Holidays'
    when block_timestamp::date >= '2022-12-25' and block_timestamp::date < '2023-01-07' then 'Christmas Holidays'
    end as "Period",
    Run a query to Download Data