misaghlbNFT Wallet Behavior Comparison
    Updated 2022-07-15
    WITH sol_price as (
    select
    date(block_timestamp) as pdate,
    avg(swap_to_amount) / avg(swap_from_amount) as sol_price
    from solana.fact_swaps
    where swap_from_mint = 'So11111111111111111111111111111111111111112'
    and swap_to_mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
    and swap_to_amount > 0
    and swap_from_amount > 0
    and date(block_timestamp) >= '2022-06-01'
    group by 1
    order by 1 asc
    ),
    flow_price as (
    SELECT date(TIMESTAMP) as pdate, avg(PRICE_USD) as p
    from flow.core.fact_prices
    where SYMBOL = 'FLOW'
    GROUP BY pdate
    )
    select
    a.block_timestamp::date as date, 'Solana' as blockchain,
    count(DISTINCT PURCHASER) as unique_buyer,
    sum(unique_buyer) over (order by date asc) as cum_user,
    sum(SALES_AMOUNT * sol_price) as volume
    from solana.core.fact_nft_sales a join sol_price b on date(a.block_timestamp) = b.pdate
    where block_timestamp::date >= '2022-06-01'
    group by date
    UNION
    select
    block_timestamp::date as date,
    'Flow' as blockchain,
    count(DISTINCT BUYER) as unique_buyer,
    sum(unique_buyer) over (order by date asc) as cum_user,
    Run a query to Download Data