vegardFTX Wallet Balance per hour
Updated 2022-11-10
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
›
⌄
with ftx_labels as (
select label, address
from ethereum.core.dim_labels
where (
label like any ('ftx%') or
address_name like any ('ftx%')
)
),
balances as (
select
date_trunc('hour', last_activity_block_timestamp) as hour,
current_bal,
contract_address,
symbol
from ethereum.core.ez_current_balances
where 1 = 1
and exists (select * from ftx_labels where address = user_address)
)
select last_hour, symbol, balance, balance_usd from (
select
a.hour as last_hour,
balances.symbol,
sum(current_bal) as balance,
sum(price * current_bal) balance_usd,
row_number() over (partition by balances.symbol order by a.hour desc) as n
from ethereum.core.fact_hourly_token_prices a
join balances
on a.token_address = balances.contract_address
where a.hour::date = current_date
group by a.hour, balances.symbol
having balance > 0 and balance_usd > 0
qualify n = 1
)
order by balance_usd desc
Run a query to Download Data