-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from Artemis-xyz/add-swell
Add Swell
- Loading branch information
Showing
4 changed files
with
31 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,6 @@ | ||
sources: | ||
- name: PROD_LANDING | ||
schema: PROD_LANDING | ||
database: LANDING_DATABASE | ||
tables: | ||
- name: raw_sweth_staked_count_ethereum |
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,18 @@ | ||
{{ config(materialized="table") }} | ||
-- depends_on: {{ source("PROD_LANDING", "raw_sweth_staked_count_ethereum") }} | ||
with raw_eth_supply as ( | ||
{{ raw_partitioned_array_to_fact_table_many_columns('landing_database.prod_landing.raw_sweth_staked_count_ethereum', 'date', ['totalSupply', 'swETHToETHRate']) }} | ||
), | ||
eth_supply as ( | ||
select | ||
date, | ||
totalSupply * swETHToETHRate as total_supply | ||
from raw_eth_supply | ||
), | ||
eth_supply_forward_filled as ( | ||
{{ forward_fill('date', 'total_supply', 'eth_supply') }} | ||
) | ||
select | ||
eth_supply_forward_filled.date as date, | ||
coalesce(eth_supply_forward_filled.value, 0) as total_supply | ||
from eth_supply_forward_filled |
6 changes: 6 additions & 0 deletions
6
models/staging/swell/fact_sweth_staked_eth_count_with_usd_and_change.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,6 @@ | ||
{{ config(materialized="table") }} | ||
|
||
select *, 'ethereum' as chain, 'sweth' as app, 'DeFi' as category | ||
from ( | ||
{{ calc_staked_eth('fact_sweth_staked_eth_count') }} | ||
) |