TheLaughingManspecial gas - relative wallet rank
    Updated 2025-02-20
    -- forked from special gas - leaderboard @ https://flipsidecrypto.xyz/studio/queries/83dcf822-1bc2-46b9-aef1-c650d475b469

    -- forked from special gas - over time @ https://flipsidecrypto.xyz/studio/queries/f4d9a46a-86d0-400e-a6f8-ae8e30a6c748

    -- 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
    )

    , aggr as (
    SELECT
    wallet
    , SUM(amount) as mon_gas_totals
    , COUNT(DISTINCT tx_hash) as payout_txns
    from gas_base
    GROUP BY 1
    ORDER BY 2 DESC
    )

    SELECT
    *
    Last run: 2 months ago
    WALLET
    MON_GAS_TOTALS
    PAYOUT_TXNS
    RANK
    1
    0x2ec19e982172ead28b312a07faf25105fb3747d810.005379964279
    1
    66B
    1s