chainstar
Raw blockchain data to clean dimensional tables in your own warehouse, from one command. In development. Python, Apache-2.0. Runs on Linux, macOS, Windows.
What it does
chainstar turns raw blockchain data into clean, analysis-ready tables in a warehouse you own. One command runs the whole pipeline:
- Extract blocks, transactions and logs from the chain.
- Decode them into readable transfers and fees.
- Load the result to Parquet.
- Model it into a star schema with dbt.
You bring your own RPC URL. Nothing passes through a Bit Primitive server.
The tables
| Facts | Dimensions |
|---|---|
| Transfers | Wallets |
| Swaps | Tokens |
| Fees | Contracts |
| Dates |
Start in two minutes
uv tool install git+https://github.com/Bit-Primitive/chainstar
chainstar quickstart
quickstart asks which chain and how many recent blocks, reads them from a free public endpoint (or your own RPC), builds the tables in warehouse.duckdb, and tells you what to do next. Then:
chainstar export transfers --output transfers.xlsxsaves a spreadsheet (CSV and Parquet too).chainstar wallet 0xYourAddress --chain base --recent 1000builds one address's history.chainstar sync --chain base --from-recent 1000, thenchainstar sync --every 5m, keeps a warehouse current: it resumes where it stopped, stays a safe distance behind the head, and recovers from chain reorganisations.chainstar statusshows how far behind it is. See Keeping a warehouse in sync.- Try it in your browser first, or read Get started.
How it is built
- Extraction on Ethereum and Base is built on cryo. Bitcoin and Solana are read by chainstar's own JSON-RPC extractors.
- Modelling is a dbt package, so the tables can be extended, tested and documented the same way as the rest of your dbt project.
Chains
| Chain | Read with | Transfers are | Fees are |
|---|---|---|---|
| Ethereum | cryo | ERC-20 Transfer events | gas used × price paid |
| Base | cryo | ERC-20 Transfer events | gas used × price paid (L1 data fee not included) |
| Bitcoin | Bitcoin Core JSON-RPC | transaction outputs, with the sender only when every input came from one address | inputs minus outputs, checked against the node |
| Solana | Solana JSON-RPC | SPL, Token-2022 and native SOL transfers in successful transactions | each transaction's fee, failed ones included |
All four build into the same tables, so one warehouse can hold every chain, keyed by chain. dbt tests check every key and join.
Where the tables go
| Target | Tested |
|---|---|
| DuckDB, Postgres | live |
| ClickHouse | live (ClickHouse 25.8) |
| Parquet lake, on disk or S3-compatible storage (S3, R2, MinIO) | live on disk and an S3-compatible test server |
| MotherDuck, BigQuery, Snowflake | built and unit-tested; BigQuery's models also run on its emulator; not yet run against the live services |
chainstar sync --target clickhouse:http://me@localhost:8123 keeps a ClickHouse warehouse current the same way as DuckDB. See Chains and targets.
Inside the pipelines you already run
chainstar is also a dlt source and an Airbyte source connector, so data teams can add it to existing pipelines and load the finished, tested star schema into any of those tools' destinations. Each run sends only what changed since the last one, deletes included, so the destination always matches chainstar's tables row for row. See Using chainstar from dlt and Airbyte.
Swaps and USD values
fct_swaps holds DEX trades: Uniswap, SushiSwap and Aerodrome on Ethereum and Base, and Raydium, Orca, Meteora, Jupiter, Pump.fun and PumpSwap on Solana. A pool counts as a known venue only when its own factory confirms it.
From those trades chainstar derives hourly and daily USD prices, from on-chain data only: no price API and no terms to accept. Prices come from swaps against USD stablecoins (identified by address, never by symbol), outliers are rejected, and every price carries its method, observation count, volume and a confidence of high, medium or low. A low-confidence price is left empty rather than guessed. Transfers, fees, swaps, exports and wallet spreadsheets all get USD values with the price and method beside them, so every figure can be audited. See Swaps and USD prices.
Requirements
On Ethereum and Base, chainstar runs the cryo command-line tool. Install it once with:
cargo install cryo_cli
Bitcoin and Solana need nothing extra. Then chainstar doctor checks your setup, your RPC endpoint and your warehouse before the first run.
Roadmap
- More EVM chains and more DEX venues
- BigQuery, Snowflake and other warehouses through dbt adapters
- Homebrew and Docker distribution