Stablecoin/updates (#134)

This commit is contained in:
Austin 2025-09-05 08:45:56 -04:00 committed by GitHub
parent 6438b4e389
commit 18b8a90ffc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 15 deletions

View File

@ -7,18 +7,18 @@
with base as (
select
replace(lower(chain), ' ', '_') as chain,
date_day,
stablecoin_id,
stablecoin,
symbol,
peg_type,
peg_mechanism,
GET_PATH(total_circulating_usd, peg_type)::float as total_circulating_usd,
GET_PATH(total_minted_usd, peg_type)::float as total_minted_usd,
GET_PATH(total_circulating, peg_type)::float as total_circulating,
GET_PATH(total_bridged_to_usd, peg_type)::float as total_bridged_to_usd,
GET_PATH(total_unreleased, peg_type)::float as total_unreleased,
replace(lower(s.chain), ' ', '_') as chain,
s.date_day,
s.stablecoin_id,
sc.stablecoin,
sc.symbol,
sc.peg_type,
sc.peg_mechanism,
GET_PATH(s.total_circulating_usd, sc.peg_type)::float as total_circulating_usd,
GET_PATH(s.total_minted_usd, sc.peg_type)::float as total_minted_usd,
GET_PATH(s.total_circulating, sc.peg_type)::float as total_circulating,
GET_PATH(s.total_bridged_to_usd, sc.peg_type)::float as total_bridged_to_usd,
GET_PATH(s.total_unreleased, sc.peg_type)::float as total_unreleased,
run_timestamp
from
{{ ref('silver__defillama_stablecoin_metrics') }} s
@ -57,7 +57,7 @@ select
total_unreleased,
{{ dbt_utils.generate_surrogate_key(
['chain','date_day','stablecoin_id']
) }} as defillama_ez_stablecoin_metrics_id,
) }} as ez_stablecoin_metrics_id,
sysdate() as inserted_timestamp,
sysdate() as modified_timestamp
from latest_records

View File

@ -109,7 +109,7 @@ models:
providing insight into the stablecoin issuer's reserve management strategy. See peg_type for the
unit of the total_unreleased.
- name: defillama_ez_stablecoin_metrics_id
- name: ez_stablecoin_metrics_id
description: |
A unique surrogate key generated from the combination of chain, date_day, and stablecoin_id.
This serves as the primary key for the table and ensures uniqueness across the combination of

View File

@ -21,7 +21,7 @@ models:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- TIMESTAMP_NTZ
- DATE
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
interval: 2