jamesidDaily Active Autonomous Services copy
Updated 2024-10-24
999
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
WITH daily_transactions AS (
SELECT
DATE_TRUNC('day', BLOCK_TIMESTAMP) AS day,
MULTISIG_ADDRESS AS service_multisig_address,
BLOCKCHAIN AS chain
FROM
crosschain.olas.fact_service_events
WHERE
BLOCK_TIMESTAMP >= '2023-05-08' -- 'Add your desired start date here'
AND BLOCKCHAIN IN ('ethereum', 'polygon', 'gnosis', 'solana', 'arbitrum', 'optimism', 'base', 'celo')
),
daily_active_multisig AS (
SELECT
day,
chain,
COUNT(DISTINCT service_multisig_address) AS active_multisigs
FROM
daily_transactions
GROUP BY
day,
chain
),
-- Pivot table to have separate columns for each chain
pivoted_daily_active_multisig AS (
SELECT
day,
COALESCE(
MAX(
CASE WHEN chain = 'ethereum' THEN active_multisigs END
), 0
) AS ethereum_active_multisigs,
COALESCE(
MAX(
CASE WHEN chain = 'polygon' THEN active_multisigs END
), 0
) AS polygon_active_multisigs,
QueryRunArchived: QueryRun has been archived