zanglangMy IBC Fees (ATOM) by Month
    Updated 2023-09-20
    -- forked from My IBC Fees (ATOM) @ https://flipsidecrypto.xyz/edit/queries/b5c3c44b-da40-4120-a8dc-986cab2aa9db

    with my_txs as (
    select
    tx_id,
    tx_from,
    block_timestamp,
    fee / pow(10, 6) as fee_amount
    from cosmos.core.fact_transactions
    where
    tx_from IN ('cosmos1p7d8mnjttcszv34pk2a5yyug3474mhffasa7tg', 'cosmos1nna7k5lywn99cd63elcfqm6p8c5c4qcug4aef5')
    and block_timestamp >= CURRENT_DATE - interval '{{ day }} day'
    and fee_denom LIKE '%uatom'
    )
    select date_trunc('mm', block_timestamp)::date as date,
    tx_from as address,
    sum(fee_amount) as tokens_spent
    from my_txs
    group by 1, 2

    Run a query to Download Data