Flipside TeamTest base agents
    Updated 2024-12-21
    with tb1 as (select
    distinct MULTISIG_ADDRESS as service

    from crosschain.olas.ez_service_registrations
    where BLOCKCHAIN = 'base'
    ),

    tb2 as (select
    BLOCK_TIMESTAMP::date AS day,
    contract_address AS service_address,
    'base' AS chain
    FROM base.core.fact_event_logs
    WHERE contract_address IN (SELECT service FROM tb1)
    AND TOPICS[0] = '0x3d0ce9bfc3ed7d6862dbb28b2dea94561fe714a1b4d019aa8af39730d1ad7c3d' -- SafeReceived event
    )

    select
    day,
    chain,
    count(distinct service_address) as active_services
    from tb2
    group by 1,2
    order by 1 desc
    QueryRunArchived: QueryRun has been archived