John_Galttotal danku luna by the hour
Updated 2022-04-12
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
36
›
⌄
with table1 as (select
date_trunc('hour', block_timestamp) as day_hour,
fl.value:amount / pow(10, 6) as luna_delegated,
null as luna_undelegated
from terra.msg_events,
lateral flatten(input => event_attributes:amount) fl
where date(block_timestamp) > '2022-02-01'
and event_type = 'delegate'
and event_index = 2
and event_attributes:validator = 'terravaloper12r8929na0amxfj406zw7vk8jmd03fmzcj9r2gg'
union all
select
date_trunc('hour', block_timestamp) as day_hour,
fl.value:amount / pow(10, 6) as luna_delegated,
null as luna_undelegated
from terra.msg_events,
lateral flatten(input => event_attributes:amount) fl
where date(block_timestamp) > '2022-02-01'
and event_type = 'redelegate'
and event_index = 3
and event_attributes:destination_validator = 'terravaloper12r8929na0amxfj406zw7vk8jmd03fmzcj9r2gg'
union all
select
date_trunc('hour', block_timestamp) as day_hour,
null as luna_delagated,
fl.value:amount / pow(10, 6) as luna_undelegated
from terra.msg_events,
lateral flatten(input => event_attributes:amount) fl
where date(block_timestamp) > '2022-02-01'
and event_type = 'unbond'
and event_index = 4
and event_attributes:validator = 'terravaloper12r8929na0amxfj406zw7vk8jmd03fmzcj9r2gg'