-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finalizes rf4 impact metric schema (#1708)
* feat: add log version of select impact metrics * chore: add trusted user model and AA related copy to descriptions * add: log metrics and copy * feat: include AA events in relevant metrics
- Loading branch information
Showing
7 changed files
with
151 additions
and
28 deletions.
There are no files selected for viewing
25 changes: 21 additions & 4 deletions
25
warehouse/dbt/models/marts/superchain/metrics/rf4_daily_active_addresses.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 20 additions & 3 deletions
23
warehouse/dbt/models/marts/superchain/metrics/rf4_monthly_active_addresses.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 24 additions & 6 deletions
30
warehouse/dbt/models/marts/superchain/metrics/rf4_recurring_addresses.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 37 additions & 4 deletions
41
warehouse/dbt/models/marts/superchain/metrics/rf4_transactions.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,43 @@ | ||
with transactions_std as ( | ||
select | ||
project_id, | ||
SUM(amount) as amount | ||
from {{ ref('rf4_events_daily_to_project') }} | ||
where | ||
event_type = 'CONTRACT_INVOCATION_SUCCESS_DAILY_COUNT' | ||
and bucket_day >= '2023-10-01' | ||
group by | ||
project_id | ||
), | ||
|
||
transactions_4337 as ( | ||
select | ||
project_id, | ||
SUM(amount) as amount | ||
from {{ ref('rf4_4337_events') }} | ||
where | ||
event_type = '4337_INTERACTION' | ||
and bucket_day >= '2023-10-01' | ||
group by | ||
project_id | ||
), | ||
|
||
transactions as ( | ||
select | ||
project_id, | ||
amount | ||
from transactions_std | ||
union all | ||
select | ||
project_id, | ||
amount | ||
from transactions_4337 | ||
) | ||
|
||
select | ||
project_id, | ||
'transaction_count' as metric, | ||
SUM(amount) as amount | ||
from {{ ref('rf4_events_daily_to_project') }} | ||
where | ||
event_type = 'CONTRACT_INVOCATION_SUCCESS_DAILY_COUNT' | ||
and bucket_day >= '2023-10-01' | ||
from transactions | ||
group by | ||
project_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.