Home / Use cases

On-chain analytics warehouse

The problem

Your product team asks simple questions. What is the floor price this week? Who are the largest holders? How many wallets came back after their first purchase? The data to answer them is public, but it is spread across nodes, indexers, marketplace APIs and price feeds. Each source has its own schema, its own rate limit, and its own way to fail.

Teams often start with scripts that write straight into the app database. It works until two things happen. Pages shift during a read, so some sales are counted twice and some not at all. And history grows until the app database is slow for both the app and the analysts.

What a good solution looks like

  • Each event loads once. Loads are idempotent by a natural key such as chain, transaction hash and log index. A retry or a repeated page changes nothing.
  • Chain and contract are part of every record's identity. An event cannot land in the wrong table.
  • Raw data stays raw. The first layer keeps the source payload. Later layers decode, type and join it.
  • Late and changed data has a rule. The model states how far back a load re-reads, and how it treats blocks that a chain later replaces.
  • Metrics are rows over time, so you can draw history and read one metric alone. A dashboard is a query over those rows.
  • Serving and analysis are separate. The app reads small, recent tables. Analysts scan history in a lakehouse or warehouse.

How DataBlock approaches it

  1. Start with the questions. List the questions the product must answer, and the sources each one needs.
  2. Map every source. Rate limits, pagination, failure modes, and who owns the source when it breaks.
  3. Build the loads. Retries with backoff, small pages, and idempotent writes by key.
  4. Model in layers. Bronze for raw payloads, silver for decoded and typed events, gold for the metrics the product reads. dbt tests guard each layer.
  5. Add checks that fail loudly. An empty load, a shrinking table or a gap in block numbers stops the build and alerts the team.
  6. Hand over. Docs, tests and a walkthrough, so your team can add the next source.

Service

This use case maps to Web3 data. Larger builds also use data platform engineering.

Related work

  • WeMeta: marketplace, price and world data for a metaverse analytics startup, and a migration design from Postgres to Delta Lake.
  • Brainwave Marketplace: hash on chain, data off chain.

Tell DataBlock which on-chain question your team cannot answer today.

Book a 30-minute call

Ask a question