MasiMonthly Total Transaction Fee Per Quarter (Near)
    Updated 2024-12-21
    select trunc(block_timestamp,'month') as monthly,
    case when block_timestamp::date >= '2023-01-01' and block_timestamp::date < '2023-04-01' then 'Q1-2023'
    when block_timestamp::date >= '2023-04-01' and block_timestamp::date < '2023-07-01' then 'Q2-2023'
    when block_timestamp::date >= '2023-07-01' and block_timestamp::date < '2023-10-01' then 'Q3-2023'
    when block_timestamp::date >= '2023-10-01' and block_timestamp::date < '2024-01-01' then 'Q4-2023'
    when block_timestamp::date >= '2024-01-01' and block_timestamp::date < '2024-04-01' then 'Q1-2024'
    when block_timestamp::date >= '2024-04-01' and block_timestamp::date < '2024-07-01' then 'Q2-2024'
    when block_timestamp::date >= '2024-07-01' and block_timestamp::date < '2024-10-01' then 'Q3-2024'
    when block_timestamp::date >= '2024-10-01' and block_timestamp::date < '2025-01-01' then 'Q4-2024' end as breakdown,
    sum(TRANSACTION_FEE/pow(10,24)) as "Fees (NEAR)"
    from near.core.fact_transactions
    where tx_succeeded = 'TRUE'
    and block_timestamp::Date >= '2023-01-01'
    group by 1,2
    QueryRunArchived: QueryRun has been archived