Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 3.79 KB

blocks.md

File metadata and controls

39 lines (25 loc) · 3.79 KB
description
The core EVM blockchain data collection

Blocks

Availability

{% hint style="success" %} This collection is available for Ethereum, Polygon, Arbitrum, and Base. {% endhint %}

Points-of-Presence Tables
eu-west-1

evm_blocks_ethereum_mainnet_v1
evm_blocks_arbitrum_mainnet_v1
evm_blocks_polygon_mainnet_v1
evm_block_base_mainnet_v1

Table Schema

Column NameColumn TypeDescription
chain_namestringName of the chain (eg: ethereum, arbitrum, polygon, ...)
chain_network_namestringName of the network (eg: mainnet)
hashstringBlock hash encoded as binary string
numberuint64Block height
parent_hashstringHash of the block's parent
transactions_rootstringRoot of the transaction trie of the block
state_rootstringRoot of the final state trie of the block
receipts_rootstringRoot of the receipts trie of the block
minerstringAddress to whom the mining rewards were sent
difficultyuint256Difficulty for this block
total_difficultyuint256Total difficulty of the chain until this block
sizeuint32Size of this block in bytes
extra_datastringExtra data field of the block
gas_limituint32Maximum gas allowed in the block
gas_useduint32Total used gas by all transactions in the block
timestampdatetimeUNIX timestamp for when the block was formed
base_fee_per_gasuint64Base fee per gas consumed in the block
transaction_countuint32Number of transactions in the block
transaction_effective_gas_price[]uint64Effective gas price for each transaction in the block
transaction_gas_used[]uint32Eas used for each transaction in the block
transaction_status[]uint16Transaction status for each transaction in the block
transaction_type[]uint16Transaction type for each transaction in the block

Usage

The query below make use of the evm_blocks_ethereum_mainnet_v1 table to compute the average gas price per hour for the last 24 hours.

select
    date_trunc('hour', timestamp) as ts,
    avg(arrayAvg(transaction_effective_gas_price)) as avg_gas_price
from
    evm_blocks_ethereum_mainnet_v1
where timestamp >= now() - interval 24 hour
group by ts
order by ts