AI WaifuOps Wallet Gas Fees Daily Consumption
    Updated 2024-05-30
    -- The Ops wallet pays for gas fees for any in-game txns.

    with all_spend_txns as (
    select
    block_timestamp,
    date_trunc('day', block_timestamp) as date_time,
    tx_hash,
    tx_fee,
    gas_price,
    gas_price / power (10, 9) as gas_price_eth,
    tx_fee + gas_price / power (10, 9) as ttl_fees_eth
    -- from blast.core.fact_event_logs
    from blast.core.fact_transactions
    where true
    -- if only read from_address then it's gas spent, if include to_address then it's the top ups from the team.
    and from_address = '0x5386946c2e9c26252b066341a5333b1f39e12a9a'
    -- and tx_hash = '0x5cbe37eaf3411799cb2c2bbebb959efd484497ce51311420fc3f0eaf20ea8a7f'
    )

    -- select date_time, sum(tx_fee) as tx_fee, sum(gas_price_eth) as gas_fee, sum(ttl_fees_eth) as ttl_fee
    select date_time, sum(ttl_fees_eth) as ttl_fee
    from all_spend_txns
    where ttl_fees_eth is not null
    group by 1
    order by date_time asc

    -- select sum(tx_fee) as tx_fee, sum(gas_price_eth) as gas_fee, sum(ttl_fees_eth) as ttl_fee
    -- from all_spend_txns
    QueryRunArchived: QueryRun has been archived