HosseinSatellite money New Users over last month
    Updated 2022-11-26
    with main_table as (
    select
    t1.block_timestamp,
    t1.tx_id,
    t1.attribute_value as from_network,
    t2.attribute_value as from_address,
    t3.attribute_value as to_network,
    t4.attribute_value as to_address
    from axelar.core.fact_msg_attributes t1
    join axelar.core.fact_msg_attributes t4
    join axelar.core.fact_msg_attributes t2
    join axelar.core.fact_msg_attributes t3
    on t1.tx_id = t2.tx_id
    and t1.tx_id = t3.tx_id
    and t1.tx_id = t4.tx_id
    where 1 = 1
    and t1.attribute_key = 'sourceChain'
    and t2.attribute_key = 'sender'
    and t3.attribute_key = 'destinationChain'
    and t4.attribute_key = 'destinationAddress'
    and t1.tx_succeeded = 1
    ),

    new_users_tbl as (
    select trunc(mindate::date, 'day') as day,
    count(distinct(from_address)) as new_users
    from (
    select from_address, min(block_timestamp) as mindate
    from main_table
    group by from_address
    )
    group by day
    )

    select
    day "Date",
    Run a query to Download Data