CryptoGowdaNFT Holders
Updated 2024-05-13
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 holder_counts as (
SELECT
nft_address,
nft_to_address AS holder,
COUNT(ez_nft_transfers_id) AS received_count
FROM
base.nft.ez_nft_transfers
WHERE
nft_address = lower('{{contract_addy}}')
GROUP BY
1,
2
),
sender_counts AS (
SELECT
nft_address,
nft_from_address AS sender,
COUNT(ez_nft_transfers_id) AS sent_count
FROM
base.nft.ez_nft_transfers
WHERE
nft_address = lower('{{contract_addy}}')
GROUP BY
1,
2
)
SELECT
hc.nft_address,
hc.holder,
hc.received_count - COALESCE(sc.sent_count, 0) AS current_amount_held
FROM
holder_counts hc
LEFT JOIN sender_counts sc ON hc.holder = sc.sender
WHERE
hc.received_count - COALESCE(sc.sent_count, 0) > 0
QueryRunArchived: QueryRun has been archived