Flipside TeamParticipants on memebase
    Updated 9 days ago
    with memebase as (
    select
    BLOCK_TIMESTAMP,
    tx_hash,
    concat('0x',substring(topics[3], 26+1, 40)) AS multisig,
    concat('0x',substring(topics[2], 26+1, 40)) AS owner,
    ethereum.public.udf_hex_to_int(TOPICS[1])::float as serviceId,
    row_number() OVER (partition BY serviceId order by BLOCK_TIMESTAMP desc) as r_no
    from base.core.fact_event_logs
    where (CONTRACT_ADDRESS = lower('0xc653622fd75026a020995a1d8c8651316cbbc4da')
    OR contract_address = lower('0x6011e09e7c095e76980b22498d69df18eb62bed8')
    OR contract_address = lower('0xfb7669c3adf673b3a545fa5acd987dbfda805e22')
    OR contract_address = lower('0xca61633b03c54f64b6a7f1f9a9c0a6feb231cc4d')
    )
    and TOPICS[0] = '0xaa6b005b4958114a0c90492461c24af6525ae0178db7fbf44125ae9217c69ccb'
    ),

    last_staked_memebase as (
    select
    BLOCK_TIMESTAMP,
    multisig,
    owner,
    serviceId,
    from
    memebase
    where
    r_no = 1
    )

    select
    count(*) as particpants
    from last_staked_memebase


    Last run: 9 days ago
    PARTICPANTS
    1
    32
    1
    6B
    69s