daniel1234567QA1 — Daily Time Series, Categories
Updated 2022-12-06
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
›
⌄
/* Test Query 1 — Time Series, Daily, Categorical (12) */
with big_spendas as (
select
ORIGIN_FROM_ADDRESS as from_address,
sum(total_fees_usd) as fee_total
from ethereum.core.ez_nft_sales
where date_trunc('day',block_timestamp) > current_date - interval '90 days'
and total_fees_usd is not null
group by 1 order by 2 desc
limit 12
)
SELECT
date_trunc ('day', block_timestamp) as date,
from_address,
sum(tx_fee) as tx_fees,
sum(gas_used) as gas_used,
avg(gas_price) as gas_price,
avg(eth_value) as eth_value
FROM ethereum.core.fact_transactions
where
from_address in (select from_address from big_spendas)
and date_trunc('day',block_timestamp) > current_date - interval '365 days'
group by 1,2
-- select
-- from_address,
-- sum(gas_used) as gas_total
-- from ethereum.core.fact_transactions
-- where date_trunc('day',block_timestamp) > current_date - interval '365 days'
-- group by 1 order by 2 desc
-- limit 20
Run a query to Download Data