fb3ce38c-7bfe-475c-bca8-3f1e44ae80a62024-04-09 12:06 PM
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
›
⌄
with
------------------------------ Gamma ------------------------------
gamma as (
select
transactions.block_timestamp,
transactions.block_number,
transactions.tx_id,
transactions.outputs[1]:scriptPubKey:address AS buyer,
input3.pubkey_script_address AS seller,
transactions.outputs[2]:value AS amount
from
bitcoin.core.fact_transactions transactions
join bitcoin.core.fact_inputs input1 on transactions.tx_id = input1.tx_id
join bitcoin.core.fact_inputs input2 on transactions.tx_id = input2.tx_id
join bitcoin.core.fact_inputs input3 on transactions.tx_id = input3.tx_id
join bitcoin.core.fact_inputs input4 on transactions.tx_id = input4.tx_id
where
transactions.block_number > 767429
and input1.index = 0
and input2.index = 1
and input3.index = 2
and input4.index = 3
and input1.value = 0.000006
and input2.value = 0.000006
and outputs[0]:value = 0.000012
and input1.pubkey_script_address = transactions.outputs[0]:scriptPubKey:address
and input2.pubkey_script_address = transactions.outputs[0]:scriptPubKey:address
and input4.pubkey_script_address = transactions.outputs[0]:scriptPubKey:address
and input3.pubkey_script_address != transactions.outputs[0]:scriptPubKey:address
and (
transactions.outputs[3]:scriptPubKey:address = 'bc1qyylrgsxjrmaearjqqradhy8ferh4u0ydw4yuze'
or (
input3.pubkey_script_address = transactions.outputs[2]:scriptPubKey:address
and transactions.outputs[3]:scriptPubKey:address is null
)
)
Run a query to Download Data