Protobuf Schema Repository
Official ChainStream Protobuf Schema definitions, supporting Go and Python, including all message types for EVM, Solana, and TRON.
Support Matrix
| Chain | dex.trades | tokens | balances | dex.pools | transfers | candlesticks |
|---|---|---|---|---|---|---|
| Ethereum (eth) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| BSC (bsc) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Solana (sol) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| TRON (tron) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
All chains also support
token-supplies, token-prices, token-holdings, token-market-caps, trade-stats Topics. See full Topic list for details.Kafka Streams vs WebSocket Selection Guide
When to Choose Kafka Streams
Latency Sensitive
Latency is the primary concern, application deployed on cloud or dedicated servers
Message Reliability
Cannot accept losing any messages, requires durable and reliable data consumption
Complex Processing
Need to perform complex computation, filtering, or formatting beyond pre-processing capabilities
Horizontal Scaling
Need multi-instance horizontal scaling for consumption capacity
When to Choose WebSocket
Rapid Prototyping
Building prototypes, development speed is the primary factor
Unified Interface
Application needs both historical and real-time data with unified query and subscription interface
Browser-side
Application consumes data directly in browser (Kafka Streams only supports server-side)
Dynamic Filtering
Need to dynamically filter data based on page content
Comparison Summary
| Feature | Kafka Streams | WebSocket |
|---|---|---|
| Latency | Lowest | Low |
| Reliability | Persistent, no message loss | May lose on disconnect |
| Scalability | Native horizontal scaling | Requires additional design |
| Data Filtering | Client-side processing | Server-side pre-filtering |
| Client Support | Server-side only | Server + Browser |
| Integration Complexity | Higher | Lower |
Credential Acquisition
Kafka Streams uses independent authentication credentials and requires contacting the ChainStream team to apply for access.Contact to Apply
Send an email to [email protected] to apply for Kafka Streams access
Receive Credentials
After approval, you will receive the following credential information:
- Username
- Password
- Broker address list
Connection Configuration
Broker Address
The Broker address will be provided along with your credentials after your application is approved. Do not use any unauthorized addresses for connection.
SASL_SSL Connection Configuration
- Python
- JavaScript
- Go
Topic Naming Convention & Complete List
Naming Convention
Topics follow this naming pattern:{chain} includes: sol, bsc, eth, tron
Message Types
| Type | Description |
|---|---|
dex.trades | DEX trade events |
dex.pools | Liquidity pool events |
tokens | Token events |
balances | Balance change events |
transfers | Transfer events |
token-supplies | Token supply events |
token-prices | Token price events |
token-holdings | Token holding data |
token-market-caps | Token market cap events |
candlesticks | OHLCV candlestick data |
trade-stats | Trade statistics |
Complete Topic List
- Cross-Chain Topics
- Solana Specific
- EVM Specific
- TRON Specific
The following Topics apply to all supported chains (replace
{chain} with sol, bsc, eth):Consumption Modes & Offset Management
Two core configurations to consider when subscribing to topics:Offset Strategy Selection
Consumers need to decide where to start reading messages after connecting to Kafka. Two common strategies:- Consume Latest Only
- Persistent Consumption
Start from the current latest position on each connection, suitable for scenarios only caring about real-time data. No historical message replay on reconnection.
Group ID Rules
Deploying multiple instances with the same Group ID enables failover and load balancing—messages from the same topic will only be consumed by one instance in the Group, with Kafka automatically distributing partitions among instances.Quick Start: First Consumer in 5 Minutes
The following example shows how to consume theeth.dex.trades topic and parse DEX trade data.
Get Protobuf Schema
Clone the Schema definitions from the official repository:Or add as a Git submodule to your project:
Core Data Structures
All message types share these base structures (defined incommon/common.proto):
Base Structures
- Block
- Transaction
- Instruction
- DApp
Block information:
| Field | Type | Description |
|---|---|---|
timestamp | int64 | Block timestamp |
hash | string | Block hash |
height | uint64 | Block height |
slot | uint64 | Slot number (Solana) |
Main Message Types
TradeEvent - DEX Trade Events
TradeEvent - DEX Trade Events
Topic: Trade Core Fields:
TradeProcessed Enhanced Fields (processed topic):
{chain}.dex.trades| Field | Description |
|---|---|
token_a_address / token_b_address | Trading pair token addresses |
user_a_amount / user_b_amount | User trade amounts |
pool_address | Pool address |
vault_a / vault_b | Pool vault addresses |
vault_a_amount / vault_b_amount | Vault amounts |
| Field | Description |
|---|---|
token_a_price_in_usd / token_b_price_in_usd | USD price |
token_a_price_in_native / token_b_price_in_native | Native currency price |
is_token_a_price_in_usd_suspect | Is price suspicious |
is_token_a_price_in_usd_suspect_reason | Suspicious reason |
TokenEvent - Token Events
TokenEvent - Token Events
Topic: Token Core Fields:
{chain}.tokens, {chain}.tokens.created| Field | Description |
|---|---|
address | Token address |
name / symbol | Name and symbol |
decimals | Decimals |
uri | Metadata URI |
metadata_address | Metadata address |
creators | Creator list |
solana_extra | Solana-specific fields |
evm_extra | EVM-specific fields (token_standard) |
BalanceEvent - Balance Change Events
BalanceEvent - Balance Change Events
Topic: Balance Core Fields:
{chain}.balances| Field | Description |
|---|---|
token_account_address | Token account address |
account_owner_address | Account owner address |
token_address | Token address |
pre_amount / post_amount | Balance before/after |
decimals | Decimals |
lifecycle | Account lifecycle (NEW/EXISTING/CLOSED) |
DexPoolEvent - Liquidity Pool Events
DexPoolEvent - Liquidity Pool Events
Topic: DexPool Core Fields:
{chain}.dex.pools| Field | Description |
|---|---|
address | Pool address |
token_a_address / token_b_address | Token addresses |
token_a_vault_address / token_b_vault_address | Vault addresses |
token_a_amount / token_b_amount | Token amounts |
lp_wallet | LP wallet address |
CandlestickEvent - Candlestick Data
CandlestickEvent - Candlestick Data
Topic:
{chain}.candlesticks| Field | Description |
|---|---|
token_address | Token address |
resolution | Time resolution (1m, 5m, 15m, 1h, etc.) |
timestamp | Timestamp |
open / high / low / close | OHLC prices (USD) |
open_in_native / high_in_native / low_in_native / close_in_native | OHLC prices (native) |
volume / volume_in_usd / volume_in_native | Volume |
trades | Trade count |
dimension | Dimension type (TOKEN_ADDRESS/POOL_ADDRESS/PAIR) |
TradeStatEvent - Trade Statistics
TradeStatEvent - Trade Statistics
Topic:
{chain}.trade-stats| Field | Description |
|---|---|
token_address | Token address |
resolution | Time resolution |
buys / sells | Buy/sell count |
buyers / sellers | Buyer/seller count |
buy_volume / sell_volume | Buy/sell volume |
buy_volume_in_usd / sell_volume_in_usd | USD volume |
high_in_usd / low_in_usd | High/low price |
TokenHoldingEvent - Holding Statistics
TokenHoldingEvent - Holding Statistics
Topic:
{chain}.token-holdings| Field Group | Description |
|---|---|
top10_holders / top10_amount / top10_ratio | Top 10 holders stats |
top50_holders / top50_amount / top50_ratio | Top 50 holders stats |
top100_holders / top100_amount / top100_ratio | Top 100 holders stats |
holders | Total holders count |
creators_count / creators_amount / creators_ratio | Creators holding stats |
fresh_count / fresh_amount / fresh_ratio | Fresh wallets holding stats |
smart_count / smart_amount / smart_ratio | Smart Money holding stats |
sniper_count / sniper_amount / sniper_ratio | Sniper holding stats |
insider_count / insider_amount / insider_ratio | Insider holding stats |
TokenPriceEvent - Price Events
TokenPriceEvent - Price Events
Topic:
{chain}.token-prices| Field | Description |
|---|---|
token_address | Token address |
price_in_usd | USD price |
price_in_native | Native currency price |
TokenSupplyEvent - Supply Events
TokenSupplyEvent - Supply Events
Topic:
{chain}.token-supplies| Field | Description |
|---|---|
type | Event type (INITIALIZE_MINT/MINT/BURN) |
token_address | Token address |
amount | Amount |
decimals | Decimals |
amount_with_decimals | Amount with decimals |
Message Characteristics & Considerations
Developers need to be aware of the following message characteristics when consuming Kafka Streams:Unfiltered Complete Data Stream
Unfiltered Complete Data Stream
Stream does not pre-filter, containing all messages and complete data within the topic. This means consumers need sufficient network throughput, server performance, and efficient parsing code.
Same Entity Messages Are Ordered
Same Entity Messages Are Ordered
Messages for the same token or same account arrive strictly in block order. This means the event stream for a specific token or wallet address is ordered, making it easy to track state changes. However, message arrival order between different tokens/accounts is not guaranteed.
Messages May Duplicate
Messages May Duplicate
The same message may be delivered multiple times. If duplicate processing causes issues, consumers need to maintain cache or storage for idempotent processing.
Message Integrity Guaranteed
Message Integrity Guaranteed
ChainStream guarantees the integrity of each message. Messages will not be split. Regardless of how many transactions a block contains, the message you receive is a complete data unit.
Protobuf Binary Format
Protobuf Binary Format
Messages use Protobuf encoding, more compact than JSON. Consumers need to use the corresponding language’s Protobuf library for parsing.
Latency Model
Kafka Streams latency depends on the processing stages data passes through in the pipeline. Different topics from the same chain have different latencies:Broadcasted vs Committed
| Type | Description | Latency | Data Certainty |
|---|---|---|---|
| Broadcasted | Transactions consumable at broadcast stage, no block confirmation needed | Lowest | Lower |
| Committed | Transactions enter stream only after block confirmation | Higher | Highest |
Pipeline Latency
Each transformation layer from blockchain node to Kafka topic (parsing, structuring, enrichment) introduces approximately 100-1000ms latency:- raw topic: Lowest latency, closest to raw node data
- transactions topic: Parsed and structured
- dextrades topic: Relatively higher latency, but richer data
Best Practices
Parallel Partition Consumption
Kafka topics are divided into multiple partitions, each partition needs parallel reading to maximize throughput. Message partition keys are set to token address or wallet address (unified across all chains), ensuring:- All events for the same token route to the same partition, guaranteeing order
- All balance changes for the same wallet route to the same partition, facilitating state tracking
Continuous Consumption, Don’t Block Main Loop
Consumer’s read loop should run continuously, avoiding backlog from message processing blocking. If messages need processing, adopt async processing mode: main loop handles reading, processing logic delegated to worker threads.Message Processing Efficiency
Batch processing can reduce overhead, but requires balancing batch size and latency. In Go, use channel + worker group for concurrent processing.Chain-Specific Documentation
EVM Streams
Ethereum, BSC, Base, Polygon, Optimism
Solana Streams
Solana high-throughput data streams
TRON Streams
TRON network data streams

