MostlyData_Solana Stats - Fee vs time (global)
    Updated 2025-03-10
    -- forked from Solana Stats - Fee rewards distribution vs time @ https://flipsidecrypto.xyz/studio/queries/02fadac4-c64d-41dc-9d25-3a4634a83263

    with date_filter as (
    select
    case
    when '{{n_days}}' != 0 then current_date() - interval '{{n_days}} days'
    else cast('{{start_date}}' as timestamp)
    end as start_date,
    case
    when '{{n_days}}' != 0 then current_date()
    else cast('{{end_date}}' as timestamp)
    end as end_date
    )

    ,txs_info as(
    select
    rf.tx_id,
    date_trunc('hour',rf.block_timestamp) as dt,
    rf.fee * pow(10,-9) as fee

    from solana.core.fact_transactions rf
    join date_filter df
    on rf.block_timestamp between df.start_date and df.end_date
    )

    ,group_fee_rewards as(
    select
    dt,
    percentile_cont(0.25) within group (order by fee) as p25,
    percentile_cont(0.5) within group (order by fee) as p50,
    percentile_cont(0.95) within group (order by fee) as p95

    from txs_info
    group by dt
    Last run: about 1 month ago
    DT
    P25
    P50
    P95
    1
    2025-03-05 08:00:00.0000.0000050.0000055290.000105
    2
    2025-02-25 13:00:00.0000.0000050.0000056650.000115
    3
    2025-02-18 20:00:00.0000.0000050.00000770.000182154
    4
    2025-02-19 09:00:00.0000.0000050.00000530.000105
    5
    2025-02-20 06:00:00.0000.0000050.0000060.0001175
    6
    2025-03-07 20:00:00.0000.0000050.0000074810.000278338
    7
    2025-02-24 05:00:00.0000.0000050.0000059240.0001118935
    8
    2025-03-04 02:00:00.0000.0000050.0000062180.00011735335
    9
    2025-03-09 13:00:00.0000.0000050.00000560.0001
    10
    2025-03-01 15:00:00.0000.0000050.00000550.000105
    11
    2025-02-13 03:00:00.0000.0000050010.0000084170.00041
    12
    2025-02-19 14:00:00.0000.0000050.0000059580.0001689817
    13
    2025-02-24 14:00:00.0000.0000050.0000059240.000125
    14
    2025-03-04 19:00:00.0000.0000050.0000055460.000105
    15
    2025-02-20 02:00:00.0000.0000050.0000066260.0002325
    16
    2025-02-26 09:00:00.0000.0000050.0000067360.000105
    17
    2025-02-25 07:00:00.0000.0000050.0000078380.0002730659
    18
    2025-02-22 02:00:00.0000.0000050.0000060.000205
    19
    2025-02-16 13:00:00.0000.0000050.0000070170.000146068
    20
    2025-03-09 12:00:00.0000.0000050.0000056340.000088266
    ...
    721
    42KB
    395s