Yousefi_1994Gas Guzzlers - Algorand Hourly Average Block Gas Price
    Updated 2022-11-15
    -------------------------------------algorand-------------------------------------
    with algorand_fee_transactions as (
    select
    block_timestamp,
    tx_id as tx_hash,
    block_id as block_number,
    fee,
    tx_sender as from_address
    from algorand.core.fact_transaction
    where block_timestamp::date > current_date - 31
    ),
    algo_price_usd as (
    select
    block_hour::date as days,
    avg(price_usd) as price_usd
    from algorand.core.ez_price_pool_balances
    where asset_id = 0
    and block_hour::date > current_date - 31
    group by days
    ),
    algorand_fee_transactions_with_price as (
    select
    gas.*,
    price.price_usd
    from algorand_fee_transactions gas
    join algo_price_usd price
    on gas.block_timestamp::date = price.days
    ),
    algorand_fee_transactions_fix_price as (
    select
    *,
    fee * price_usd as fee_spent
    from algorand_fee_transactions_with_price
    ),
    algorand_final_result as (
    Run a query to Download Data