NakedCollector$JUP Claimers Behavior 2 copy
    -- forked from mamad-5XN3k3 / $JUP Claimers Behavior 2 @ https://flipsidecrypto.xyz/mamad-5XN3k3/q/4qR7hfSLsb4q/jup-claimers-behavior-2

    --forked from Marqu https://flipsidecrypto.xyz/marqu/q/arcsoNwueoEf/jupiter-airdrop---claimers-leaderboard---top-5-000

    with claimert as (
    select
    distinct tx_to as claimer ,
    sum(amount) as jup ,
    count(distinct t.tx_id) as txs
    from solana.core.fact_transfers t
    join solana.core.fact_events e on t.tx_id=e.tx_id
    where mint = 'JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN'
    and program_id = 'meRjbQXFNf5En86FXT2YPz1dQzLj4Yb3xK8u1MVgqpb'
    group by 1
    ),

    transfert as (
    select
    Claimer,
    sum(case when tx_from = claimer then amount else 0 end) as send_amount,
    sum(case when tx_to = claimer then amount else 0 end) as receive_amount
    from solana.core.fact_transfers t join claimert c on t.tx_from = c.claimer or t.tx_to = c.claimer
    where mint = 'JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN'
    and not tx_from in (
    select
    distinct tx_from
    from solana.core.fact_transfers t
    join solana.core.fact_events e on t.tx_id=e.tx_id
    where mint = 'JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN'
    and program_id = 'meRjbQXFNf5En86FXT2YPz1dQzLj4Yb3xK8u1MVgqpb')
    group by 1)

    select
    case
    when current_balance > Claimed_amount then 'Buyers'
    when current_balance < Claimed_amount then 'Sellers'
    Run a query to Download Data