sqrr_researchOP_RETURN vs Other TX
Updated 2024-06-29
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
›
⌄
WITH ort
AS (
SELECT date_trunc('month', BLOCK_TIMESTAMP) AS "Month"
,count(TX_ID) AS "OP_Return TX"
FROM bitcoin.core.fact_outputs
WHERE PUBKEY_SCRIPT_ADDRESS IS NULL
AND PUBKEY_SCRIPT_ASM LIKE 'OP_RETURN%'
AND PUBKEY_SCRIPT_TYPE = 'nulldata'
GROUP BY 1
)
,tx
AS (
SELECT date_trunc('month', BLOCK_TIMESTAMP) AS "Month"
,count(TX_ID) AS "Total_TX"
FROM bitcoin.core.fact_transactions
WHERE 1 = 1
AND BLOCK_TIMESTAMP >= '2013-03-01'
GROUP BY 1
)
SELECT o."Month"
,"OP_Return TX"
,"Total_TX"
,"Total_TX" - "OP_Return TX" as "Other_TX"
FROM ort AS o
LEFT JOIN tx AS t ON o."Month" = t."Month"
ORDER BY 1 DESC;
QueryRunArchived: QueryRun has been archived