Eman-RazDistribution of Holders By Activity Level on the Swell Chain
    Updated 9 hours ago
    with final_table as (with user_table as (
    with table4 as (
    with table3 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 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 to_address as address, amount
    from tab1
    where contract_address=lower('0x2826D136F5630adA89C1678b64A61620Aab77Aea'))

    select * from table1 union all
    select * from table2)

    select address, sum(amount) as net_amount
    from table3
    group by 1)

    Last run: about 9 hours ago
    Activity Level
    Number of Users
    1
    Low Activity Users3271
    2
    Single Transaction Users2990
    3
    Inactive Users1207
    4
    Moderate Users1100
    5
    Active Users298
    6
    High Activity Users69
    6
    159B
    6s