ElprognerdAirdrop 1
Updated 2022-12-22Copy Reference Fork
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
›
⌄
with t1 AS (SELECT *
FROM ethereum.core.fact_event_logs
WHERE ORIGIN_TO_ADDRESS = '0x8b799381ac40b838bba4131ffb26197c432afe78'),
t_tot as(
SELECT
count (distinct tx_hash) as "Number of claims",
count (distinct origin_from_address) AS "Number of claimers",
sum(event_inputs:amount/pow(10,6)) AS "Total Claimed Volume",
avg (event_inputs:amount/pow(10,6)) AS "Average of Claimed Volume",
median (event_inputs:amount/pow(10,6)) AS "Median of Claimed Volume",
max (event_inputs:amount/pow(10,6)) AS "Maximum of Claimed Volume ",
min (event_inputs:amount/pow(10,6)) AS "Minimum of Claimed Volume"
FROM t1),
t_daily AS (
SELECT
date_trunc('day', block_timestamp) AS "Day",
count (distinct tx_hash) as "Number of claims",
count (distinct origin_from_address) AS "Number of claimers",
sum(event_inputs:amount/pow(10,6)) AS "Total Claimed Volume",
avg (event_inputs:amount/pow(10,6)) AS "Average of Claimed Volume",
median (event_inputs:amount/pow(10,6)) AS "Median of Claimed Volume",
max (event_inputs:amount/pow(10,6)) AS "Maximum of Claimed Volume ",
min (event_inputs:amount/pow(10,6)) AS "Minimum of Claimed Volume"
FROM t1
GROUP BY 1
ORDER BY 2
)
SELECT *
FROM t_tot
Run a query to Download Data