Monad Metrics GuildCurrent Holders of Domain
    Updated 3 days ago
    with base as (
    select
    block_timestamp,
    tx_hash,
    '0x' || substr(topic_1, 27) as from_address,
    '0x' || substr(topic_2, 27) as to_address,
    livequery.utils.udf_hex_to_int(topic_3) as token_id
    from monad.testnet.fact_event_logs
    where contract_address = '0x3019bf1dfb84e5b46ca9d0eec37de08a59a41308'
    and topic_0 = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
    ),

    currentdomains_held as (
    select
    to_address,
    token_id,
    from base
    qualify row_number() over(partition by token_id order by block_timestamp desc) = 1
    ),

    holders as (
    select
    to_address,
    count(token_id) as domains_held
    from currentdomains_held
    group by 1
    order by 2 desc
    )

    select
    count(distinct to_address) as current_holder
    from holders

    Last run: 3 days ago
    CURRENT_HOLDER
    1
    1401225
    1
    11B
    28s