diff --git a/models/projects/convex/core/ez_convex_metrics.sql b/models/projects/convex/core/ez_convex_metrics.sql index 6f9cab93..9e6bdd2a 100644 --- a/models/projects/convex/core/ez_convex_metrics.sql +++ b/models/projects/convex/core/ez_convex_metrics.sql @@ -32,14 +32,14 @@ with date_spine as ( , net_treasury as ( select date, - sum(net_treasury_usd) as net_treasury_value + sum(usd_balance) as net_treasury_value from {{ ref('fact_convex_treasury_balance') }} group by 1 ) , treasury_native as ( select date, - sum(treasury_native) as treasury_native + sum(native_balance) as treasury_native from {{ ref('fact_convex_treasury_balance') }} group by 1 ) diff --git a/models/projects/convex/core/ez_convex_metrics_by_chain.sql b/models/projects/convex/core/ez_convex_metrics_by_chain.sql index c065bd86..9dce9534 100644 --- a/models/projects/convex/core/ez_convex_metrics_by_chain.sql +++ b/models/projects/convex/core/ez_convex_metrics_by_chain.sql @@ -23,7 +23,7 @@ with select date, chain, - usd_balance as treasury_value + sum(usd_balance) as treasury_value from {{ ref('fact_convex_treasury_balance') }} group by 1, 2 ) @@ -31,19 +31,19 @@ with select date, chain, - usd_balance as net_treasury_value + sum(usd_balance) as net_treasury_value from {{ ref('fact_convex_treasury_balance') }} - group by 1, 2 where token != 'CVX' + group by 1, 2 ) , treasury_native as ( select date, chain, - native_balance as treasury_native + sum(native_balance) as treasury_native from {{ ref('fact_convex_treasury_balance') }} - group by 1, 2 where token = 'CVX' + group by 1, 2 ) , date_chain_spine as ( SELECT diff --git a/models/projects/convex/core/ez_convex_metrics_by_token.sql b/models/projects/convex/core/ez_convex_metrics_by_token.sql index acdd19c5..c414f177 100644 --- a/models/projects/convex/core/ez_convex_metrics_by_token.sql +++ b/models/projects/convex/core/ez_convex_metrics_by_token.sql @@ -23,7 +23,7 @@ with select date, token, - usd_balance as treasury_value + sum(usd_balance) as treasury_value from {{ ref('fact_convex_treasury_balance') }} group by 1, 2 ) @@ -31,19 +31,19 @@ with select date, token, - usd_balance as net_treasury_value + sum(usd_balance) as net_treasury_value from {{ ref('fact_convex_treasury_balance') }} - group by 1, 2 where token != 'CVX' + group by 1, 2 ) , treasury_native as ( select date, token, - native_balance as treasury_native + sum(native_balance) as treasury_native from {{ ref('fact_convex_treasury_balance') }} - group by 1, 2 where token = 'CVX' + group by 1, 2 ) diff --git a/models/projects/liquity/core/ez_liquity_metrics_by_token.sql b/models/projects/liquity/core/ez_liquity_metrics_by_token.sql index 23befb32..d67c553a 100644 --- a/models/projects/liquity/core/ez_liquity_metrics_by_token.sql +++ b/models/projects/liquity/core/ez_liquity_metrics_by_token.sql @@ -28,7 +28,8 @@ with tvl as ( select date, token, - sum(revenue_usd) as revenue_usd + sum(revenue_usd) as revenue_usd, + sum(revenue_native) as revenue_native from {{ ref('fact_liquity_fees_and_revs') }} group by 1, 2 )