permaryMonthly fee
    Updated 6 days ago
    with fee_data as (
    select
    date_trunc('month', t.closed_at) as month,
    sum(t.fee_charged) as total_fees_charged,
    sum(t.inclusion_fee_bid) as total_inclusion_fee_bid,
    sum(t.inclusion_fee_charged) as total_inclusion_fee_charged,
    sum(t.resource_fee) as total_resource_fee,
    sum(t.resource_fee_refund) as total_resource_fee_refund,
    sum(t.non_refundable_resource_fee_charged) as total_non_refundable_fees,
    sum(t.refundable_resource_fee_charged) as total_refundable_resource_fee,
    sum(t.refundable_fee) as total_refundable_fees,
    sum(t.rent_fee_charged) as total_rent_fees
    from stellar.core.fact_transactions t
    where t.closed_at >= date_trunc('month', current_date) - interval '12 months'
    group by month
    ),
    xlm_prices as (
    select
    date_trunc('month', hour) as month,
    avg(price) as avg_monthly_price
    from stellar.price.ez_prices_hourly
    where blockchain = 'stellar'
    and is_native = true
    and hour >= date_trunc('month', current_date) - interval '12 months'
    group by date_trunc('month', hour)
    )

    select
    f.month,
    (f.total_fees_charged / 10000000.0) * p.avg_monthly_price as total_fees_charged_usd,
    (f.total_inclusion_fee_bid / 10000000.0) * p.avg_monthly_price as total_inclusion_fee_bid_usd,
    (f.total_inclusion_fee_charged / 10000000.0) * p.avg_monthly_price as total_inclusion_fee_charged_usd,
    (f.total_resource_fee / 10000000.0) * p.avg_monthly_price as total_resource_fee_usd,
    (f.total_resource_fee_refund / 10000000.0) * p.avg_monthly_price as total_resource_fee_refund_usd,
    (f.total_non_refundable_fees / 10000000.0) * p.avg_monthly_price as total_non_refundable_fees_usd,
    (f.total_refundable_resource_fee / 10000000.0) * p.avg_monthly_price as total_refundable_resource_fee_usd,
    Last run: 6 days ago
    MONTH
    TOTAL_FEES_CHARGED_USD
    TOTAL_INCLUSION_FEE_BID_USD
    TOTAL_INCLUSION_FEE_CHARGED_USD
    TOTAL_RESOURCE_FEE_USD
    TOTAL_RESOURCE_FEE_REFUND_USD
    TOTAL_NON_REFUNDABLE_FEES_USD
    TOTAL_REFUNDABLE_RESOURCE_FEE_USD
    TOTAL_REFUNDABLE_FEES_USD
    TOTAL_RENT_FEES_USD
    XLM_PRICE
    1
    2025-03-01 00:00:00.00012442.89549692126663.8132814699.54462530613187.320702614764.6459066056815.214067271607.4607290211539.628528860.2868184918
    2
    2025-02-01 00:00:00.00021681.91218657222905.651857917275.0384625714509.6453018416969.1037963344993.4931538612547.0483513152459.9324107260.3308352887
    3
    2025-01-01 00:00:00.00041041.82886012924389.4480539669.99305604719222.819612329888.431197165611.9558405663722.4325745943635.4531269250.432370504
    4
    2024-12-01 00:00:00.00030823.03937273538964.7173054763.79397546515485.322574269142.0457451654171.7549605432171.5218685522113.8203973940.4198686895
    5
    2024-11-01 00:00:00.00022529.2152473846777.7903502960.84630721529167.0603039135349.8847432741676.7063537232140.4692066782104.0727520170.2387946139
    6
    2024-10-01 00:00:00.0003505.6274107653592.6682582990.06339877962451.5738509481760.492016053217.007433333474.074401562471.2680474770.09356786694
    7
    2024-09-01 00:00:00.0002905.5373217713106.6667973213.0786883752093.6107000021616.332944719169.430966367307.846788821305.8103788340.09467687361
    8
    2024-08-01 00:00:00.0005072.2902379193058.5517877280.062148549592207.9328793141711.556193129186.058955361310.317730824305.7284515450.09654593548
    9
    2024-07-01 00:00:00.0005416.8290694443180.2606972830.063141467292273.7515215311734.20442893180.527259519359.018040586357.6005501750.09760924328
    10
    2024-06-01 00:00:00.0005847.8555671623087.5045016890.2512672522028.349765781334.512720265172.664938233521.172107186520.3107350210.09710624028
    11
    2024-05-01 00:00:00.0007173.817483872401.2052778630.0591459567980.75836486646.157437612164.9371132769.663813945768.6841695450.1082367219
    12
    2024-04-01 00:00:00.0008194.3184319352248.6945626980.05119489075675.99574546929.767535268134.292095147511.936115055511.6084071490.1193020385
    13
    2024-03-01 00:00:00.00014891.40383224111626.7272177331309.733826269485.43969678743.345280438121.881960826320.212455523319.7606835610.1372144412
    13
    2KB
    48s