Hessishkintsu snft
Updated 2025-05-21Copy Reference Fork
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
›
⌄
WITH nft_transfers AS (
SELECT
'0x'||SUBSTRING(TOPICS[2], 27) AS from_add,
'0x'||SUBSTRING(TOPICS[3], 27) AS to_add,
CAST(ethereum.public.udf_hex_to_int(data) AS NUMERIC) AS sent_nfts
FROM monad.testnet.fact_event_logs
WHERE CONTRACT_ADDRESS = lower('0x51E6da0E284609cD96e3134B12E94b4C4F0cA241')
AND TOPICS[0] = '0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62'
)
select holder as address ,
SUM(incoming) - SUM(outgoing) AS balance
FROM (
SELECT to_add AS holder, SUM(sent_nfts) AS incoming, 0 AS outgoing
FROM nft_transfers
GROUP BY to_add
UNION ALL
SELECT from_add AS holder, 0 AS incoming, SUM(sent_nfts) AS outgoing
FROM nft_transfers
GROUP BY from_add
) t
GROUP BY holder
HAVING SUM(incoming) - SUM(outgoing) > 1
order by 2 desc
QueryRunArchived: QueryRun has been archived