diff --git a/models/staging/jupiter/fact_jupiter_fees_silver.sql b/models/staging/jupiter/fact_jupiter_fees_silver.sql index f832acc0..bd4c68be 100644 --- a/models/staging/jupiter/fact_jupiter_fees_silver.sql +++ b/models/staging/jupiter/fact_jupiter_fees_silver.sql @@ -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 \ No newline at end of file