TheLaughingManspecial gas - over time
    Updated 2025-02-19
    -- forked from special gas - overview @ https://flipsidecrypto.xyz/studio/queries/a3005985-08d8-45d0-9508-af694e68c37f

    with gas_base as (
    SELECT
    tx_hash
    , block_number
    , block_timestamp
    , TO_ADDRESS as wallet
    , VALUE as amount
    --, row_number() OVER (partition by to_address ORDER BY tx_hash DESC) as rank
    from monad.testnet.fact_traces
    WHERE 1=1
    --AND tx_hash = '0xdac05244373d466d547690ecaf151b3a3a1d6365a520c68528e8a83681dc7351'
    AND origin_to_address = '0x9fb480a193c250bf8ece39df5d9d728e21026b34'
    AND origin_function_signature = '0x7a53bcfc'
    AND TX_SUCCEEDED
    AND trace_index>=1
    AND block_number<4000000
    )

    SELECT
    date_trunc('minute', block_timestamp) as dmin
    , COUNT(distinct wallet) as users
    , SUM(amount) as total_mon
    , SUM(total_mon) OVER (ORDER BY dmin ASC) as mon_cumulative
    , SUM(users) OVER (ORDER BY dmin ASC) as users_cumulative
    from gas_base
    GROUP BY 1
    ORDER BY 1 ASC


    QueryRunArchived: QueryRun has been archived