Blockchain data warehouse
A blockchain data warehouse stores blockchain data in tables you query with SQL: blocks, transactions, transfers and balances, often next to prices. Analysts use it to join chains, tokens and prices in one query, instead of asking a node or an explorer for each answer. It can run on Postgres, BigQuery, Snowflake or another SQL engine.
In BlockJuice
BlockJuice is a blockchain data warehouse you run yourself. The warehouse is a Postgres that Docker starts with the rest of the stack. Its data sits in three schemas.
raw holds one raw table per source and table, such as raw.ethereum_uniswap_v3, plus the dead letters and the cursors of the stream sources. analytics holds the staging views dbt builds over the raw tables, and the mart tables that questions read, such as analytics.dex_trades. ops holds the run log. ops.ingestion_runs has one row per source run, and ops.dbt_invocations and ops.dbt_node_runs hold each dbt build and each model and test in it.
The raw rows stay, so you fix a wrong rule by editing SQL and rebuilding, without reading the chain again. It sits under keys and policies you set. To use another warehouse, change ingestion/, the dbt adapter in transformation/ and dbt-postgres in orchestration/.
Example
The run log sits in the warehouse next to the data, so SQL can tell you which source failed last, and why.
select source, table_name, finished_at, succeeded, records_written, error
from ops.ingestion_runs
order by started_at desc
limit 20