par_rnDust Price
    Updated 2022-12-02
    with nfts as (
    SELECT *
    from solana.core.dim_labels
    where ADDRESS_NAME ilike 'DeGods'
    ),
    dust_token_price as (
    SELECT date_Trunc('day', block_timestamp) as pdate,
    median(swap_from_amount/swap_to_amount) as Dust_price
    FROM solana.core.fact_swaps
    WHERE succeeded = 'TRUE'
    AND swap_to_mint = 'DUSTawucrTsGU8hcqRdHDCbuYhCPADMLM2VcCb8VnFnQ'
    AND swap_from_mint IN ('7kbnvuGBxxj8AG9qp8Scn56muWGaRaFqxg1FsRp3PaFT','Ea5SjE2Y6yvCeW5dYTn7PYMuW5ikXkvbGdcmSnXeaLjS','Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB', 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', 'USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX')
    AND swap_from_amount>0 AND swap_to_amount>0
    and block_timestamp >='2022-03-15'
    GROUP BY 1
    )

    SELECT
    date(BLOCK_TIMESTAMP) as date,
    COUNT(DISTINCT PURCHASER) as buyers,
    COUNT(DISTINCT SELLER) as sellers,
    sum(SALES_AMOUNT) as sale_volume,
    sum(sale_volume) over (order by date) as cumu_vol,
    COUNT(DISTINCT tx_id) as sales_count,
    b.Dust_price
    from solana.core.fact_nft_sales a
    join dust_token_price b
    on b.pdate = date(a.BLOCK_TIMESTAMP)
    where MINT in (SELECT address from nfts)
    GROUP by date,b.Dust_price
    Run a query to Download Data