Solana Protobuf Streams
You can find the schema here.
Remember that Solana blocks are produced with a target block time of 400ms, in practice resulting in high throughput of approximately 4,000 transactions per second while achieving a theoretical maximum of 65,000 transactions per second (TPS).
Structure of On-Chain Data
The Solana Protobuf Streams provide three main message types for different use cases:
BlockMessage
: Basic blocks, transactions, and rewardsTokenBlockMessage
: Focused on token transfers and currency metadataDexParsedBlockMessage
: Specialized for DEX (Decentralized Exchange) activity
Block-Level Data
Each block in the stream includes a BlockHeader
with fields such as:
Slot
: The slot number for this blockHash
: The unique identifier of the blockParentSlot
: The previous slot in the chainHeight
: The block heightTimestamp
: The Unix timestamp when this block was producedParentHash
: The hash of the parent block
Transaction-Level Data
Transactions across all stream types share common elements:
Signature
: The transaction's unique signatureStatus
: The execution status (Success/Error)Header
: Transaction metadata including fees and signersIndex
: Position within the block
Transactions contain various types of instructions, which are the core of Solana's execution model:
ProgramAccountIndex
: The program being calledData
: Encoded instruction dataAccountIndexes
: Accounts referenced by this instructionBalanceUpdates
: SOL balance changes from this instruction
Token Data
The TokenBlockMessage
stream provides detailed information about token transfers and balances:
Transfer
: Records token movements with:Amount
: Number of tokens transferredSender
: Source accountReceiver
: Destination accountAuthority
: Account authorizing the transferCurrency
: Detailed token information
Currency
: Rich metadata for each token, including:Name
,Symbol
,Decimals
MintAddress
: Token's mint accountMetadataAddress
: Metadata program accountTokenCreators
: Original creators of the token- NFT properties like
SellerFeeBasisPoints
andTokenStandard
DEX (Decentralized Exchange) Data
The DexParsedBlockMessage
stream is specialized for decentralized exchange activity:
DexInfo
: Details about the exchange programProgramAddress
: Address of the DEX programProtocolName
: Name of the DEXProtocolFamily
: Family of DEX protocols
DexTradeEvent
: Records of trades executed on DEXsBuy
/Sell
: Trade sides with amounts and accountsMarket
: The trading pair informationFee
: Transaction feeRoyalty
: Creator royalties paid
PoolLiquidityChangeEvent
: Records changes to liquidity poolsBaseCurrency
/QuoteCurrency
: The pool's assetsChangeAmount
: Amount added or removed
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:
solana.transactions.proto
solana.tokens.proto
solana.dextrades.proto
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.