MoDeFi#NEAR Q5- Performance 4
    Updated 2022-07-20
    with flow_succeeded_txs as
    (select BLOCK_TIMESTAMP::date as date, count(*) as succeeeded_txs
    from flow.core.fact_transactions
    where TX_SUCCEEDED=TRUE and BLOCK_TIMESTAMP>='2021-09-01'
    group by 1),

    flow_failed_txs as
    (select BLOCK_TIMESTAMP::date as date, count(*) as flow_failed_txs
    from flow.core.fact_transactions
    where TX_SUCCEEDED=FALSE and BLOCK_TIMESTAMP>='2021-09-01'
    group by 1),

    daily_fees as (
    select BLOCK_TIMESTAMP::date as date, sum(fee_amount) as flow_fee
    from (
    select BLOCK_TIMESTAMP, TRANSACTION_RESULT:events[ARRAY_SIZE(TRANSACTION_RESULT:events)-1]:value:fields[0] as fee_amount
    from flow.core.fact_transactions
    where fee_amount is not null and BLOCK_TIMESTAMP>='2021-09-01')
    group by date
    ),


    daily_users as (
    select BLOCK_TIMESTAMP::date as date, count(distinct PROPOSER) as flow_users
    from flow.core.fact_transactions
    where BLOCK_TIMESTAMP>='2021-09-01'
    group by date
    ),


    unique_users as (
    select min_date::date as date, count(distinct PROPOSER) as flow_unique_users
    from
    (select PROPOSER, min(BLOCK_TIMESTAMP) as min_date
    from flow.core.fact_transactions
    where BLOCK_TIMESTAMP>='2021-09-01'
    Run a query to Download Data