0xHaM-dContracts' Overview copy
Updated 2024-06-15
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
›
⌄
-- forked from Contracts' Overview @ https://flipsidecrypto.xyz/edit/queries/75590bec-febe-4b1a-91b8-d1ef92f41524
-- forked from hess / Overview of Contracts @ https://flipsidecrypto.xyz/hess/q/opKCaCur3-3w/overview-of-contracts
with contract as (
select
a.block_timestamp,
a.tx_hash,
a.origin_from_address,
tx_fee,
PROJECT_NAME,
LABEL_TYPE,
contract_address
from kaia.core.fact_event_logs a
join kaia.core.fact_transactions b on a.tx_hash = b.tx_hash
join kaia.core.dim_labels c on a.CONTRACT_ADDRESS = c.ADDRESS
WHERE LABEL_TYPE != 'token'
)
select
PROJECT_NAME,
count(DISTINCT origin_from_address) as "Users",
count(DISTINCT tx_hash) as "Transactions",
sum(tx_fee) as "Total Fees",
avg(tx_fee) as "Avg Fee",
median(tx_fee) as "Median Fee",
max(tx_fee) as "Max Fee"
from contract
group by 1
order by 3 desc
LIMIT 5
QueryRunArchived: QueryRun has been archived