Elprognerd2 - month activity copy
    Updated 2023-06-04
    with txs AS (
    SELECT
    x.BLOCK_TIMESTAMP as BLOCK_TIMESTAMP,
    x.TX_ID as tx,
    x.PROPOSER as user,
    y.EVENT_TYPE as type,
    y.EVENT_CONTRACT
    FROM flow.core.fact_transactions x JOIN flow.core.fact_events y ON x.TX_ID = y.TX_ID
    WHERE x.TX_SUCCEEDED = 'true'
    )

    SELECT
    date_trunc('month', BLOCK_TIMESTAMP) as date,
    count( DISTINCT tx) as "Number of monthly txns",
    sum("Number of monthly txns") over (ORDER by date) as "Cumulative number of txns",
    count(DISTINCT user) as "Number of monthly active users",
    "Number of monthly txns"/"Number of monthly active users" as "Average number of txns per user"
    from txs
    GROUP BY 1
    ORDER BY 1


    Run a query to Download Data