EVM Streams
This section provides details about Bitquery's EVM Streams via Kafka. The top-level Kafka section explains how we use Kafka Streams to deliver data.
You can find the schema here.
EVM blockchains produce blocks at varying intervals depending on the network. Ethereum mainnet targets ~12 seconds per block, while other EVM chains may have different block times.
Structure of On-Chain Data
The EVM Protobuf Streams provide three main message types for different use cases:
BlockMessage: Full blocks with detailed transaction tracesTokenBlockMessage: Focused on token transfers with currency metadataDexBlockMessage: Specialized for DEX (Decentralized Exchange) trading activity
Block-Level Data
Each block in the stream includes a BlockHeader with fields such as:
Hash: The unique identifier of the blockParentHash: Hash of the previous blockNumber: Block number/height in the chainGasLimit: Maximum gas allowed in this blockGasUsed: Actual gas consumed by transactionsTime: Block timestampBaseFee: Base fee per gas (EIP-1559)
The BlockMessage also includes:
Chain: Information about the blockchain (ChainId, Config)Uncles: Uncle/ommer blocks (Ethereum PoW)Transactions: All transactions in the blockL1Header: For Layer 2 chains, information about the corresponding L1 block
Transaction-Level Data
Each transaction in the stream provides detailed information about execution, state changes, and balance updates.
Structure
Each transaction includes:
-
TransactionHeader— Core transaction metadata:Hash— Transaction hashGas— Gas limit for this transactionValue— Amount of native currency transferredData— Call data for contract interactionsFrom/To— Sender and recipient addressesGasPrice,GasFeeCap,GasTipCap— Fee parametersNonce,ChainId— Transaction metadata- Special fields for EIP-4844 blob transactions
-
ReceiptHeader— Execution results:Status— Success or failureGasUsed— Actual gas consumedLogs— Event logs emitted by smart contractsContractAddress— Deployed address for contract creation transactions
-
TransactionFee— Fee information:SenderFee— Total fee paid by the senderMinerReward— Portion rewarded to the validator/minerBurnt— Portion of the fee burned (EIP-1559)GasRefund— Gas refunded due to contract execution
-
Calls— Full internal call trace:- Includes all nested contract calls with fields such as
From,To,Input,Output,GasUsed,Opcode, and parsedSignature - Each call may include
Logs,StateChanges, andReturnValues
- Includes all nested contract calls with fields such as
-
Signature— Cryptographic components:R,S, andVvalues from the transaction’s ECDSA signature
-
TokenBalanceUpdates— Token (ERC-20, ERC-721, ERC-1155) balance updates detected during the transaction:-
Token— Information about the tokenAddress— Token contract addressFungible— Whether the token is fungible (ERC-20) or non-fungible (ERC-721/1155)Decimals— Number of decimal places for fungible tokensTotalSupply— Current total supply recorded
-
Address— Wallet whose balance changed -
PostBalance— Balance after the transaction -
TokenOwnership— For NFTs, indicates ownership details if applicable
-
-
NativeBalanceUpdates— Native currency (e.g., ETH) balance changes detected during the transaction:Address— Wallet whose native balance changedPreBalance— Balance before the transactionPostBalance— Balance after the transactionBalanceChangeReasonCode— Numeric code describing why the balance changed
(see Transaction Balance Tracker documentation for code meanings)
Token Data
The TokenBlockMessage stream provides information about token transfers:
-
TokenTransfer: Records token movements with:Sender: Address sending tokensReceiver: Address receiving tokensAmount: Amount of tokens transferredId: Token ID (for non-fungible tokens)Currency: Detailed token informationSuccess: Whether the transfer succeeded
-
TokenInfo: Metadata about each token:SmartContract: Token contract addressName: Token nameSymbol: Token symbolDecimals: Token decimal placesFungible: Whether token is fungible (ERC-20) or non-fungible (ERC-721/1155)
DEX (Decentralized Exchange) Data
The DexBlockMessage stream specializes in DEX trading activity:
-
DexTrade: Records of trades executed on DEXsBuy/Sell: Both sides of the tradeDex: Information about the exchangeSuccess: Whether the trade succeededFees: Trading fees paid
-
DexInfo: Details about the exchange:SmartContract: Exchange contract addressProtocolName: Name of the protocol (e.g., "Uniswap", "SushiSwap")ProtocolFamily: Family of DEX protocolsProtocolVersion: Version of the protocolPair: Trading pair information
-
TradeSide: Details about each side of a trade:Buyer/Seller: Addresses involvedOrderId: Identifier for the orderAssets: What was traded
Layer 2 Support
EVM Protobuf Streams provide dedicated fields for Layer 2 chains:
L1Header: Corresponding L1 block information- Optimism-specific fields:
SequenceNumber,BatcherAddr,L1FeeOverhead, etc. - Arbitrum-specific fields:
GasL1for L1 data costs
Using This Stream in Python, JavaScript, and Go
Python, JavaScript, and Go code samples can be used with these streams by changing the topic to one of:
eth.transactions.proto->ParsedAbiBlockMessageeth.tokens.proto->TokenBlockMessageeth.dextrades.proto->DexBlockMessageeth.raw.proto(for raw block data) ->BlockMessageeth.broadcasted.transactions.proto(for broadcasted transactions) ->ParsedAbiBlockMessageeth.broadcasted.tokens.proto(for broadcasted token transfers) ->TokenBlockMessageeth.broadcasted.dextrades.proto(for broadcasted DEX trades) ->DexBlockMessageeth.broadcasted.raw.proto(for raw broadcasted block data) ->BlockMessage
The Python package bitquery-pb2-kafka-package includes all schema and is up to date so you don't have to manually install schema files.