m4ri4ncochoSenders metrics
Updated 2024-03-04
999
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
›
⌄
-- Senders metrics
-- Find inputs
with inputs as (
select
pubkey_script_address as address,
- sum(value) as received
from bitcoin.core.fact_inputs
where date_trunc('d', block_timestamp) between '{{Date_from}}' and '{{Date_to}}'
group by 1
having received != 0
and address != ''
)
,
-- Find outputs
outputs as (
select
pubkey_script_address as address,
sum(value) as received
from bitcoin.core.fact_outputs
where date_trunc('d', block_timestamp) between '{{Date_from}}' and '{{Date_to}}'
group by 1
having received != 0
and address != ''
)
,
-- inputs + outputs to calculate net
merged as (
SELECT
i.address,
QueryRunArchived: QueryRun has been archived