hessTotal Domains
Updated 2023-08-14
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
›
⌄
with tx as (select DISTINCT tx_id ,
SIGNERS[0] as user ,
INNER_INSTRUCTION:instructions[0]:parsed:info:"amount"/pow(10,5) as amounts
from solana.core.fact_events
where program_id = 'TLDHkysf5pCnKsVA4gXpNvmy7psXLPEu4LAdDJthT9S'
and block_timestamp::date >= '2022-10-22'
and SUCCEEDED = 'true')
,
final as (select date(block_timestamp) as date,
case when c.value ilike '%Buying%' then REPLACE(c.value, 'Program log: Buying or extending renewable domain ')::string
when c.value like '%creating new%' then REPLACE(c.value, 'Program log: creating new domain ')::string
when c.value like '%Creating new%' then REPLACE(c.value, 'Program log: Creating new domain ')::string
when c.value like '%Program log: Claiming an expirable domain%' then REPLACE(c.value, 'Program log: Claiming an expirable domain ')::string
else c.value end as domain,
user,
c.value,
a.tx_id ,
amounts
from solana.core.fact_transactions a join tx b on a.tx_id = b.tx_id, lateral flatten(input => LOG_MESSAGES) c
where block_timestamp::date >= '2022-10-22'
and (c.value ilike '%Buying%'
or c.value ilike '%Creating new%'
or c.value ilike '%Claiming%'))
,
average as (select trunc(date,'week') as weekly,
user,
count(DISTINCT(tx_id)) as total_tx,
count(DISTINCT(domain)) as domains
from final
group by 1,2)
select
count(DISTINCT(user)) as users,
sum(total_tx) as transaction,
avg(domains) as avg_domain_per_user,
sum(domains) as domain
Run a query to Download Data