potmoOP Claimer Types
    Updated 2023-04-13
    with total_by_address as (
    select
    origin_from_address as claimer,
    sum (raw_amount / 1e18) as claim_volume
    from optimism.core.fact_token_transfers
    where contract_address ilike('0x420%42')
    AND from_address ilike ('0xFeDFAF1A10335448b7FA0268F56D2B44DBD357de')
    GROUP BY 1
    ),
    in_totals as (
    select
    to_address,
    sum(raw_amount / 1e18) as amt_in
    from optimism.core.fact_token_transfers
    where contract_address ilike('0x420%42')
    and to_address in (select claimer from total_by_address)
    group BY 1
    ), out_totals as (
    select
    from_ADDRESS,
    sum(raw_amount / 1e18) as amt_out
    from optimism.core.fact_token_transfers
    where contract_address ilike('0x420%42')
    and from_address in (select claimer from total_by_address)
    group BY 1
    ), claimer_types as (
    select
    claimer,
    claim_volume,
    amt_in - coalesce(amt_out, 0) as balance,
    case when balance = claim_volume then 'hodler'
    when balance > claim_volume then 'zealot'
    when balance < claim_volume then 'quitter'
    end as claimer_type
    Run a query to Download Data