libruaryEditionOwners
Updated 2024-09-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 Deposits AS (
SELECT
event_data:id AS nft_id,
event_data:to AS wallet_address
FROM flow.core.fact_events
WHERE event_contract = 'A.edf9df96c92f4595.Pinnacle'
AND event_type = 'Deposit'
),
Withdrawals AS (
SELECT
event_data:id AS nft_id,
event_data:from AS wallet_address
FROM flow.core.fact_events
WHERE event_contract = 'A.edf9df96c92f4595.Pinnacle'
AND event_type = 'Withdraw'
),
Minted AS (
SELECT
event_data:id AS nft_id,
event_data:editionID AS edition_id
FROM flow.core.fact_events
WHERE event_contract = 'A.edf9df96c92f4595.Pinnacle'
AND event_type = 'PinNFTMinted'
)
SELECT
d.wallet_address AS owner_wallet,
m.edition_id AS editionID,
COUNT(m.edition_id) AS quantity
FROM Deposits d
LEFT JOIN Minted m ON d.nft_id = m.nft_id
WHERE m.edition_id = '{{editionID}}' -- Correct syntax for numeric editionID
AND NOT EXISTS (
SELECT 1
FROM Withdrawals w
WHERE d.nft_id = w.nft_id
QueryRunArchived: QueryRun has been archived