FlippppppaDistinct Hourly Volume copy
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
›
⌄
-- forked from freemartian / Distinct Hourly Volume @ https://flipsidecrypto.xyz/freemartian/q/2023-06-02-11-08-am-Ro0Woy
-- )
with total as (
select
date_trunc('hour', block_timestamp) as time,
sum(amount) as Stolen_Fund,
sum(amount * token_price) as Stolen_Fund_USD,
Symbol as Token,
case
when block_timestamp BETWEEN '2023-05-30 04:50:00' and '2023-06-01 05:00:00' then 'Pika Protocol'
when block_timestamp >= '2023-06-01 05:00:00' then 'Orbiter finance'
end as Protocol,
'Optimism' as Network
from optimism.core.ez_token_transfers
where to_address in (
'0x2162b6caa174b90416090bd4a87e7d08f7027c48',
'0x9fa7bb759641fcd37fe4ae41f725e0f653f2c726',
'0x29b32f1320e2e78fa66a92e5114a125e68e75e88')
and block_timestamp > '2023-05-30 04:50:00'
group by symbol, Network, time, protocol
UNION
select
date_trunc('hour', block_timestamp) as time,
sum(amount) as Stolen_Fund,
sum(amount * token_price) as Stolen_Fund_USD,
Symbol as Token,
case
when block_timestamp BETWEEN '2023-05-30 04:50:00' and '2023-06-01 05:00:00' then 'Pika Protocol'
when block_timestamp >= '2023-06-01 05:00:00' then 'Orbiter finance'
end as Protocol,
'Arbitrum' as Network
from arbitrum.core.ez_token_transfers
Run a query to Download Data