Dune Docs
English
Search…
⌃K
Links
🪄

Introducing Spellbook

Spells transform blockchain data into easy to use tables for all analysts!
Our docs are now available at dune.com/docs. We'll keep this around as a reference, but we won't update them and eventually plan to deprecate.

New level unlocked.

We’ve updated our database and now it’s time to update our contribution tools.
On January 31, 2020, we launched the abstractions repo as a place for wizards to create views and later tables. Since then, we’ve had over three hundred contributors and nearly 1k commits.
Mats inaugural comment
Abstractions are some of the most queried tables on Dune. That makes creating them one of the highest leverage things a wizard can do. We want to make that experience better by launching the Spellbook, a retooling of our existing abstractions repo + a first-in-class open-source analytics engineering tool called dbt.
​dbt-core (data build tool) is an open-source framework that injects more classical software engineering practices into writing SQL by mixing SQL with JINJA templating.
Succinct description of why we are appropriately hyped on dbt
Abstractions, henceforth models in dbt-speak or spells in dune-speak, can be materialized into views and tables, but there are many possible refinements, including incrementally-loaded tables, date-partitioned tables, and more. These can all be compiled into SQL and run on dune.com. No more contributing code that you can’t test without our help.
dbt allows us to write and manage unit tests to spot and prevent any issues in our abstractions.
Data integrity tests can easily be added with a single line in a YAML file. Models can be checked for unique primary keys, non-null values, accepted values, and relational integrity with minimal effort.
dbt natively understands the dependencies between all models. In our old abstractions logic we were managing dependencies manually, which made deploying and maintaining them a mess. With dependency management, we can guarantee that all models are deployed in the correct order.
Dependency graph created by dbt showing erc20 daily balances dependency tree
We hope you are as excited as we are about this new tool. Spellbook is now live in prod and we welcome new contributors.

Continue reading here to learn how to cast a spell into our github repo:

Visit the spellbook models documentation to see the current models