StangFAST08 - compare NFT 02
    Updated 2023-05-02
    -- forked from 05 - compare NFT @ https://flipsidecrypto.xyz/edit/queries/7ea5493b-77e9-45fd-8b79-725813fdf554

    -- forked from 02 - week dapper studio @ https://flipsidecrypto.xyz/edit/queries/f7068392-198b-4603-bb35-d19cae3e957c

    -- -- -- forked from 01 - daily dapper wallet @ https://flipsidecrypto.xyz/edit/queries/07f49a66-5790-4935-9181-9163a838b6c0

    with flow_price AS
    (
    SELECT
    date_trunc( 'day' , a.recorded_hour ) AS day
    , avg( a.close ) AS price_usd
    FROM
    flow.core.fact_hourly_prices a
    WHERE
    a.token = 'Flow'
    GROUP BY
    1
    )

    ,

    NFT_fLOW AS
    (
    SELECT
    count( DISTINCT date_trunc( 'day' , a.block_timestamp ) ) AS date

    --- count ---
    , count( DISTINCT a.tx_id ) AS transaction
    , count( DISTINCT a.proposer ) AS users
    , sum( b.price ) AS usd_volume
    , sum( ( a.gas_limit / power( 10 , 8 ) ) * d.price_usd ) AS fees

    --- name ---
    , ' NBA Top Shot ' AS nft
    , ' FLOW ' AS chain

    Run a query to Download Data