MLDZMNCurrently staked services on Coastal stage
    Updated 2024-06-18

    --- staking part
    with tb1 as (select
    BLOCK_TIMESTAMP,
    tx_hash,
    DECODED_LOG:multisig as multisig,
    DECODED_LOG:owner as owner,
    DECODED_LOG:serviceId as serviceId,
    row_number() OVER (partition BY serviceId order by BLOCK_TIMESTAMP desc) as r_no
    from gnosis.core.ez_decoded_event_logs
    where CONTRACT_ADDRESS = '0x43fb32f25dce34eb76c78c7a42c8f40f84bcd237'
    and EVENT_NAME = 'ServiceStaked'
    ),

    tb2 as (select
    *
    from tb1
    where r_no = 1),

    ---------------------------------------------------------------------------
    --- unstaking part
    tb3 as (select
    BLOCK_TIMESTAMP,
    tx_hash,
    DECODED_LOG:multisig as multisig,
    DECODED_LOG:owner as owner,
    DECODED_LOG:serviceId as serviceId,
    row_number() OVER (partition BY serviceId order by BLOCK_TIMESTAMP desc) as r_no
    from gnosis.core.ez_decoded_event_logs
    where CONTRACT_ADDRESS = '0x43fb32f25dce34eb76c78c7a42c8f40f84bcd237'
    and EVENT_NAME = 'ServiceUnstaked'
    ),

    tb4 as (select
    *
    from tb3
    Last run: 9 days ago
    BLOCK_TIMESTAMP
    MULTISIG
    OWNER
    SERVICEID
    1
    2024-08-07 19:33:20.000
    0x0321d5106c6fb64fd7a6883804668d9a056e9405
    0xcb2691716ac1355d29c746f822949dd0c952f38b
    572
    1
    123B
    121s