adriaparcerisassweat after ai integration
Updated 2025-03-01
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
›
⌄
WITH
t1 as (
select
trunc(block_timestamp,'day') as date,
count(distinct tx_signer) as users
FROM near.core.fact_transactions
where tx_succeeded = 'TRUE'
group by 1
),
t2 as(
SELECT
trunc(block_timestamp,'day') as date,
count(distinct tx_signer) as users
FROM near.core.fact_transactions
WHERE tx_receiver = 'token.sweat' and tx_succeeded = 'TRUE'
group by 1
)
SELECT
ifnull(t1.date,t2.date) as date,
ifnull(t1.users,0) as near_users,
ifnull(t2.users,0) as sweat_users,
sweat_users/near_users as share_rate
from t1
left join t2 on t1.date=t2.date
where t1.date>=current_date-INTERVAL '1 MONTH' and t1.date<current_date
order by 1 asc