shawnedwardswho2
Updated 2022-11-16
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
›
⌄
with table1 as (
select date(block_timestamp) as date,
tx_hash,
eth_to_address as receiver,
'ETH' as symbol,
amount_usd as amount
from ethereum.core.ez_eth_transfers
where eth_from_address in (select address from ( select * from ethereum.core.dim_labels where address_name ilike '%ftx%' or label ilike '%ftx%'))
and eth_to_address not in (select address from ( select * from ethereum.core.dim_labels where address_name ilike '%ftx%' or label ilike '%ftx%'))
and block_timestamp >= CURRENT_DATE - 15 and block_timestamp <= current_date - 1
and amount > 0
union ALL
select date(block_timestamp) as date,
tx_hash,
to_address as receiver,
symbol,
amount_usd as amount
from ethereum.core.ez_token_transfers
where from_address in (select address from ( select * from ethereum.core.dim_labels where address_name ilike '%ftx%' or label ilike '%ftx%'))
and to_address not in (select address from ( select * from ethereum.core.dim_labels where address_name ilike '%ftx%' or label ilike '%ftx%'))
and block_timestamp >= CURRENT_DATE - 15 and block_timestamp <= current_date - 1
and amount > 0
and contract_address !='0xc229c69eb3bb51828d0caa3509a05a51083898dd')
select date,
case when date >= '2022-11-07' then 'after_disaster'
else 'before_disaster' end as time,
count (distinct tx_hash) as number_of_transactions,
count (distinct receiver) as number_of_users,
sum (amount) as total_amount
from table1
group by 1,2
Run a query to Download Data