arabianhorses-jZtVNaMAIN 2
Updated 2024-08-19
99
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
number_of_transactions AS (
SELECT
DATE_TRUNC('{{Time_Frame}}', TIMESTAMP) AS timeframe
, COUNT(DISTINCT(TX_HASH)) AS numberOfTXNs
, SUM(COUNT(DISTINCT(TX_HASH))) OVER(ORDER BY DATE_TRUNC('{{Time_Frame}}', TIMESTAMP)) AS cumulativeNumberOfTXNs
, SUM(ACTUAL_FEE/POW(10,18)) AS feeInETH
, SUM(SUM(ACTUAL_FEE/POW(10,18))) OVER(ORDER BY DATE_TRUNC('{{Time_Frame}}', TIMESTAMP)) AS cumulativeFeeInETH
, AVG(ACTUAL_FEE/POW(10,18)) AS avgFee
, COUNT(DISTINCT(CONTRACT)) AS numberOfActiveUsers
FROM external.tokenflow_starknet.decoded_transactions
WHERE CHAIN_ID = 'mainnet'
--AND TX_HASH = '0x07365305d71c57200eaf8ef5f2baafe7b567daf4f7cc99fc2e61a9fe04498c51'
GROUP BY 1
ORDER BY 1
--LIMIT 100
)
, developer_activity AS (
SELECT
DATE_TRUNC('{{Time_Frame}}', TIMESTAMP) AS timeframe
, COUNT(DISTINCT(PARAMETERS[0]:value)) AS numberOfDeployedContracts
, SUM(COUNT(DISTINCT(PARAMETERS[0]:value))) OVER(ORDER BY DATE_TRUNC('{{Time_Frame}}', TIMESTAMP)) AS CumulativeNumberOfDeployedContracts
FROM external.tokenflow_starknet.decoded_events
WHERE CHAIN_ID = 'mainnet'
AND NAME = 'ContractDeployed'
AND TX_HASH NOT IN (
SELECT
TX_HASH
FROM external.tokenflow_starknet.decoded_events
WHERE NAME IN ('AccountCreated', 'account_deployed'
, 'AccountInitialized', 'account_created', 'account_initialized')
AND CHAIN_ID = 'mainnet'
)
QueryRunArchived: QueryRun has been archived