SalehS9-Smart Money-Strategy-NFTs-top 100
    Updated 2023-02-03
    with sol_price as(
    select
    block_timestamp::date as day_price
    ,median (div0(swap_to_amount,swap_from_amount)) as avg_price
    from solana.fact_swaps
    where swap_to_mint in ('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
    ,'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB')
    and swap_from_mint = 'So11111111111111111111111111111111111111112'
    and succeeded = 'TRUE'
    group by 1
    order by 1
    )
    ,lst_sellers as (
    select
    seller
    ,count (DISTINCT tx_id) as tx_count
    ,sum(sales_amount) as amount
    ,sum(sales_amount*avg_price) as usd_amount
    from solana.core.fact_nft_sales
    join sol_price on day_price = block_timestamp::date
    -- where block_timestamp::date>='2022-01-01' and block_timestamp::date<=CURRENT_DATE-1
    where SUCCEEDED=true
    group by 1
    )
    , lst_PURCHASERs as (
    select
    PURCHASER
    ,count (DISTINCT tx_id) as tx_count
    ,sum(sales_amount) as amount
    ,sum(sales_amount*avg_price) as usd_amount
    from solana.core.fact_nft_sales
    join sol_price on day_price = block_timestamp::date
    -- where block_timestamp::date>='2022-01-01' and block_timestamp::date<=CURRENT_DATE-1
    where SUCCEEDED=true
    group by 1
    Run a query to Download Data