MultipartiteTesting3
Updated 2024-10-24Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
›
⌄
WITH
bond_rewards AS (
SELECT DATE(block_timestamp) AS date,
SUM(bond_e8) AS rune_e8
FROM thorchain.defi.fact_rewards_events
GROUP BY date
),
other_rewards AS (
SELECT DATE(block_timestamp) AS date,
SUM(rune_e8) AS rune_e8
FROM thorchain.defi.fact_rewards_event_entries
GROUP BY date
)
SELECT DISTINCT date,
SUM(rune_e8) OVER(PARTITION BY date) / 1e8 AS block_rewards,
SUM(rune_e8) OVER(ORDER BY date ASC) / 1e8 AS cumulative_block_rewards
FROM (
(SELECT * from bond_rewards)
UNION ALL
(SELECT * from other_rewards)
)
ORDER BY date DESC
QueryRunArchived: QueryRun has been archived