-
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.
Height Task: https://dune.height.app/T-13877 *For Dune Engine V2* I've checked that: * [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` When you are ready for a review, tag duneanalytics/data-experience. We will re-open your forked pull request as an internal pull request. Then your spells will run in dbt and the logs will be avaiable in Github Actions DBT Slim CI. This job will only run the models and tests changed by your PR compared to the production project.
- Loading branch information
1 parent
82d9870
commit ab80c50
Showing
16 changed files
with
4,308 additions
and
1 deletion.
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
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,104 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: ens_view_expirations | ||
meta: | ||
blockchain: ethereum | ||
project: ethereum_name_service | ||
contributors: mewwts, antonio-mendes | ||
config: | ||
tags: ['ethereum','ens','ethereum_name_service','ethereumnameservice'] | ||
description: > | ||
View expirations of ENS registrations | ||
columns: | ||
- &label | ||
name: label | ||
description: "Hashed individual component of ENS name" | ||
- name: min_expires | ||
description: "Minimum expiration date UTC for domain" | ||
- name: max_expires | ||
description: "Maximum expiration date UTC for domain" | ||
- name: min_evt_block_time | ||
description: "Block time UTC of first name registration" | ||
- name: max_evt_block_time | ||
description: "Block time UTC of last name renewal" | ||
- name: count | ||
description: "Number of times expiration was extended" | ||
|
||
- name: ens_view_registrations | ||
meta: | ||
blockchain: ethereum | ||
project: ethereum_name_service | ||
contributors: mewwts, antonio-mendes | ||
config: | ||
tags: ['ethereum','ens','ethereum_name_service','ethereumnameservice'] | ||
description: > | ||
View ENS registrations | ||
columns: | ||
- *label | ||
- &name | ||
name: name | ||
description: "Name component of ENS" | ||
- name: owner | ||
description: "Address that owns the ENS name" | ||
- &cost | ||
name: cost | ||
description: "Registration cost in Wei" | ||
- &expires | ||
name: expires | ||
description: "Expiry data in epoch time" | ||
- &contract_address | ||
name: contract_address | ||
description: "Address of smart contract interacted with" | ||
- &evt_tx_hash | ||
name: evt_tx_hash | ||
description: "Transaction hash" | ||
- &evt_index | ||
name: evt_index | ||
description: "Index of event in transaction" | ||
- &evt_block_time | ||
name: evt_block_time | ||
description: "Block time UTC" | ||
- &evt_block_number | ||
name: evt_block_number | ||
description: "Block number" | ||
|
||
- name: ens_view_renewals | ||
meta: | ||
blockchain: ethereum | ||
project: ethereum_name_service | ||
contributors: mewwts, antonio-mendes | ||
config: | ||
tags: ['ethereum','ens','ethereum_name_service','ethereumnameservice'] | ||
description: > | ||
View ENS renewals | ||
columns: | ||
- *name | ||
- *label | ||
- *cost | ||
- *expires | ||
- *contract_address | ||
- *evt_tx_hash | ||
- *evt_index | ||
- *evt_block_time | ||
- *evt_block_number | ||
|
||
- name: ens_view_registries | ||
meta: | ||
blockchain: ethereum | ||
project: ethereum_name_service | ||
contributors: mewwts, antonio-mendes | ||
config: | ||
tags: ['ethereum','ens','ethereum_name_service','ethereumnameservice'] | ||
description: > | ||
View ENS registry | ||
columns: | ||
- *label | ||
- name: node | ||
description: "A cryptographic hash uniquely identifying a name" | ||
- name: min_evt_block_time | ||
description: "Block time UTC of first registry for node" | ||
- name: max_evt_block_time | ||
description: "Block time UTC of latest registry for node" | ||
- name: count | ||
description: "Total number of node registries" |
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,28 @@ | ||
version: 2 | ||
|
||
sources: | ||
- name: ethereumnameservice_ethereum | ||
freshness: | ||
warn_after: { count: 12, period: hour } | ||
error_after: { count: 24, period: hour } | ||
tables: | ||
- name: BaseRegistrarImplementation_evt_NameRegistered | ||
loaded_at_field: evt_block_time | ||
- name: BaseRegistrarImplementation_evt_NameRenewed | ||
loaded_at_field: evt_block_time | ||
- name: ETHRegistrarController_1_evt_NameRegistered | ||
loaded_at_field: evt_block_time | ||
- name: ETHRegistrarController_2_evt_NameRegistered | ||
loaded_at_field: evt_block_time | ||
- name: ETHRegistrarController_3_evt_NameRegistered | ||
loaded_at_field: evt_block_time | ||
- name: ENSRegistry_evt_NewOwner | ||
loaded_at_field: evt_block_time | ||
- name: ENSRegistryWithFallback_evt_NewOwner | ||
loaded_at_field: evt_block_time | ||
- name: ETHRegistrarController_1_evt_NameRenewed | ||
loaded_at_field: evt_block_time | ||
- name: ETHRegistrarController_2_evt_NameRenewed | ||
loaded_at_field: evt_block_time | ||
- name: ETHRegistrarController_3_evt_NameRenewed | ||
loaded_at_field: evt_block_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,22 @@ | ||
{{config(alias='view_expirations')}} | ||
SELECT | ||
label, | ||
TO_TIMESTAMP(min(expires)) AS min_expires, | ||
min(evt_block_time) AS min_evt_block_time, | ||
TO_TIMESTAMP(max(expires)) AS max_expires, | ||
max(evt_block_time) AS max_evt_block_time, | ||
count(*) AS count | ||
FROM ( | ||
SELECT | ||
numeric2bytea(id) AS label, | ||
expires, | ||
evt_block_time | ||
FROM {{source('ethereumnameservice_ethereum', 'BaseRegistrarImplementation_evt_NameRegistered')}} | ||
UNION | ||
SELECT | ||
numeric2bytea(id) AS label, | ||
expires, | ||
evt_block_time | ||
FROM {{source('ethereumnameservice_ethereum', 'BaseRegistrarImplementation_evt_NameRenewed')}} | ||
) AS r | ||
GROUP BY label; |
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,9 @@ | ||
{{config(alias='view_registrations')}} | ||
SELECT * | ||
FROM {{source('ethereumnameservice_ethereum', 'ETHRegistrarController_1_evt_NameRegistered')}} | ||
UNION | ||
SELECT * | ||
FROM {{source('ethereumnameservice_ethereum', 'ETHRegistrarController_2_evt_NameRegistered')}} | ||
UNION | ||
SELECT * | ||
FROM {{source('ethereumnameservice_ethereum', 'ETHRegistrarController_3_evt_NameRegistered')}} |
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,14 @@ | ||
{{config(alias='view_registries')}} | ||
SELECT | ||
node, | ||
label, | ||
min(evt_block_time) AS min_evt_block_time, | ||
max(evt_block_time) AS max_evt_block_time, | ||
count(*) as count_ens_registries | ||
FROM ( | ||
SELECT * | ||
FROM {{source('ethereumnameservice_ethereum', 'ENSRegistry_evt_NewOwner')}} | ||
UNION | ||
SELECT * FROM {{source('ethereumnameservice_ethereum', 'ENSRegistryWithFallback_evt_NewOwner')}} | ||
) r | ||
GROUP BY node, label; |
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,9 @@ | ||
{{config(alias='view_renewals')}} | ||
SELECT * | ||
FROM {{source('ethereumnameservice_ethereum', 'ETHRegistrarController_1_evt_NameRenewed')}} | ||
UNION | ||
SELECT * | ||
FROM {{source('ethereumnameservice_ethereum', 'ETHRegistrarController_2_evt_NameRenewed')}} | ||
UNION | ||
SELECT * | ||
FROM {{source('ethereumnameservice_ethereum', 'ETHRegistrarController_3_evt_NameRenewed')}}; |
Oops, something went wrong.