majahaha-xhAEhAGetting Started
Updated 2024-12-30
999
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
-- WITH MonthlyTransactions AS (
-- SELECT
-- DATE_TRUNC('month', block_timestamp) AS month, -- Group by month
-- SUM(TX_FEE) AS total_transaction_revenue -- Sum of transaction fees
-- FROM
-- base.core.fact_transactions
-- WHERE
-- block_timestamp >= '2023-01-01' -- Adjust the date range as needed
-- AND TX_FEE IS NOT NULL -- Ensure fees are valid
-- AND STATUS = 'SUCCESS'
-- GROUP BY
-- DATE_TRUNC('month', block_timestamp) -- Group by month
-- ORDER BY
-- month
-- LIMIT 100
-- )
-- SELECT
-- month,
-- total_transaction_revenue
-- FROM
-- MonthlyTransactions
-- ORDER BY
-- month;
WITH all_chain_metrics AS (
SELECT 'aleo' as blockchain,
DATE_TRUNC('month', block_timestamp_hour) AS month,
SUM(total_fees_usd) AS total_transaction_revenue,
FROM aleo.stats.ez_core_metrics_hourly
WHERE month >= '2023-01-01'
GROUP BY blockchain, month
UNION ALL
SELECT 'aptos' as blockchain,
DATE_TRUNC('month', block_timestamp_hour) AS month,
QueryRunArchived: QueryRun has been archived