Monitize AI$Blast Sellers after Claiming Date copy
    Updated 2024-12-09
    -- forked from $Blast Sellers after Claiming Date @ https://flipsidecrypto.xyz/edit/queries/afb94cea-28fc-4d23-8f2b-6a46fb2600dd

    with claimert as(
    select
    distinct TO_ADDRESS as claimer,
    Block_timestamp as claim_date,
    amount as Claimed_Amount
    from blast.core.ez_token_transfers
    where contract_address = lower('0xb1a5700fA2358173Fe465e6eA4Ff52E36e88E2ad')
    and FROM_ADDRESS = lower('0xf7be503166828fe8565c520d66645ac6a06bbdd7')
    and ORIGIN_FUNCTION_SIGNATURE = '0xcd9829d9'
    and amount > 0
    ),

    balancet as (
    select
    distinct user,
    sum(volume) as Holding_Volume
    from(
    select
    from_address as user,
    -1 * amount as volume
    from blast.core.ez_token_transfers
    where contract_address = lower('0xb1a5700fa2358173fe465e6ea4ff52e36e88e2ad')

    union all

    select
    to_address as user,
    amount as volume
    from blast.core.ez_token_transfers
    where contract_address = lower('0xb1a5700fa2358173fe465e6ea4ff52e36e88e2ad')
    --and to_address != '0xf7be503166828fe8565c520d66645ac6a06bbdd7'
    )
    join claimert on USER = claimer
    group by user
    QueryRunArchived: QueryRun has been archived