mirror of
https://github.com/FlipsideCrypto/external-models.git
synced 2026-02-06 11:21:59 +00:00
Stablecoin/updates (#134)
This commit is contained in:
parent
6438b4e389
commit
18b8a90ffc
@ -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
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user