Skip to content

Commit

Permalink
Added timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunny77D committed Dec 13, 2024
1 parent 51b250f commit 3b5584b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions models/staging/drift/fact_drift_amm_revenue.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
WITH fact_drift_daily_perp_data AS (
SELECT
date
, max(latest_timestamp) as latest_timestamp
, sum(latest_excess_pnl) as latest_excess_pnl
FROM
{{ref('fact_drift_daily_perp_data')}}
GROUP BY 1
)
SELECT
date
, latest_timestamp
, latest_excess_pnl - LAG(latest_excess_pnl) OVER (ORDER BY date) as total_revenue
, latest_excess_pnl
FROM
Expand Down

0 comments on commit 3b5584b

Please sign in to comment.