Yousefi_1994Terra 6 - Daily NFT Sales by New Users
    Updated 2023-01-11
    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'
    ),
    luna_price_usd as (
    select
    recorded_hour::date as days,
    avg(close) as price_usd
    from crosschain.core.fact_hourly_prices
    where id = 'terra-luna-2'
    and recorded_hour::date >= '2022-12-12'
    and recorded_hour::date < '2023-01-7'
    group by days
    ),
    nft_sales as (
    select
    block_timestamp,
    tx_id,
    purchaser,
    seller,
    case
    when sales_amount is not null then (sales_amount)/1e6
    else 0
    end as price
    from terra.core.fact_nft_sales
    Run a query to Download Data