Pine AnalyticsBlast Holders 2
    Updated 2024-07-19
    -- X: Range amount they got from airdrop

    --Y: users

    -- group by is whether they Sold ALL, SOLD SUM, SOLD NONE, BOUGHT
    with tab1 as (
    SELECT
    to_address,
    sum(amount) as Amount_Recieved
    from blast.core.ez_token_transfers
    where contract_address like '0xb1a5700fa2358173fe465e6ea4ff52e36e88e2ad'
    and from_address like '0xf7be503166828fe8565c520d66645ac6a06bbdd7'
    and symbol like 'BLAST'
    group by 1
    )

    , tab2 as (
    select
    to_address as User,
    sum(amount) as Total_Blast
    from blast.core.ez_token_transfers
    where contract_address like '0xb1a5700fa2358173fe465e6ea4ff52e36e88e2ad'
    group by 1

    UNION ALL

    select
    from_address as User,
    sum(amount*-1) as Total_Blast
    from blast.core.ez_token_transfers
    where contract_address like '0xb1a5700fa2358173fe465e6ea4ff52e36e88e2ad'
    group by 1

    )

    , tab3 as (
    QueryRunArchived: QueryRun has been archived