Sandeshsol_nft users dau
    Updated 2022-11-30
    with
    sol_price as
    (
    select date_trunc({{granularity}},recorded_hour) as time,avg(close) as usd from solana.core.fact_token_prices_hourly
    where symbol='SOL'
    group by time
    ),
    sol_nft as
    (
    select
    'solana' as chain,
    date_trunc('{{granularity}}',block_timestamp) as time,
    nft.tx_id as tx_hash,
    nft.marketplace as marketplace,
    seller,
    purchaser as buyer,
    ad.address_name as project_name,
    '0' as token_id,
    'sol' as currency,
    nft.sales_amount*sol.usd as price
    from solana.core.fact_nft_sales nft
    inner join sol_price sol
    on date_trunc('{{granularity}}',block_timestamp) =sol.time
    left join solana.core.dim_labels ad
    on nft.mint=ad.address
    where time between '{{start_date}}' and '{{end_date}}'
    )
    --reference https://app.flipsidecrypto.com/dashboard/PIr6pX
    ,
    daus as (
    SELECT
    distinct buyer as users,
    trunc(time,'week') as weeks,
    count(distinct trunc(time,'day')) as active_days
    from sol_nft
    -- where platform_name='sudoswap'
    Run a query to Download Data