yasmin-n-d-r-hSolanart Collection solana open bounty
    Updated 2022-12-06
    with sol_price AS (
    select
    date_trunc('day', BLOCK_TIMESTAMP) as day,
    (
    sum(SWAP_TO_AMOUNT)/ sum(SWAP_FROM_AMOUNT)
    ) as price
    from
    solana.core.fact_swaps
    where
    SWAP_FROM_MINT = 'So11111111111111111111111111111111111111112'
    and SWAP_TO_MINT = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
    group by
    1
    ),
    tb AS (
    SELECT
    date_trunc('day', BLOCK_TIMESTAMP) AS date,
    LABEL AS collection,
    sum(SALES_AMOUNT * price) AS Volume,
    rank() over (
    partition by date
    order by
    Volume desc
    ) As rank
    from
    solana.core.fact_nft_sales
    inner join sol_price on sol_price.day = date_trunc('day', BLOCK_TIMESTAMP)
    inner join solana.core.dim_labels on MINT = ADDRESS
    where
    MARKETPLACE in (
    'solanart'
    )
    and SALES_AMOUNT is not NULL
    and date > CURRENT_DATE - 30
    group by
    1,
    Run a query to Download Data