HosseinUntitled Query
Updated 2022-11-11Copy 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
›
⌄
with list as (
select from_address as address, (raw_amount / pow(10, 18)) as amount
from ethereum.core.fact_token_transfers
where contract_address = '0xb3999f658c0391d94a37f7ff328f3fec942bcadc'
union all
select to_address as address, -1 * (raw_amount / pow(10, 18)) as amount
from ethereum.core.fact_token_transfers
where contract_address = '0xb3999f658c0391d94a37f7ff328f3fec942bcadc'
),
list2 as (
select address, sum(amount) as total_balance
from list
where address not in ('0xff830ce17d39bbd6a4fef9683308d793df8e34fc', '0x1a9a4d919943340b7e855e310489e16155f4ed29')
and amount > 0
group by address
)
select count(distinct(address)) as address_num, sum(total_balance) as total_circulation_token
from list2
Run a query to Download Data