Hessishar hld t
    Updated 22 hours ago
    -- forked from ar hld @ https://flipsidecrypto.xyz/studio/queries/ddac5271-cace-47c2-83b8-76a4ebbadf60

    with mints as (select a.BLOCK_TIMESTAMP, b.EVENT_DATA:to as minter, a.tx_hash, a.EVENT_DATA:nft_id as id,
    a.EVENT_DATA:price/1e8 as launchpad_fee
    from movement.core.fact_events a
    join movement.core.fact_events b
    on a.tx_hash = b.tx_hash
    where --tx_hash = '0xf46d0a7b539004dc55106a116034e2eacf61ba5066ce298d1ab1180a85eb6acf' and
    a.EVENT_RESOURCE = 'MintNftEvent'
    and a.EVENT_MODULE = 'launchpad'
    and a.EVENT_DATA:collection_id = 'aa5eb001-14af-4915-8f3c-24befe15d884'
    and a.SUCCESS = 'true'
    and b.EVENT_RESOURCE = 'Transfer'),

    LatestTransfers AS (
    SELECT
    EVENT_DATA:object as id,
    EVENT_DATA:to as tx_to,
    BLOCK_TIMESTAMP,
    ROW_NUMBER() OVER (PARTITION BY id ORDER BY BLOCK_TIMESTAMP DESC) AS rn
    from movement.core.fact_events
    where id in (select id from mints)
    and SUCCESS = 'true'
    and EVENT_RESOURCE = 'Transfer'),


    holders as (SELECT
    id,
    TX_TO AS current_holder,
    BLOCK_TIMESTAMP AS last_transfer_time
    FROM
    LatestTransfers
    WHERE rn = 1),

    final as (select distinct current_holder, count(id) as balance, round(((balance/2211)*100),2)||'%' as supplyshare
    from holders
    Last run: about 22 hours ago
    COUNT(DISTINCT CURRENT_HOLDER)
    1
    1481
    1
    8B
    3s