-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
43 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
20 changes: 20 additions & 0 deletions
20
models/staging/bitcoin/fact_bitcoin_etf_update_threshold.sql
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,20 @@ | ||
{{ | ||
config( | ||
materialized='table', | ||
snowflake_warehouse='BITCOIN' | ||
) | ||
}} | ||
|
||
-- Credit to @hildobby for the original version of this dataset: https://dune.com/data/dune.hildobby.dataset_etf_update_thresholds | ||
|
||
with | ||
max_extraction as ( | ||
select max(extraction_date) as max_date | ||
from {{ source("PROD_LANDING", "raw_etf_update_thresholds") }} | ||
) | ||
select | ||
left(value:bitcoin, 10)::date as bitcoin_update_threshold | ||
from | ||
{{ source("PROD_LANDING", "raw_etf_update_thresholds") }}, | ||
lateral flatten(input => parse_json(source_json)) | ||
where extraction_date = (select max_date from max_extraction) |
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
20 changes: 20 additions & 0 deletions
20
models/staging/ethereum/fact_ethereum_etf_update_threshold.sql
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,20 @@ | ||
{{ | ||
config( | ||
materialized='table', | ||
snowflake_warehouse='ETHEREUM' | ||
) | ||
}} | ||
|
||
-- Credit to @hildobby for the original version of this dataset: https://dune.com/data/dune.hildobby.dataset_etf_update_thresholds | ||
|
||
with | ||
max_extraction as ( | ||
select max(extraction_date) as max_date | ||
from {{ source("PROD_LANDING", "raw_etf_update_thresholds") }} | ||
) | ||
select | ||
left(value:ethereum, 10)::date as ethereum_update_threshold | ||
from | ||
{{ source("PROD_LANDING", "raw_etf_update_thresholds") }}, | ||
lateral flatten(input => parse_json(source_json)) | ||
where extraction_date = (select max_date from max_extraction) |