nitsAurory vs Others
    Updated 2023-04-13
    with
    a_l as
    (SELECT mint as address,contract_name as label
    from solana.core.dim_nft_metadata
    where contract_name = 'Aurory' ) ,
    others as
    (SELECT date(block_timestamp) as day,sum(sales_amount) as total_amt,
    count(DISTINCT tx_id) as total_txs,
    sum(total_amt) over (order by day) as cum_sales,
    avg(total_amt) over (order by day) as avg_sales,
    sum(total_txs) over (order by day) as cum_txs,
    avg(total_txs) over (order by day) as avg_txs,
    cum_sales/cum_txs as sale_per_tx,
    max(sales_amount) as max_price_sold,
    min(sales_amount) as min_price_sold,
    'others' as type
    from solana.core.fact_nft_sales
    where mint not in (SELECT address from a_l ) and succeeded = TRUE and day >= CURRENT_DATE -90
    GROUP by 1 ),
    aurory as (SELECT date(block_timestamp) as day,sum(sales_amount) as total_amt,
    COUNT(DISTINCT tx_id) as total_txs,
    sum(total_amt) over (order by day) as cum_sales,
    avg(total_amt) over (order by day) as avg_sales ,
    sum(total_txs) over (order by day) as cum_txs,
    avg(total_txs) over (order by day) as avg_txs,
    cum_sales/cum_txs as sale_per_tx,
    max(sales_amount) as max_price_sold,
    min(sales_amount) as min_price_sold,
    'aurory' as type
    from solana.core.fact_nft_sales
    where mint in (SELECT address from a_l ) and succeeded = TRUE and day >= CURRENT_DATE -90
    GROUP by 1 )

    SELECT * from aurory
    UNION ALL
    SELECT * from others
    Run a query to Download Data