jackguy2023-10-31 04:50 PM
Updated 2023-10-31
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
›
⌄
WITH Receive AS (
SELECT
PUBKEY_SCRIPT_ADDRESS as address,
sum(value) AS value
FROM bitcoin.core.fact_outputs
where PUBKEY_SCRIPT_ADDRESS is not null
GROUP BY 1
), Send AS (
SELECT
PUBKEY_SCRIPT_ADDRESS as address, SUM(-value) AS value
FROM bitcoin.core.fact_inputs
where PUBKEY_SCRIPT_ADDRESS is not null
GROUP BY 1
)
SELECT
sum(amount)
from (
select address, sum(value) as amount
from (
select * from Receive
union all
select * from Send
)
WHERE NOT address in (
SELECT DISTINCT address
from bitcoin.core.dim_labels
where label_type like 'cex'
)
GROUP by 1
having amount > 10000
)
Run a query to Download Data