Eman-RazTotal Number of Holders By Chain
    Updated 2025-04-05
    with final_table as (
    with swell_chain as (
    with transactions as (
    with table1 as (with tab1 as (SELECT
    block_timestamp, tx_hash, origin_from_address,
    lower(PARSE_JSON(full_decoded_log):"address"::STRING) AS contract_address,
    PARSE_JSON(full_decoded_log):"data"[0]:"value"::STRING AS from_address,
    PARSE_JSON(full_decoded_log):"data"[1]:"value"::STRING AS to_address,
    (PARSE_JSON(full_decoded_log):"data"[2]:"value"::NUMBER)/pow(10,18) AS amount
    from swell.core.ez_decoded_event_logs
    where tx_succeeded='TRUE' and event_name='Transfer')

    select block_timestamp::date as date, from_address as address, -amount as amount
    from tab1
    where contract_address=lower('0x2826D136F5630adA89C1678b64A61620Aab77Aea')),

    table2 as (with tab1 as (SELECT
    block_timestamp, tx_hash, origin_from_address,
    lower(PARSE_JSON(full_decoded_log):"address"::STRING) AS contract_address,
    PARSE_JSON(full_decoded_log):"data"[0]:"value"::STRING AS from_address,
    PARSE_JSON(full_decoded_log):"data"[1]:"value"::STRING AS to_address,
    (PARSE_JSON(full_decoded_log):"data"[2]:"value"::NUMBER)/pow(10,18) AS amount
    from swell.core.ez_decoded_event_logs
    where tx_succeeded='TRUE' and event_name='Transfer')

    select block_timestamp::date as date, to_address as address, amount
    from tab1
    where contract_address=lower('0x2826D136F5630adA89C1678b64A61620Aab77Aea'))

    select * from table1 union all
    select * from table2),

    date_list as (
    select
    block_timestamp :: date as date
    from
    Last run: 20 days ago
    Date
    Number of Holders
    Chain
    1
    2025-04-05 00:00:00.00043524Ethereum
    2
    2025-04-05 00:00:00.0007826Swell Chain
    2
    93B
    20s