winnie-fsNFT Leaderboard copy
Updated 2023-03-16
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
›
⌄
-- forked from 8a0744ba-ea48-4d79-95d4-1a47b59a6ea2
-- forked from f44e4688-69a3-42e8-96f1-f051875ad3c4
-- forked from 50a73190-8f3f-47ff-9f7b-e296c728362f
------------------------------------------------------------------
-- Gather all wallets that have transacted in this collection
------------------------------------------------------------------
with wallets as
(
select
nft_to_address as wallet,
max(block_timestamp) as last_trade
from
ethereum.core.ez_nft_transfers
where nft_address = lower('{{Address}}')
group by wallet
),
------------------------------------------------------------------
-- Gather all wallets that currently hold an item in collection
------------------------------------------------------------------
current_owners as
(
select
nft_to_address as owner,
tokenid
from
ethereum.core.ez_nft_transfers
where nft_address = lower('{{Address}}')
QUALIFY RANK() OVER (PARTITION BY tokenid ORDER BY block_number DESC, event_index DESC) = 1
),
------------------------------------------------------------------
-- Calculate holdings per current holder
------------------------------------------------------------------
holder_data as
Run a query to Download Data