mucrypto2023-03-04 07:59 AM
    Updated 2023-03-04
    with ethereum as (select
    date_trunc('day', block_timestamp) as day,
    count(distinct from_address) as active_wallets
    from ethereum.core.fact_transactions
    where block_timestamp::date between '2022-05-04' and '2022-05-15'
    group by day),
    luna as (select
    date(hour) as "Date",
    avg(price) as "Average LUNA price, USD"
    from ethereum.core.fact_hourly_token_prices
    where "Date" between '2022-05-04' and '2022-05-15'
    and symbol = 'LUNA'
    group by "Date"),

    labels as (select
    try_cast(address as integer) as ad,
    address_name
    from ethereum.core.dim_labels
    group by 1,2)

    select ethereum.active_wallets, labels.address_name, luna."Average LUNA price, USD", luna."Date"
    from ethereum
    join luna
    on ethereum.day=luna."Date"
    join labels
    on ethereum.active_wallets=labels.ad
    Run a query to Download Data