theericstoneCoinbase ETH Token Flows copy
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
›
⌄
-- forked from graham / Coinbase ETH Token Flows @ https://flipsidecrypto.xyz/graham/q/f9aKyK7XOyBC/coinbase-eth-token-flows
with
ETH_eth_base as (
select
block_timestamp::date as date,
c.address_name,
'ETH' as token,
sum(amount) as amount
from ethereum.core.ez_eth_transfers a
inner join (select distinct address, address_name from crosschain.core.address_labels
where label_subtype = 'hot_wallet' and project_name like 'coinbase'
and address_name like 'coinbase %' and blockchain = 'ethereum') c
on a.eth_from_address = c.address
where a.block_timestamp >= current_date - {{lookback_days}}
and a.eth_to_address not in (select distinct address from crosschain.core.address_labels
where label_subtype = 'hot_wallet' and project_name like 'coinbase'
and address_name like 'coinbase %' and blockchain = 'ethereum')
group by 1,2,3
),
net_out as (
select
distinct date,
address_name,
token,
-amount,
'out' as direction
from ETH_eth_base
),
ETH_eth_base_in as (
select
block_timestamp::date as date,
c.address_name,
'ETH' as token,
sum(amount) as amount
from ethereum.core.ez_eth_transfers a
Run a query to Download Data