adriaparcerisasRef Finance exchange on Near
Updated 2024-03-25
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
›
⌄
WITH
t1 as (
select
trunc(block_timestamp,'{{granularity}}') as date,
count(distinct tx_signer) as users
FROM near.core.fact_transactions
where tx_status = 'Success'
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 = 'v2.ref-finance.near' and tx_status = 'Success'
group by 1
)
SELECT
ifnull(t1.date,t2.date) as date,
ifnull(t1.users,0) as near_users,
ifnull(t2.users,0) as ref_users,
ref_users/near_users as share_rate
from t1
left join t2 on t1.date=t2.date
where t1.date>=CURRENT_DATE-INTERVAL '{{period}}'
order by 1 asc
QueryRunArchived: QueryRun has been archived