-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR is meant to give an example of static labels added to the spellbook repo for CEX on ethereum. Brief comments on the purpose of your changes: *For Dune Engine V2* I've checked that: General checks: * [x] I tested the query on dune.com after compiling the model with dbt compile (compiled queries are written to the target directory) * [x] I used "refs" to reference other models in this repo and "sources" to reference raw or decoded tables * [x] if adding a new model, I added a test * [x] the filename is unique and ends with .sql * [x] each sql file is a select statement and has only one view, table or function defined * [x] column names are `lowercase_snake_cased` * [x] if adding a new model, I edited the dbt project YAML file with new directory path for both models and seeds (if applicable) * [x] if adding a new model, I edited the alter table macro to display new database object (table or view) in UI explorer * [x] if adding a new materialized table, I edited the optimize table macro Join logic: * [ ] if joining to base table (i.e. ethereum transactions or traces), I looked to make it an inner join if possible Incremental logic: * [ ] I used is_incremental & not is_incremental jinja block filters on both base tables and decoded tables * [ ] where block_time >= date_trunc("day", now() - interval '1 week') * [ ] if joining to base table (i.e. ethereum transactions or traces), I applied join condition where block_time >= date_trunc("day", now() - interval '1 week') * [ ] if joining to prices view, I applied join condition where minute >= date_trunc("day", now() - interval '1 week')
- Loading branch information
Showing
6 changed files
with
596 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{{config(alias='cex')}} | ||
|
||
SELECT * FROM {{ ref('labels_cex_ethereum') }} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: labels_cex | ||
meta: | ||
blockchain: ethereum | ||
sector: labels | ||
project: cex | ||
contibutors: hildobby, soispoke | ||
config: | ||
tags: ['labels', 'ethereum', 'cex'] | ||
description: "Known centralised exchange addresses across chains" | ||
columns: | ||
- name: blockchain | ||
description: "Blockchain" | ||
- name: address | ||
description: "Address of known CEX" | ||
- name: name | ||
description: "Label name of centralised exchange" | ||
- name: category | ||
description: "Label category" | ||
- name: contributor | ||
description: "Wizard(s) contributing to labels" | ||
- name: source | ||
description: "How were labels generated (could be static or query)" | ||
- name: created_at | ||
description: "When were labels created" | ||
- name: updated_at | ||
description: "When were labels updated for the last time ?" | ||
|
||
- name: labels_cex_ethereum | ||
meta: | ||
blockchain: ethereum | ||
sector: labels | ||
project: cex | ||
contibutors: hildobby, soispoke | ||
config: | ||
tags: ['labels', 'ethereum', 'cex'] | ||
description: "Known centralised exchange addresses on Ethereum" | ||
columns: | ||
- name: blockchain | ||
description: "Blockchain" | ||
- name: address | ||
description: "Address of known CEX" | ||
- name: name | ||
description: "Label name of centralised exchange" | ||
- name: category | ||
description: "Label category" | ||
- name: contributor | ||
description: "Wizard(s) contributing to labels" | ||
- name: source | ||
description: "How were labels generated (could be static or query)" | ||
- name: created_at | ||
description: "When were labels created" | ||
- name: updated_at | ||
description: "When were labels updated for the last time ?" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{{ config( | ||
alias = 'all', | ||
materialized = 'table', | ||
file_format = 'delta') | ||
}} | ||
|
||
-- Static Labels | ||
SELECT * FROM {{ ref('labels_cex') }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: labels_all | ||
meta: | ||
blockchain: ethereum, solana | ||
sector: labels | ||
category: cex | ||
contibutors: hildobby, soispoke | ||
config: | ||
tags: ['labels', 'ethereum', 'cex'] | ||
description: "All labels across chains and categories" | ||
columns: | ||
- name: blockchain | ||
description: "Blockchain" | ||
- name: address | ||
description: "Label address" | ||
- name: name | ||
description: "Label name" | ||
- name: category | ||
description: "Label category" | ||
- name: contributor | ||
description: "Wizard(s) contributing to labels" | ||
- name: source | ||
description: "How were labels generated (could be static or query)" | ||
- name: created_at | ||
description: "When were labels created" | ||
- name: updated_at | ||
description: "When were labels updated for the last time ?" |