Monitize AI$NYAN Sellers after Claiming Date
    Updated 2024-07-03
    -- forked from $NYAN Sellers after Claiming Date @ https://flipsidecrypto.xyz/edit/queries/71ab2b35-3901-41ed-bc5a-b2cf53c5ab38

    with claimert as (
    select
    distinct tx_to as claimer,
    BLOCK_TIMESTAMP as claim_date,
    sum(amount) as Claimed_Amount
    from solana.core.fact_transfers
    where tx_from = '4cZgUw6T8yYQ2CordAfSzS4Q5VKJNyVU3JEX6xGg2Xwy'
    and mint = 'NYANpAp9Cr7YarBNrby7Xx4xU6No6JKTBuohNA3yscP'
    --and program_id = 'meRjbQXFNf5En86FXT2YPz1dQzLj4Yb3xK8u1MVgqpb'
    and amount > 0
    group by 1,2
    ),

    total_claimt as (
    select
    /*date_trunc('day', BLOCK_TIMESTAMP) as date,
    sum(sum(amount)) over(order by date_trunc('day', BLOCK_TIMESTAMP) asc) as cum_claimed_amount*/
    sum(amount) as total_claimed
    from solana.core.fact_transfers
    where tx_from = '4cZgUw6T8yYQ2CordAfSzS4Q5VKJNyVU3JEX6xGg2Xwy'
    and mint = 'NYANpAp9Cr7YarBNrby7Xx4xU6No6JKTBuohNA3yscP'
    and amount > 0
    --group by 1
    ),

    sellt as (
    select
    distinct trader,
    date_trunc('day', date) as sell_date,
    -1*sum(am) as trade_amount
    from(
    select
    distinct tx_from as trader,
    BLOCK_TIMESTAMP as date,
    QueryRunArchived: QueryRun has been archived