-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: contracts_v1 and int_contracts * refactor: directory models * refactor: int derived contracts including proxy deployers * fix: contracts v0 model * fix: materialize metrics table * fix attempt: Materialize all onchain metrics --------- Co-authored-by: Reuven V. Gonzales <[email protected]>
- Loading branch information
Showing
12 changed files
with
259 additions
and
307 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
128 changes: 0 additions & 128 deletions
128
warehouse/dbt/models/intermediate/blockchain_artifacts/int_contracts.sql
This file was deleted.
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
39 changes: 39 additions & 0 deletions
39
warehouse/dbt/models/intermediate/blockchain_artifacts/int_proxies.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,39 @@ | ||
{# any from address coming out of a proxy #} | ||
|
||
{% set networks = ["optimism", "base", "frax", "metal", "mode", "zora"] %} | ||
|
||
{% set union_queries = [] %} | ||
|
||
{% for network in networks %} | ||
{% set table_name = "stg_" ~ network ~ "__proxies" %} | ||
{% set network_upper = network.upper() %} | ||
|
||
{% set query %} | ||
select | ||
lower(to_address) as `address`, | ||
lower(proxy_address) as proxy_address, | ||
'{{ network_upper }}' as network, | ||
min(block_timestamp) as created_date | ||
from {{ ref(table_name) }} | ||
where proxy_address != to_address | ||
group by | ||
to_address, | ||
proxy_address | ||
{% endset %} | ||
|
||
{% do union_queries.append(query) %} | ||
{% endfor %} | ||
|
||
{% set final_query = union_queries | join(' union all ') %} | ||
|
||
with proxies as ( | ||
{{ final_query }} | ||
) | ||
|
||
select | ||
{{ oso_id("network", "address") }} as artifact_id, | ||
address, | ||
proxy_address, | ||
network, | ||
created_date | ||
from proxies |
Oops, something went wrong.