brian-terraDaily Unique Users
    Updated 2022-06-28
    with from_wallets as (
    select
    date_trunc('day', t.block_timestamp) as date,
    w.value as wallet
    from
    terra.transactions t,
    lateral flatten(input => t.tx_from) w
    where
    tx_status = 'SUCCEEDED'
    ),
    to_wallets as (
    select
    date_trunc('day', t.block_timestamp) as date,
    w.value as wallet
    from
    terra.transactions t,
    lateral flatten(input => t.tx_to) w
    where
    tx_status = 'SUCCEEDED'
    )

    select date, count(distinct wallet) as total_wallets
    from
    (select
    *
    from
    to_wallets
    union
    select
    *
    from
    from_wallets)
    group by date
    order by date
    Run a query to Download Data