KaskoazulUntitled Query
Updated 2023-01-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
›
⌄
-- SELECT *
-- FROM ethereum.core.fact_hourly_token_prices
-- WHERE hour BETWEEN '2022-01-01' AND '2022-12-31'
-- AND token_address IN ('0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', --Ethereum WETH
-- '0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0') --Ethereum MATIC
-- SELECT COUNT(DISTINCT tx_hash) FROM ethereum.core.fact_transactions WHERE DATE_TRUNC('YEAR', BLOCK_TIMESTAMP) = '2022-01-01'
-- UNION ALL
-- SELECT COUNT(DISTINCT tx_hash) FROM polygon.core.fact_transactions WHERE DATE_TRUNC('YEAR', BLOCK_TIMESTAMP) = '2022-01-01'
-- UNION ALL
-- SELECT COUNT(DISTINCT tx_hash) FROM arbitrum.core.fact_transactions WHERE DATE_TRUNC('YEAR', BLOCK_TIMESTAMP) = '2022-01-01'
-- UNION ALL
-- SELECT COUNT(DISTINCT tx_hash) FROM optimism.core.fact_transactions WHERE DATE_TRUNC('YEAR', BLOCK_TIMESTAMP) = '2022-01-01'
WITH potential_bots AS (
SELECT
from_address
, COUNT(DISTINCT tx_hash) AS txs
, CASE
WHEN txs = 1 THEN '1 TX'
WHEN txs BETWEEN 2 AND 5 THEN '2-5 TXS'
WHEN txs BETWEEN 6 AND 50 THEN '6-50 TXS'
WHEN txs BETWEEN 51 AND 240 THEN '51-240 TXS'
WHEN txs > 240 THEN '>240 TXS'
ELSE 'CUQUI'
END AS type
FROM
ethereum.core.fact_transactions
-- WHERE
-- block_timestamp BETWEEN '2022-01-01' AND '2022-12-31'
-- --DATE_TRUNC('YEAR', BLOCK_TIMESTAMP) = '2022-01-01'
GROUP BY
1
)
Run a query to Download Data