CryptoIcicle6.Solana-Solana Fees
    Updated 2022-02-05
    -- Question 6: One of the main advantages for a user of Solana is the extremely low fees relative to other blockchains.
    -- Create a visualization showing transaction fees per day accumulated since the beginning of January.
    -- Also create a visualization that shows transaction fees per transaction on each day.
    -- Do fees ever seem to spike or is it consistent?

    -- Payout 0.47 SOL
    -- Grand Prize 1.41 SOL
    -- Level Beginner


    with solana_txns as (
    select
    block_timestamp,
    tx_id,
    fee
    from solana.transactions
    where block_timestamp >= '2022-01-01'
    limit 2000000000
    )

    select
    date_trunc('day',block_timestamp) as date,
    count(tx_id) as transction_frequency,
    sum(fee)/pow(10,9) as total_daily_fee,
    max(fee)/pow(10,9) as max_daily_fee,
    min(fee)/pow(10,9) as min_daily_fee,
    median(fee)/pow(10,9) as median_daily_fee,
    total_daily_fee/transction_frequency as avg_daily_fee,
    sum(total_daily_fee) over (order by date asc rows between unbounded preceding and current row) as cumulative_fee
    from solana_txns
    group by date
    order by date desc
    Run a query to Download Data