superflyUntitled Query
    Updated 2022-12-07
    with min1 as (select timestamp::date as p_date,
    avg(price_usd) as usdprice from flow.core.fact_prices
    where symbol = 'FLOW' and source = 'coinmarketcap'
    group by 1)
    ,laligaTb as (select
    BLOCK_TIMESTAMP::date as date, row_number () over (order by date) as day_rank,
    'LaLiga Golazos' as collection,
    COUNT(DISTINCT tx_id) as sales_cnt, COUNT(DISTINCT buyer) as buyer_cnt,
    COUNT(DISTINCT seller) as seller_cnt, COUNT(DISTINCT nft_id) as nft_cnt,
    sum(case when currency = 'A.1654653399040a61.FlowToken' then price*usdprice else price end) as volume,
    avg(case when currency = 'A.1654653399040a61.FlowToken' then price*usdprice else price end) as avg_price,
    max(case when currency = 'A.1654653399040a61.FlowToken' then price*usdprice else price end) as max_price,
    min(case when currency = 'A.1654653399040a61.FlowToken' then price*usdprice else price end) as floor_price,
    sum(sales_cnt) over (order by date) as cum_sales_cnt, sum(volume) over (order by date) as cum_volume
    from flow.core.ez_nft_sales s join min1 m on s.block_timestamp::Date = m.p_date
    where nft_collection in ('A.87ca73a41bb50ad5.Golazos')
    and tx_succeeded = 'TRUE'
    GROUP by 1,3 ORDER by 1 ASC
    limit 7)
    , min2 as (select BLOCK_TIMESTAMP::date as date,
    row_number () over (order by date) as day_rank,'TopShot' as collection,
    COUNT(DISTINCT tx_id) as sales_cnt,COUNT(DISTINCT buyer) as buyer_cnt,
    COUNT(DISTINCT seller) as seller_cnt,COUNT(DISTINCT nft_id) as nft_cnt,
    sum(case when currency = 'A.1654653399040a61.FlowToken' then price*usdprice else price end) as volume,
    avg(case when currency = 'A.1654653399040a61.FlowToken' then price*usdprice else price end) as avg_price,
    max(case when currency = 'A.1654653399040a61.FlowToken' then price*usdprice else price end) as max_price,
    min(case when currency = 'A.1654653399040a61.FlowToken' then price*usdprice else price end) as floor_price,
    sum(sales_cnt) over (order by date) as cum_sales_cnt,
    sum(volume) over (order by date) as cum_volume from flow.core.ez_nft_sales s join min1 m on s.block_timestamp::Date = m.p_date
    where nft_collection in ('A.0b2a3299cc857e29.TopShot')
    and tx_succeeded = 'TRUE'
    GROUP by 1,3 ORDER by 1 ASC
    limit 7), min6 as (
    select BLOCK_TIMESTAMP::date as date,
    row_number () over (order by date) as day_rank,
    'NFL AllDay' as collection, COUNT(DISTINCT tx_id) as sales_cnt,
    Run a query to Download Data