John_Galtorbital command commission
Updated 2022-06-01
99
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
›
⌄
with tableU as (select
date(block_timestamp) as date,
fl.value:denom::string as currency,
sum(fl.value:amount::float) / POW (10, 6) as UST
from terra.transitions,
lateral flatten(input => event_attributes:amount) fl
where date > '2021-09-01'
and event = 'commission'
and event_attributes:validator = 'terravaloper19hflr9ay8usqxsxm4zzrsxfy3xz7hp6kv4ydnd'
and currency = 'uusd'
group by date, currency
order by date, currency
),
tableL as (select
date(block_timestamp) as date,
fl.value:denom::string as currency,
sum(fl.value:amount::float) / POW (10, 6) as Luna
from terra.transitions,
lateral flatten(input => event_attributes:amount) fl
where date > '2021-09-01'
and event = 'commission'
and event_attributes:validator = 'terravaloper19hflr9ay8usqxsxm4zzrsxfy3xz7hp6kv4ydnd'
and currency = 'uluna'
group by date, currency
order by date, currency
)
select tableu.date, ust, luna,
sum(ust) over (order by tableu.date) as cumulative_ust, sum(luna) over (order by tableu.date) as cumulative_luna
from tableU
inner join tableL on tableu.date = tablel.date
where tableu.date < '2022-05-01'
Run a query to Download Data