h4wkProgram interaction
Updated 2022-10-16
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
›
⌄
with cardinal_users as (
select
distinct signers[0] as address,
-- date_trunc(day, block_timestamp) as month,
case when account_keys::string ilike '%rwdNPNPS6zNvtF6FMvaxPRjzu2eC51mXaDT9rmWsojp%' then 'Rwd'
when account_keys::string ilike '%stkBL96RZkjY5ine4TvPihGqW8UHJfch2cokjAPzV8i%' then 'Stk'
when account_keys::string ilike '%LVLYTWmTaRCV5JcZ5HQkU1bhEjx34xqGiT3eWU6SuX9%' then 'Lvl'
when account_keys::string ilike '%q1yEkaNeJ9iRXE7BJejSMkT3PF7HsaL1Eu6em9sQYCw%' then 'Quest'
when account_keys::string ilike '%mgr99QFMYByTqGPWmNqunV7vBLmWWXdSrHUfV8Jf3JM%' then 'Token Manager'
when account_keys::string ilike '%crt4Ymiqtk3M5w6JuKDT7GuZfUDiPLnhwRVqymSSBBn%' then 'Certificate'
when account_keys::string ilike '%nameXpT2PwZ2iA6DTNYTotTmiMYusBCYqwBLN2QgF4w%' then 'NameSpaces'
end as type
from solana.core.fact_transactions
where block_timestamp::date >= current_date - 14 and block_timestamp::date < current_date and succeeded = TRUE and
(account_keys::string ilike '%rwdNPNPS6zNvtF6FMvaxPRjzu2eC51mXaDT9rmWsojp%' or
account_keys::string ilike '%stkBL96RZkjY5ine4TvPihGqW8UHJfch2cokjAPzV8i%' or
account_keys::string ilike '%LVLYTWmTaRCV5JcZ5HQkU1bhEjx34xqGiT3eWU6SuX9%' or
account_keys::string ilike '%q1yEkaNeJ9iRXE7BJejSMkT3PF7HsaL1Eu6em9sQYCw%' or
account_keys::string ilike '%mgr99QFMYByTqGPWmNqunV7vBLmWWXdSrHUfV8Jf3JM%' or
account_keys::string ilike '%crt4Ymiqtk3M5w6JuKDT7GuZfUDiPLnhwRVqymSSBBn%' or
account_keys::string ilike '%nameXpT2PwZ2iA6DTNYTotTmiMYusBCYqwBLN2QgF4w%')
),
base as (
select c.address, label, type
from solana.core.fact_transactions b
join solana.core.dim_labels l on b.instructions[0]:programId = l.address
join cardinal_users c on b.signers[0] = c.address
where block_timestamp::date > CURRENT_DATE - 14 and block_timestamp::date < CURRENT_DATE
and label != 'solana'
)
select label, type, count(distinct address) as user_count
from base group by 1,2
Run a query to Download Data