MLDZMNexactly that hours
Updated 2022-05-28Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
›
⌄
with tb1 as (SELECT
BLOCK_TIMESTAMP,
tx_id
from osmosis.core.fact_msg_attributes
where MSG_TYPE='token_swapped'
and ATTRIBUTE_VALUE ilike '%ibc/987C17B11ABC2B20019178ACE62929FE9840202CE79498E29FE8E5CB02B7C0A4%'
and BLOCK_TIMESTAMP>='2022-05-20'
and (ATTRIBUTE_KEY='tokens_in' or ATTRIBUTE_KEY='tokens_out')
)
select
date_trunc('hour',BLOCK_TIMESTAMP) as hours,
case
when BLOCK_TIMESTAMP between '2022-05-20 14:00:00' and '2022-05-20 18:00:00' then 'around launching projects'
when BLOCK_TIMESTAMP between '2022-05-27 14:00:00' and '2022-05-27 18:00:00' then 'around launching projects'
else 'Other times'
end as time_periods,
count(tx_id) as count_swaps
from tb1 group by 1,2
Run a query to Download Data