WALLET_ADDRESS | TOTAL_NFTS | |
---|---|---|
1 | 0x67848dbc0f5a600f2166e2457614b2031862a352 | 5126 |
2 | 0x0000000000000000000000000000000000000004 | 4016 |
3 | 0x760afe86e5de5fa0ee542fc7b7b713e1c5425701 | 2312 |
4 | 0x0000000000000000000000000000000000000001 | 1404 |
5 | 0x088d937f241702de1d8379e7667826a3bbcb6da3 | 777 |
6 | 0x6fa303e72bed54f515a513496f922bc331e2f27e | 308 |
7 | 0x875e7e2601ff56b6df73f81127a9ba6fc2d21ca9 | 129 |
8 | 0x6cb787205ba97639e3255f98a698e0da6b016f69 | 38 |
9 | 0x1aed60a97192157fda7fb26267a439d523d09c5e | 23 |
10 | 0xe8f0635591190fb626f9d13c49b60626561ed145 | 16 |
thesaw-5wHtDBzealous-lime
Updated 2025-03-07
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 base AS (
SELECT
ft.block_timestamp,
ft.tx_hash,
ft.from_address,
ft.origin_from_address,
ft.to_address,
ft.origin_to_address,
utils.udf_hex_to_int(SUBSTR(topic_3, 3)) AS token_id, -- NFT ID
ftr.value,
ROW_NUMBER() OVER (PARTITION BY token_id ORDER BY ft.block_timestamp ASC, ft.tx_position ASC, ft.trace_index ASC) AS rn,
COUNT(DISTINCT ft.tx_hash) OVER (PARTITION BY el.topic_3) AS transfer_count -- Count how many times an NFT appears
FROM monad.testnet.fact_traces ft
INNER JOIN monad.testnet.fact_event_logs el
ON ft.tx_hash = el.tx_hash
INNER JOIN monad.testnet.fact_transactions ftr
ON ft.tx_hash = ftr.tx_hash
WHERE el.contract_address = LOWER('0xE8F0635591190Fb626F9D13C49b60626561Ed145') -- Replace with NFT contract address
AND el.topic_0 = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' -- Transfer event topic
AND ft.TX_SUCCEEDED = 'TRUE'
AND ft.TRACE_SUCCEEDED = 'TRUE'
),
-- Net NFT Balance for Each Wallet
balances AS (
SELECT
to_address AS wallet_address,
COUNT(token_id) AS nft_count -- NFTs received
FROM base
WHERE to_address != '0x0000000000000000000000000000000000000000' -- Exclude burn address
GROUP BY to_address
UNION ALL
SELECT
from_address AS wallet_address,
Last run: about 2 months ago
10
512B
48s