DB
Back homeUse case

Blockchain & on-chain analytics

Decode raw blocks into typed, queryable relations and keep counts that are exact — never approximate, never wrong.

The problem

Why this is hard today

On-chain pipelines start with the messiest input in the industry: raw, RLP-encoded blocks and logs that mean nothing until they are decoded against ABIs, reorged when the chain reorganizes, and reconstructed into the entity state a product actually queries.

Teams bolt this together from an indexer, a queue, a transform layer, and a warehouse — and then discover that "how many holders does this token have" returns a different number depending on which copy answered, because approximate counts crept onto the critical path.

For financial-grade on-chain data, the reconstruction has to be temporal (state as of any block), the counts have to be exact, and the decode pipeline has to run inside the database rather than beside it.

Architecture

How NYXDB does it

Raw events append; continuous transforms decode them into typed state tables; attribute tables reconstruct per-entity state as of any block. This is the chainflow shape — decode-to-state pipelines that live in the engine.

  1. 01

    Ingest raw

    Blocks and logs append to a source table, durably journaled.

  2. 02

    Decode (transform)

    CREATE TRANSFORM … INTO a typed state table decodes and normalizes as events arrive.

  3. 03

    Reconstruct

    Attribute tables hold per-entity attributes; FOR SYSTEM_TIME AS OF reconstructs state as of a block.

  4. 04

    Query exactly

    Keyed collapse gives exact holder counts and balances; temporal reads answer point-in-time questions.

Real SQL

In practice

Typed chain state
CREATE TABLE token_state (
chain_id UInt64,
address Bytes,
name String,
holders UInt64
);
Decode pipeline — continuous transform
CREATE TRANSFORM curve_progress
INTO bonding_curve_progress AS
SELECT chain_id, address, holders
FROM token_state;
State as of a block (temporal read)
SELECT chain_id, name, holders
FROM token_state
FOR SYSTEM_TIME AS OF 42;

Every statement follows the engine’s own test SQL shapes. See the SQL reference for full syntax.

Capabilities

What you get

High-throughput ingest

Sized for full-chain and multi-chain decode volumes.

In-database decode

CREATE TRANSFORM runs decode pipelines inside the engine — no external indexer.

Temporal reconstruction

Attribute tables + AS OF reconstruct wallet/contract state as of any block.

Exact holder counts

Keyed latest-per-key collapse — counts that are never wrong.

Reorg-friendly

Sequence-numbered ordering underpins deterministic replay.

Deploy anywhere

One 154MB image from a laptop to production.

Proof

Measured where it counts

exact

holder counts, recomputed not sampled

keyed collapse (ADR-078)

AS OF

point-in-time state per block

attribute tables (ADR-071)

multi-chainTODO-verify

decode throughput class

placeholder — not yet substantiated

Figures marked TODO-verify are placeholders pending a published, reproducible benchmark; substantiated numbers cite their source.

From raw blocks to exact answers

Stand up a decode pipeline and query state as of any block.