prbhvgupta2023-12-19 01:14 PM
Updated 2023-12-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
›
⌄
WITH inputs AS (
SELECT
BLOCK_TIMESTAMP,
TX_ID,
PUBKEY_SCRIPT_ADDRESS,
sum(VALUE) as VALUE
FROM
bitcoin.core.fact_inputs
WHERE
BLOCK_TIMESTAMP >= '2021-07-01' and BLOCK_TIMESTAMP <= '2021-12-31'
--and
-- TX_ID in ('48392761c85d0adc0f99e0e7b044274eaa0a32177a10f995c90f1eedd7c7a908','85c093f56b4ab1e3a1a8cd83ae3a16bf5efcfdad519e58b8618aeb769aefe47e')
group by 1,2,3
),
outputs AS (
SELECT
BLOCK_TIMESTAMP AS OP_BLOCK_TIMESTAMP,
TX_ID,
PUBKEY_SCRIPT_ADDRESS AS OP_ADDRESS,
sum(VALUE) AS OP_VALUE
FROM
bitcoin.core.fact_outputs
WHERE
BLOCK_TIMESTAMP >= '2021-07-01' and BLOCK_TIMESTAMP <= '2021-12-31'
-- and
-- TX_ID in ('48392761c85d0adc0f99e0e7b044274eaa0a32177a10f995c90f1eedd7c7a908','85c093f56b4ab1e3a1a8cd83ae3a16bf5efcfdad519e58b8618aeb769aefe47e')
group by 1,2,3
),
i_os_combined as (
SELECT
i.BLOCK_TIMESTAMP,
i.TX_ID,
i.PUBKEY_SCRIPT_ADDRESS AS INPUT_ADDRESS,
i.VALUE AS INPUT_VALUE,
Run a query to Download Data