Skip to content

Commit

Permalink
jupiter fees dates fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwes committed Dec 6, 2024
1 parent ddff902 commit 8023e35
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions models/staging/jupiter/fact_jupiter_fees_silver.sql
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
{{
config(
materialized="table",
unique_key="date",
snowflake_warehouse="JUPITER",
)
}}

select
lo.date,
coalesce(lo.date, dca.date, perps.date) as date,
coalesce(dca.fees,0) + coalesce(lo.fees,0) + coalesce(perps.fees, 0) as fees
from
{{ ref("fact_jupiter_limit_order_fees_silver") }} lo
left join
full join
{{ ref("fact_jupiter_dca_fees_silver") }} dca on dca.date = lo.date
left join
full join
{{ ref("fact_jupiter_perps_silver") }} perps on perps.date = dca.date
where lo.date < to_date(sysdate())
where coalesce(lo.date, dca.date, perps.date) < to_date(sysdate())
order by 1 asc

0 comments on commit 8023e35

Please sign in to comment.