Updated 2024-11-29
    with Recievers as (
    select
    decoded_log:recipient as Receiver,
    decoded_log:amount /power(10,18) as AmountReceived,
    sum(AmountReceived) over() as OverallClaimed
    from optimism.core.fact_decoded_event_logs
    where contract_address = '0x4ee97a759aaca2edf9c1445223b6cd17c2ed3fb4'
    and event_name = 'TokensClaimed'
    --where tx_hash = lower('0x1270278f3ac2ac6b595be255ab7a0675edb8801234f6f78daf56f3af94578bb9')
    )
    -- Getting the transaction date of address in 3 EVMS
    ,evm_trx as (
    select
    date_trunc('year',block_timestamp) as year,
    from_address
    from optimism.core.fact_transactions
    where from_address in (select Receiver from Recievers)
    qualify row_number() over(partition by from_address order by year asc) = 1
    union all
    select
    date_trunc('year',block_timestamp) as year,
    from_address
    from arbitrum.core.fact_transactions
    where from_address in (select Receiver from Recievers)
    qualify row_number() over(partition by from_address order by year asc) = 1
    union all

    select
    date_trunc('year',block_timestamp) as year,
    from_address
    from bsc.core.fact_transactions
    where from_address in (select Receiver from Recievers)
    qualify row_number() over(partition by from_address order by year asc) = 1
    QueryRunArchived: QueryRun has been archived