chakhailstoneCurrent cosmos daily
Updated 2023-03-15Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
›
⌄
WITH
cos_uniadd_tb AS (SELECT COUNT(DISTINCT TX_FROM) AS unique_address FROM cosmos.core.fact_transactions),
tb AS (
SELECT
DATE_TRUNC('day', BLOCK_TIMESTAMP) AS dt,
'cosmos' AS name,
COUNT(*) AS tx,
COUNT(DISTINCT TX_FROM) AS dau,
AVG(GAS_USED) AS avg_gas_price,
AVG(unique_address) AS unique_address,
NULL AS contracts_deployed
FROM cosmos.core.fact_transactions OUTER JOIN cos_uniadd_tb
WHERE DATE(BLOCK_TIMESTAMP) = CURRENT_DATE - 1 AND TX_SUCCEEDED = TRUE
GROUP BY dt
)
SELECT * FROM tb ORDER BY name, dt
Run a query to Download Data