Skip to main content

Bitquery Protobuf Kafka Package

A Python library containing pb2 files to simplify parsing blockchain data (Solana, EVM, Tron, TON, UTXO, Hyperliquid) and market/trading data from Bitquery Kafka Streams using Protobuf messages.

Read more on Bitquery onchain data streams here

Installation

Install easily via pip:

pip install bitquery-pb2-kafka-package

Usage

You can import and use the protobuf-generated Python classes like this:

▶️ Price Index / Market

Read about the new price index stream here

from market import price_index_pb2, trades_pb2, marketdata_pb2

# Price index updates (currency, token, and pair price updates)
price_feed = price_index_pb2.PriceIndexMessage()

# Trades stream
trades_msg = trades_pb2.TradesMessage()

▶️ Solana

from solana import block_message_pb2

# Create a Solana BlockMessage instance
block_message = block_message_pb2.BlockMessage()

# Set fields
block_message.field_name = "value"

# Serialize to bytes
serialized = block_message.SerializeToString()

# Deserialize from bytes
msg = block_message_pb2.BlockMessage()
msg.ParseFromString(serialized)

print(msg)

▶️ EVM

from evm import block_message_pb2

# Create an EVM BlockMessage instance
evm_block = block_message_pb2.BlockMessage()

# Set fields
evm_block.field_name = "value"

# Serialize and Deserialize
data = evm_block.SerializeToString()
decoded = block_message_pb2.BlockMessage()
decoded.ParseFromString(data)

print(decoded)

▶️ Tron

from tron import block_message_pb2

# Create a Tron BlockMessage instance
tron_block = block_message_pb2.BlockMessage()

# Set fields
tron_block.field_name = "value"

# Serialize and Deserialize
data = tron_block.SerializeToString()
decoded = block_message_pb2.BlockMessage()
decoded.ParseFromString(data)

print(decoded)

▶️ Hyperliquid

from hyperliquid import hyperliquid_block_message_pb2

# One message per HyperCore block: trades, orders, funding, liquidations,
# TWAPs, book updates, oracle prices, leverage changes, and signed actions
msg = hyperliquid_block_message_pb2.HyperliquidCoreBlockMessage()
msg.ParseFromString(serialized)

for trade in msg.Trades:
    print(trade)

Available Protobuf Messages

Price Index / Market

  • price_index_pb2.PriceIndexMessage — top-level message with CurrencyUpdates, TokenUpdates, and PairUpdates
  • price_index_pb2.PairUpdate — pair-level price update with market, currency, token, and price data
  • price_index_pb2.CurrencyUpdate — currency-level price update
  • price_index_pb2.TokenUpdate — token-level price update with ranking
  • trades_pb2.TradesMessage — stream of trades with pair, amounts, price, trader, and transaction info
  • trades_pb2.Trade — individual trade with Side (Buy/Sell), Price, PriceInUsd, and amounts
  • marketdata_pb2.MarketdataMessage — currency price buckets from external sources (e.g. CryptoRank)

Solana

  • block_message_pb2.BlockMessage
  • dex_block_message_pb2.DexBlockMessage
  • ohlc_message_pb2.OhlcMessage
  • parsed_idl_block_message_pb2.ParsedIdlBlockMessage
  • token_block_message_pb2.TokenBlockMessage
  • perpetual_block_message_pb2.PerpetualBlockMessage — perpetual DEX activity (ParsedPerpetualTransaction, PerpetualAsset, PerpetualAmount)
  • prediction_market_block_message_pb2.PredictionMarketBlockMessage — prediction market activity (ParsedPredictionTransaction, OutcomeTrade, OutcomeSettlement)
  • solana.corecast — CoreCast gRPC stream definitions (corecast_pb2, request_pb2, stream_message_pb2)

EVM

  • block_message_pb2.BlockMessage
  • dex_block_message_pb2.DexBlockMessage
  • parsed_abi_block_message_pb2.ParsedAbiBlockMessage
  • token_block_message_pb2.TokenBlockMessage
  • dex_pool_block_message_pb2.DexPoolBlockMessage
  • prediction_market_block_message_pb2.PredictionMarketBlockMessage

Tron

  • block_message_pb2.BlockMessage
  • dex_block_message_pb2.DexBlockMessage
  • parsed_abi_block_message_pb2.ParsedAbiBlockMessage
  • token_block_message_pb2.TokenBlockMessage

TON

  • block_message_pb2.BlockMessage
  • dex_block_message_pb2.DexBlockMessage
  • event_message_pb2.EventMessage
  • token_block_message_pb2.TokenBlockMessage
  • trace_message_pb2 — transaction trace messages

UTXO (Bitcoin-like chains)

  • block_message_pb2.BlockMessage
  • parsed_block_message_pb2.ParsedBlockMessage

Hyperliquid (HyperCore)

  • hyperliquid_block_message_pb2.HyperliquidCoreBlockMessage — one message per HyperCore block, covering all market kinds (perp, HIP-3, spot, outcome) with fields Trades, Orders, Funding, Liquidations, Twaps, BookUpdates, Prices, LeverageChanges, and SignedActions
  • fills_pb2 — trade fills
  • order_statuses_pb2 — order status updates
  • twap_statuses_pb2 — TWAP order statuses
  • raw_book_diffs_pb2 — raw order book diffs
  • oracle_updates_pb2 — oracle price updates
  • core_writer_actions_pb2 — core writer actions
  • misc_events_pb2 — funding, liquidations, and other misc events
  • transactions_pb2 — consensus-stream transactions (leverage changes, signed actions)
  • hypercore_pb2, candles_pb2 — supporting HyperCore types and candles

Offchain

  • entities_pb2 — offchain entity definitions (addresses, chains, groups)

Metadata

Release files for bitquery-pb2-kafka-package 0.2.34

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bitquery-pb2-kafka-package 0.2.34
File Size Uploaded Provenance
bitquery_pb2_kafka_package-0.2.34.tar.gz 37.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bitquery-pb2-kafka-package 0.2.34
File Interpreter ABI Platform
bitquery_pb2_kafka_package-0.2.34-py3-none-any.whl Python 3 none any Details

Total release size: 112.4 kB

Release files / bitquery_pb2_kafka_package-0.2.34.tar.gz

Download URL bitquery_pb2_kafka_package-0.2.34.tar.gz
Size 37.2 kB
Tags Source
SHA-256 checksum
How to use checksums
461125e8ed579568a4679da96c19f10339d2696f18d97a768a51a34148ec5add
BLAKE2b-256 checksum
How to use checksums
389aca341d5e32a7cb675f7b7d836b36457d326a2b0f653a3aadcfbe4f5a1a1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.20

Release files / bitquery_pb2_kafka_package-0.2.34-py3-none-any.whl

Download URL bitquery_pb2_kafka_package-0.2.34-py3-none-any.whl
Size 75.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c11bd3c0ee2db73a135ef3fb44d5b8e16409b3ec06febe5618609052623305c
BLAKE2b-256 checksum
How to use checksums
56497ca91cf67d0e4562e51a0f42eaa1e10a56f4bec0d8c1a6bd34242256a668
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.20

Security for bitquery-pb2-kafka-package 0.2.34

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.34 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page