Busabase
Busabase is an open-source (MIT) database and workspace for AI agents — data, docs, skills, and apps in one place. Run it locally, self-host it inside your network, or use Busabase Cloud, and turn age
翻譯準備中
用於 Dune 的 SQL 視圖。
AI 翻譯
SQL views for Dune
資料Python · JinjaGitHub @duneanalytics自行安裝營運者未確認
試用過了嗎? 點一下就好,不需要登入。
製作者的介紹僅有上面的一句話。 更多詳情請閱讀儲存庫 README。 儲存庫 README ↗
正在載入完整 README。
檢視完整 README ↗
Welcome to Spellbook. Cast a magical incantation to tame the blockchain.
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.
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.trades are 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.
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:
📖 Read the dbt Connector documentation to get started.
👉 Contact us for a demo and to get set up with your own dbt project.
New to Spellbook or using AI tooling to navigate the repo? Start with these docs:
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.
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.
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, including dex.trades.nft - NFT-related spells.solana - Solana-specific spells.tokens - Token metadata, transfers, and balances.See this discussion for more details.
Before writing code, please create a GitHub issue with the title prefix [CONTRIBUTION] describing your proposed changes. Include:
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:
Priority: Dune enterprise customers receive priority review.
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.
Prerequisites:
git config --global core.autocrlf true for unix line endingsInitial 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.
Key concepts:
{{ ref('model_name') }} (use filename without .sql){{ source('schema', 'table') }}unique and not_null tests to primary keys in schema.yml filesschema.yml to help othersExample 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: