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.36

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.36
File Size Uploaded Provenance Actions
bitquery_pb2_kafka_package-0.2.36.tar.gz 40.3 kB Without provenance Details for bitquery_pb2_kafka_package-0.2.36.tar.gz

Built distribution (wheel)

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

Total release size: 119.5 kB

Release files / bitquery_pb2_kafka_package-0.2.36.tar.gz

Download URL bitquery_pb2_kafka_package-0.2.36.tar.gz
Size 40.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4a6905221d0d522ce2b17422fb104627c7726d9187b68264c754f9d8e13d7ed1
BLAKE2b-256 checksum
How to use checksums
73008a7661396bdd3890030056503148b16034f4d8a87e1cccd52c4afdf1b421
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.36-py3-none-any.whl

Download URL bitquery_pb2_kafka_package-0.2.36-py3-none-any.whl
Size 79.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a45c521ef808b30eedfae176ba63788c2a035d0e4857b055d35b53095a19e0a5
BLAKE2b-256 checksum
How to use checksums
1034c94f50583d4ba93aba87187acc1f53d2bd944c9e0036fcc8345fc19b368b
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.36

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.36 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