HadisehWhat's Going on with FTX?3
Updated 2022-11-10Copy 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
›
⌄
with t1 as (
select
date(block_timestamp) as date,
symbol as inflow_symbol,
sum(amount_usd) as total_inflow,
sum(total_inflow) over (order by date asc) as cumulative_inflow
from ethereum.core.ez_token_transfers
left outer join ethereum.core.dim_labels on address = to_address
where (label LIKE '%alameda%'
OR label LIKE '%ftx%')
and symbol in ('TUSD','USDC', 'USDT', 'DAI', 'BUSD')
AND block_timestamp > CURRENT_DATE - 10
group by 1,2),
t2 as (
select
date(block_timestamp) as date_,
symbol as outflow_symbol,
sum(amount_usd)*-1 as total_outflow,
sum(total_outflow) over (order by date_ asc) as cumulative_outflow
from ethereum.core.ez_token_transfers
left outer join ethereum.core.dim_labels on address = from_address
where (label LIKE '%alameda%'
OR label LIKE '%ftx%')
and symbol in ('TUSD','USDC', 'USDT', 'DAI', 'BUSD')
AND block_timestamp > CURRENT_DATE - 10
group by 1,2)
select
date,inflow_symbol, total_inflow,cumulative_inflow, total_outflow , cumulative_outflow
from t1 s join t2 f on s.date = f.date_ and s.inflow_symbol = f.outflow_symbol
Run a query to Download Data