duneanalytics/spellbook
duneanalytics/spellbook has 1,524 GitHub stars and 1,427 forks. GitHot measured +1 stars in 24 hours and +2 in 7 days. Last checked 2026-11-11 18:31 UTC. Last push 2026-11-02.
SQL views for Dune
측정된 스타 증가
- in 24h
- +1
- in 7 days
- +2
- in 15 days
- 업데이트 지연
- in 1 month
- 업데이트 지연
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Original

Welcome to Spellbook. Cast a magical incantation to tame the blockchain.
TL;DR
Before contributing: Spellbook accepts selective contributions. To avoid wasted effort, please raise a GitHub issue with the title prefix
[CONTRIBUTION]describing your proposed changes before writing code. The Dune team will review and confirm if we'll accept the contribution.- Exception: Small bug fixes can be submitted directly as PRs without prior approval.
- Priority: PRs from Dune enterprise customers receive priority review.
PRs from contributors who aren't customers are accepted on a case by case basis, depending on whether datasets benefit the broader community (as an example, contributions to
dex.tradesare welcome)Questions about how Spellbook works? Check the docs directory.
Spellbook uses sub-projects to organize different datasets (dex, nft, solana, etc.).
Setup: Follow dev environment setup to get started with dbt locally.
Questions? Join #spellbook on Discord.
Your spellbook contributions are your own IP. See Contributor License Agreement for details.
🚀 Enterprise Customers: Use Your Own dbt Project
If you're a Dune enterprise customer, you don't need to contribute to Spellbook. Instead, you can run your own data transformation projects directly on DuneSQL using the dbt Connector.
What it is: Run dbt projects on top of DuneSQL—read from any Dune dataset and write results into managed tables within your org namespace. All writes are metered and private by default, stored securely by Dune.
Why it matters:
- No PR bottlenecks – Ship on your own schedule without waiting for Spellbook reviews
- Keep it private – Your logic and data stay within your org, giving you full autonomy
- Full dbt compatibility – Use your existing dbt workflows and tooling
📖 Read the dbt Connector documentation to get started.
👉 Contact us for a demo and to get set up with your own dbt project.
Table of Contents
- Enterprise Customers: Use Your Own dbt Project
- Documentation
- Introduction
- Sub-projects
- How to contribute
- Setting up your dev environment
- Using dbt to write spells
Documentation
New to Spellbook or using AI tooling to navigate the repo? Start with these docs:
- Repository navigation - GitHub issues, PRs, discussions, and Actions
- Best practices - Development workflow, performance, and incremental model guidance
- Model overview - Model layout, naming, materialization, and schema YAML expectations
- Model config block - Required dbt model config patterns
- Tests - Required model, seed, and generic test patterns
- CI overview - How Spellbook PR CI runs and where to find test tables
- FAQ and common issues - Common contributor and CI problems
AI agents should also read AGENTS.md for shared repository instructions. Task-specific workflows live in .claude/skills/ so Claude Code, opencode, and Cursor can use the same skill files.
Introduction
Spellbook is Dune's interpretation layer, transforming raw blockchain data into clean, usable datasets. It's a dbt project where each model is a SQL query that handles dependencies and builds tables from raw and decoded tables.
While historically community-driven, Spellbook now accepts selective contributions. The docs directory contains design principles and best practices for contributors.
Sub-projects
Spellbook is organized into multiple dbt sub-projects within dbt_subprojects/:
daily_spellbook- Default location for new spells, refreshed daily. Project-specific, standalone spells.hourly_spellbook- Promoted spells with more frequent refreshes. Requires Dune team approval.dex- DEX and DEX aggregator spells, includingdex.trades.nft- NFT-related spells.solana- Solana-specific spells.tokens- Token metadata, transfers, and balances.
See this discussion for more details.
How to contribute
Submitting a contribution
Before writing code, please create a GitHub issue with the title prefix [CONTRIBUTION] describing your proposed changes. Include:
- High-level description of what you want to add/change
- Which sub-project(s) it affects (dex, nft, etc.)
- Why it would benefit the community
The Dune team will review and respond with whether we'll accept the contribution. This saves you from investing time in code that may not be merged.
Exception: Bug fixes can be submitted directly as PRs without prior approval. When reporting bugs, include:
- Link to block explorer showing expected value
- Dune query showing incorrect value
- Scale of impact (number of rows, affected USD volume)
Priority: Dune enterprise customers receive priority review.
Testing your spell
Once you submit a PR, our CI pipeline tests it against Dune's engine. Query your test data using:
test_schema.git_dunesql_{{commit_hash}}_{{table_name}}
Find exact table names in the dbt slim ci action logs under dbt run initial model(s).
Test tables exist for ~24 hours. If your table doesn't exist, trigger the pipeline to run again.
Join #spellbook on Discord for help.
Setting up your Local Dev Environment
Prerequisites:
- Fork and clone the repo (GitHub guide)
- Python 3.9+ (installation guide)
- uv
- Windows users: Set
git config --global core.autocrlf truefor unix line endings
Initial Installation:
Navigate to the spellbook repo in your CLI:
cd user/directory/github/spellbook
# Change this to wherever spellbook is stored locally on your machine.
Install project dependencies with uv:
uv sync --locked
If install fails due to Python version mismatch, install Python 3.9 with uv python install 3.9 and run uv sync --locked again.
Run commands through uv (no manual environment activation required):
uv run dbt --version
Navigate to the appropriate sub-project:
cd dbt_subprojects/<subproject_name>/
Each subproject has its own dbt project file with varying configs. Run the following commands:
uv run dbt clean # cleans up the project
uv run dbt deps # pull the dependencies
uv run dbt compile
From the repo root, you can target a subproject directly:
uv run dbt compile --project-dir dbt_subprojects/<subproject_name>/
dbt compile converts JINJA/SQL templates into plain SQL in the target/ folder, which you can test on dune.com.
Each subproject includes a profiles.yml file that tells dbt how to run commands. Run dbt either from the subproject directory or with --project-dir.
How to use dbt to create spells
Key concepts:
- Refs: Reference other dbt models using
{{ ref('model_name') }}(use filename without .sql) - Sources: Reference raw data using
{{ source('schema', 'table') }} - Tests: Add
uniqueandnot_nulltests to primary keys inschema.ymlfiles - Descriptions: Document tables and columns in
schema.ymlto help others
Example schema.yml:
models:
- name: 1inch_ethereum
description: "Trades on 1inch, a DEX aggregator"
columns:
- name: tx_hash
description: "Table primary key"
data_tests:
- unique
- not_null
sources:
- name: ethereum
freshness:
warn_after: { count: 12, period: hour }
tables:
- name: traces
dbt Resources:
관련 프로젝트 살펴보기
Asabeneh/30-Days-Of-Python
30 Days of Python 프로그래밍 챌린지는 Python 프로그래밍 언어를 30일 동안 배우기 위한 단계별 가이드입니다. 이 챌린지는 100일 이상 걸릴 수 있습니다. 자신의 속도에 맞춰 진행하세요. 다음 동영상도 도움이 될 수 있습니다: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,560 스타grafana/grafana
개방적이고 조합 가능한 옵저버빌리티 및 데이터 시각화 플랫폼입니다. Prometheus, Loki, Elasticsearch, InfluxDB, Postgres 등 여러 소스의 메트릭, 로그, 트레이스를 시각화합니다.
77,830 스타redis/redis
실시간 데이터 기반 애플리케이션을 구축하는 개발자에게 Redis는 가장 선호되고, 가장 빠르며, 기능이 가장 풍부한 캐시, 데이터 구조 서버이자 문서 및 벡터 쿼리 엔진입니다.
77,395 스타apache/superset
Apache Superset는 데이터 시각화 및 데이터 탐색 플랫폼입니다.
75,473 스타