alleria[StarkNet] Layer 2 Blocks FEES
    Updated 2022-06-29
    WITH blocks_accepted_on_ETH as (
    SELECT
    *
    FROM tokenflow_starknet.decoded.blocks
    WHERE chain_id = 'mainnet'
    ORDER BY block_number ASC
    LIMIT 2887
    ),

    first_block_date as (
    SELECT
    timestamp
    FROM tokenflow_starknet.decoded.blocks
    WHERE chain_id = 'mainnet'
    AND block_number = 1
    )

    SELECT
    avg(tx_fee) as average_tx_fee,
    MEDIAN(tx_fee) as median_tx_fee
    FROM ethereum.core.fact_transactions
    WHERE block_timestamp > (SELECT min(timestamp) FROM first_block_date)
    AND tx_fee > 0 AND tx_fee is not NULL
    --WHERE tx_hash = lower('0xb1cc1679456ab87570f992a975d77ba7fb93914c5dda3d9f49f2b22a2d3f30f6')

    --SELECT
    -- COUNT(block_number) as total_number_blocks,
    -- SUM(tx_count) as total_number_of_tx
    --FROM blocks_accepted_on_ETH
    Run a query to Download Data