diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/dune/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/dune/_schema.yml new file mode 100644 index 00000000000..6c6e4f12e11 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/dune/_schema.yml @@ -0,0 +1,24 @@ +version: 2 + +models: + - name: dune_blockchains + meta: + sector: dune + contributors: 0xRob + description: > + Core table listing blockchains on Dune with meta info + columns: + - name: name + description: "The namespaces of the blockchain as used on Dune" + - name: chain_id + description: "The chain ID (only for EVM)" + - name: display_name + description: "Nicely formatted name" + - name: protocol + description: "evm or non_evm" + - name: token_address + description: "The token address used on Dune to represent the native token" + - name: token_symbol + description: "The token symbol of the native token" + - name: token_decimals + description: "The token decimals of the native token" diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/dune/dune_blockchains.sql b/dbt_subprojects/hourly_spellbook/models/_sector/dune/dune_blockchains.sql new file mode 100644 index 00000000000..739b358e3c7 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/dune/dune_blockchains.sql @@ -0,0 +1,15 @@ +{{ config( + schema='dune', + alias = 'blockchains', + materialized = 'view', + post_hook='{{ expose_spells(\'["dune"]\', + "sector", + "dune", + \'["0xRob"]\') }}') +}} + +-- because the graphql endpoint often returns http error 403 when querying through http_get(), +-- we store the results in a matview instead and expose that one here with a view on top. +-- matview: https://dune.com/queries/4467416 +select * from +{{ source("dune", "result_blockchains", database="dune") }} diff --git a/sources/_datasets/dune/sources.yml b/sources/_datasets/dune/sources.yml new file mode 100644 index 00000000000..adc99858345 --- /dev/null +++ b/sources/_datasets/dune/sources.yml @@ -0,0 +1,6 @@ +version: 2 + +sources: + - name: dune + tables: + - name: result_blockchains