From 7e86942624593c8ec5db253b6244979199a24228 Mon Sep 17 00:00:00 2001 From: alexwes Date: Wed, 20 Nov 2024 16:33:54 -0500 Subject: [PATCH] add tvl to ena ez table (#630) --- models/projects/ethena/ez_ethena_metrics.sql | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/models/projects/ethena/ez_ethena_metrics.sql b/models/projects/ethena/ez_ethena_metrics.sql index e25a70bc..bc96c186 100644 --- a/models/projects/ethena/ez_ethena_metrics.sql +++ b/models/projects/ethena/ez_ethena_metrics.sql @@ -23,12 +23,20 @@ with usde_metrics as ( left join {{ ref('fact_ethena_collateral_fees') }} collateral_fees using(date) group by 1 ) +, tvl as ( + SELECT + date, + stablecoin_total_supply + FROM {{ ref('ez_usde_metrics') }} +) select usde_metrics.date, usde_metrics.stablecoin_dau as stablecoin_dau, usde_metrics.stablecoin_txns as stablecoin_txns, - coalesce(ena_metrics.fees, 0) as fees + coalesce(ena_metrics.fees, 0) as fees, + tvl.stablecoin_total_supply as tvl from usde_metrics left join ena_metrics using(date) +left join tvl using(date) where usde_metrics.date < to_date(sysdate()) order by 1 desc