RamaharCEXs flow <>
Updated 2023-04-13Copy 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 CEXs as (select
* from ethereum.core.dim_labels
where label_type ilike 'cex'),
inflow_table as (
select DATE(block_timestamp) as dayz,
sum (amount) as in_vol
from ethereum.core.ez_eth_transfers
where eth_to_address in (select distinct address from CEXs)
and eth_from_address not in (select distinct address from CEXs)
and block_timestamp >= CURRENT_DATE - {{period}}
group by 1),
outflow_table as (
select DATE(block_timestamp) as dt,
sum (amount) as out_vol
from ethereum.core.ez_eth_transfers
where eth_from_address in (select distinct address from CEXs)
and eth_to_address not in (select distinct address from CEXs)
and block_timestamp >= CURRENT_DATE - {{period}}
group by 1)
select
dayz,
in_vol as Inflow,
- out_vol as Outflow,
in_vol - out_vol as netflow
from inflow_table a join outflow_table b on dayz=dt
Run a query to Download Data