0xHaM-dRewards by Service ID
    Updated 2024-09-17
    -- forked from MLDZMN / Alpha 4 @ https://flipsidecrypto.xyz/MLDZMN/q/Jl1yX-0D20Kg/alpha-4
    with tb1 as (
    select
    BLOCK_TIMESTAMP,
    'Alpha' as stage,
    tx_hash,
    DECODED_LOG:multisig as multisig,
    DECODED_LOG:owner as owner,
    DECODED_LOG:serviceId as serviceId,
    DECODED_LOG:reward / 1e18 as reward
    from gnosis.core.ez_decoded_event_logs
    where CONTRACT_ADDRESS = '0xee9f19b5df06c7e8bfc7b28745dcf944c504198a'
    and EVENT_NAME = 'ServiceUnstaked'

    UNION all

    SELECT
    BLOCK_TIMESTAMP,
    'Coastal' as stage,
    tx_hash,
    DECODED_LOG:multisig as multisig,
    DECODED_LOG:owner as owner,
    DECODED_LOG:serviceId as serviceId,
    DECODED_LOG:reward / 1e18 as reward
    from gnosis.core.ez_decoded_event_logs
    where CONTRACT_ADDRESS = '0x43fb32f25dce34eb76c78c7a42c8f40f84bcd237'
    and EVENT_NAME = 'ServiceUnstaked'

    UNION all

    SELECT
    BLOCK_TIMESTAMP,
    'Alpine' as stage,
    tx_hash,
    DECODED_LOG:multisig as multisig,
    QueryRunArchived: QueryRun has been archived