LTirrellfees_with_percentiles test
    Updated 2023-08-11
    -- forked from fees_with_percentiles @ https://flipsidecrypto.xyz/edit/queries/e70e50fb-3a78-40b9-adc4-debb1888967f

    -- select
    -- date(block_timestamp) as date,
    -- count(distinct tx_id) as txs,
    -- sum(fee) * POWER(10,-9) as total_fees_paid,
    -- (total_fees_paid / txs) as "Average"
    -- from
    -- solana.core.fact_transactions
    -- where
    -- date(block_timestamp) between current_date() -31
    -- and current_date() -1
    -- group by
    -- 1
    -- order by date desc

    with x as (select
    block_timestamp::date as date,
    sum(num_votes * 5000) / pow(10,9) as total_fees_paid,
    sum(num_votes) as votes
    from solana.core.fact_votes_agg_block
    where
    date(block_timestamp) between current_date() -31 and current_date() -1
    group by date
    order by date desc)
    select sum(total_fees_paid), sum(votes) from x
    Run a query to Download Data