littlenaomiUntitled Query
Updated 2022-11-18Copy 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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
--credit to alik110
with ftx as (
select *
from ethereum.core.dim_labels
where label ilike '%ftx%' or address_name ilike '%ftx%'),
Inflowt as (
select
case
when block_timestamp::date >= '2022-11-07' then 'After FTX Collapse'
else 'Before FTX Collapse'
end as time_label,
block_timestamp::date as Inflow_Date,
symbol as Symbol_IN,
sum (amount_usd) as Inflow_Volume
from ethereum.core.ez_token_transfers
where to_address in (select distinct address from ftx)
and from_address not in (select distinct address from ftx)
and block_timestamp > CURRENT_DATE - 24
group by 1,2,3
union ALL
select
case
when block_timestamp::date >= '2022-11-07' then 'After FTX Collapse'
else 'Before FTX Collapse'
end as time_label,
block_timestamp::date as Inflow_Date,
'ETH' as symbol_in,
sum (amount_usd) as Inflow_Volume
from ethereum.core.ez_eth_transfers
where eth_to_address in (select distinct address from ftx)
and eth_from_address not in (select distinct address from ftx)
and block_timestamp > CURRENT_DATE - 24
Run a query to Download Data