Skip to content

Commit

Permalink
syntax fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwes committed Dec 21, 2024
1 parent a6b884c commit d27f9dd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions models/projects/convex/core/ez_convex_metrics.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
10 changes: 5 additions & 5 deletions models/projects/convex/core/ez_convex_metrics_by_chain.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,27 @@ 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
)
, net_treasury as (
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
Expand Down
10 changes: 5 additions & 5 deletions models/projects/convex/core/ez_convex_metrics_by_token.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,27 @@ 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
)
, net_treasury as (
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
)


Expand Down
3 changes: 2 additions & 1 deletion models/projects/liquity/core/ez_liquity_metrics_by_token.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

0 comments on commit d27f9dd

Please sign in to comment.