mo115Pol NFTs copy
    Updated 2024-09-15
    with txs as (select t.tx_hash,t.BLOCK_TIMESTAMP, DECODED_LOG:user as user , t.amount ,'stake' as action , EVENT_NAME
    from ethereum.core.ez_token_transfers t left join ethereum.core.ez_decoded_event_logs e on t.tx_hash=e.tx_hash
    where t.TO_ADDRESS = '0x5e3ef299fddf15eaa0432e6e66473ace8c13d908'
    and t.CONTRACT_ADDRESS in ('0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0','0x455e53cbb86018ac2b8092fdcd39d8444affc3f6')
    --and EVENT_NAME in ( 'ShareMinted' , 'Staked')
    union
    select t.tx_hash,t.BLOCK_TIMESTAMP, DECODED_LOG:user as user , t.amount*-1 ,'unstake' as action , EVENT_NAME
    from ethereum.core.ez_token_transfers t left join ethereum.core.ez_decoded_event_logs e on t.tx_hash=e.tx_hash
    where t.FROM_ADDRESS = '0x5e3ef299fddf15eaa0432e6e66473ace8c13d908'
    and t.CONTRACT_ADDRESS in ('0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0','0x455e53cbb86018ac2b8092fdcd39d8444affc3f6')
    --and EVENT_NAME in ('DelegatorUnstakeWithId','DelegatorUnstaked','Unstaked')
    )
    select sum(amount), action , EVENT_NAME
    from txs
    group by 2,3
    QueryRunArchived: QueryRun has been archived