banterlyticsvx-kongz-tree
    Updated 2024-02-17
    with all_tx as (
    select date_trunc('day', block_timestamp::date) as dt,
    tx_hash, decoded_log:to::string as event_to,
    decoded_log:from::string as event_from, decoded_log:tokenId::string as token_id
    from ethereum.core.fact_decoded_event_logs
    where block_timestamp > '2022-01-05'
    and contract_address = lower('0x7EA3Cca10668B8346aeC0bf1844A49e995527c8B')
    and event_name = 'Transfer'
    union all
    select date_trunc('day', block_timestamp::date) as dt,
    tx_hash, decoded_log:to::string as event_to,
    decoded_log:from::string as event_from, decoded_log:tokenId::string as token_id
    from polygon.core.fact_decoded_event_logs
    where block_timestamp > '2022-01-05'
    and contract_address = lower('0x05df72d911e52AB122f7d9955728BC96A718782C')
    and event_name = 'Transfer'),
    transfers as
    ((SELECT
    event_to as wallet,
    dt,
    'mint' as action,
    1 as value
    FROM all_tx
    where event_from = '0x0000000000000000000000000000000000000000')
    union all
    (SELECT
    event_to as wallet,
    dt,
    'gain' as action,
    1 as value
    FROM all_tx
    where event_from != '0x0000000000000000000000000000000000000000')
    Last run: over 1 year ago
    NUM_HOLDER_DIST
    DISTRIBUTION
    DIST_ORDER
    1
    14811 NFT1
    2
    3052 NFT2
    3
    1353 NFT3
    4
    1064 NFT4
    5
    1195 NFT5
    6
    1266-10 NFT6
    7
    122>10 NFT7
    7
    133B
    79s