m4ri4ncochoBinance Netflow copy
Updated 2024-04-19
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 Binance Netflow @ https://flipsidecrypto.xyz/edit/queries/6b70a489-0cb3-4c83-9f3d-11c785d0c2b7
-- BITCOIN DAILY NETFLOW
-- INPUTS
with inputs as (
select
date_trunc('day',block_timestamp) as date,
pubkey_script_address as address,
sum(value) as outflow
from bitcoin.core.fact_inputs
where date between '2023-05-06' and '2023-05-08'
group by date, address
),
-- OUTPUTS
outputs as (
select
date_trunc('day', block_timestamp) as date,
pubkey_script_address as address,
sum(value) as inflow
from bitcoin.core.fact_outputs
where date between '2023-05-06' and '2023-05-08'
group by date, address
),
-- INPUTS+OUTPUTS
merged as (
SELECT
date,
address,
-outflow as netflow
from inputs
QueryRunArchived: QueryRun has been archived