pinehearstMethod - NFT Holders over time
Updated 2022-08-21Copy Reference Fork
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
›
⌄
with mint as (
select
block_timestamp,
tx_hash,
origin_from_address as address, -- assume tx initiator is minter?
1 as balance,
event_inputs:tokenId::INTEGER as tokenId
from avalanche.core.fact_event_logs
where 1=1
and event_name='Transfer'
and contract_address=lower('0x4c5A8B71330D751bf995472f3AB8CeB06a98dD47')
and event_inputs:from='0x0000000000000000000000000000000000000000'
--and event_inputs:tokenId::INTEGER >=250
),
transfer_sender AS ( -- they will be LOSING 1 NFT
select
block_timestamp,
tx_hash,
event_inputs:from as sender,
-1 as balance,
event_inputs:tokenId::INTEGER as tokenId
from avalanche.core.fact_event_logs
where 1=1
and event_name = 'Transfer' and contract_address=lower('0x4c5A8B71330D751bf995472f3AB8CeB06a98dD47')
and event_inputs:from not in ('0x0000000000000000000000000000000000000000')
and event_inputs:to not in ('0xc28f1550160478a7fb3b085f25d4b179e08e649a')
),
transfer_recipient AS ( -- will be gaining one NFT
select
block_timestamp,
tx_hash,
event_inputs:to as recipient,
1 as balance,
event_inputs:tokenId::INTEGER as tokenId
from avalanche.core.fact_event_logs
where 1=1
Run a query to Download Data