permary Transaction fees
    Updated 4 days ago
    with fees as (
    select
    date(closed_at) as day,
    sum(fee_charged / 1e7) as daily_fees
    from stellar.core.fact_transactions
    where block_timestamp >= current_date - interval '1 month'
    group by day
    ),

    price as (
    select
    date_trunc('day', hour) as day,
    avg(price) as avg_daily_price
    from crosschain.price.ez_prices_hourly
    where symbol = 'XLM'
    and blockchain = 'stellar'
    and is_native = TRUE
    and hour >= current_date - interval '1 MONTH'
    group by day
    ),

    daily_fees_usd as (
    select
    f.day,
    f.daily_fees,
    p.avg_daily_price,
    f.daily_fees * p.avg_daily_price as daily_fees_usd
    from fees f
    join price p on f.day = p.day
    )

    select
    day,
    round(daily_fees_usd, 2) as daily_fees_usd,
    -- 7-day moving average
    Last run: 4 days ago
    DAY
    DAILY_FEES_USD
    MA_7D
    MA_14D
    MA_30D
    1
    2025-03-13 00:00:00.000589.051097.86907.97804.77
    2
    2025-03-12 00:00:00.0001060.261153.04889.58812.48
    3
    2025-03-11 00:00:00.0001113.791099.29854.81803.3
    4
    2025-03-10 00:00:00.0001824.421031.05840.2791.36
    5
    2025-03-09 00:00:00.0001219.21895.6770.76750.03
    6
    2025-03-08 00:00:00.000917.18842.03723.97730.48
    7
    2025-03-07 00:00:00.000961.1778.32695.39722.37
    8
    2025-03-06 00:00:00.000975.34718.08673.12711.52
    9
    2025-03-05 00:00:00.000684626.12678.79698.95
    10
    2025-03-04 00:00:00.000636.08610.33669.46699.7
    11
    2025-03-03 00:00:00.000876.31649.35673.94703.05
    12
    2025-03-02 00:00:00.000844.2645.91638.9693.42
    13
    2025-03-01 00:00:00.000471.17605.92629.18684.55
    14
    2025-02-28 00:00:00.000539.42612.46639.86697.89
    15
    2025-02-27 00:00:00.000331.63628.17671.71708.45
    16
    2025-02-26 00:00:00.000573.47731.46735.37735.37
    17
    2025-02-25 00:00:00.000909.23728.6747.82747.82
    18
    2025-02-24 00:00:00.000852.26698.52734.37734.37
    19
    2025-02-23 00:00:00.000564.24631.89723.66723.66
    20
    2025-02-22 00:00:00.000516.96652.44739.6739.6
    29
    2KB
    8s