banbannardTrending NFT Projects
    Updated 2022-06-12
    with base1 as (select
    date_trunc('day', block_timestamp) as day,
    sum(price) as vol_usd
    from flow.core.fact_nft_sales
    where tx_succeeded = 'TRUE'
    and day >= '2022-05-09'
    and currency != 'A.1654653399040a61.FlowToken'
    group by 1),

    base2 as (select
    date_trunc('day', block_timestamp) as day,
    sum(price) as vol_flow
    from flow.core.fact_nft_sales
    where
    tx_succeeded = 'TRUE'
    and day >= '2022-05-09'
    and currency = 'A.1654653399040a61.FlowToken'
    group by 1),

    base3 as (select date_trunc('day', timestamp) as day,
    avg(price_usd) as price_flow
    from flow.core.fact_prices
    where day >= '2022-05-09'
    group by 1),

    base4 as (select a.day,
    price_flow * vol_flow as usd_vol_flow
    from base2 a
    join base3 b
    on a.day = b.day)

    select a.day,
    vol_usd,
    usd_vol_flow,
    vol_usd + usd_vol_flow as total_vol
    from base1 a
    Run a query to Download Data