kidaMultichain Active Users By Chain (timeout)
Updated 2022-12-14Copy Reference Fork
999
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
eth_vaults as (
select distinct
tx_json:to as vault_address
from ethereum.core.fact_transactions
where
from_address = lower('0xfa9da51631268a30ec3ddd1ccbf46c65fad99251')
and left(tx_json:input, 10) = '0x2ebe3fbb' -- init vault
),
eth_users as (
select
trunc(block_timestamp, 'month') as date,
'ETH' as chain,
count(distinct iff(exists (select 1 from eth_vaults where vault_address = to_address), from_address, to_address)) as active_users,
count(distinct tx_hash) as tx_count
from ethereum.core.fact_token_transfers
where exists (select 1 from eth_vaults where vault_address = to_address or vault_address = from_address)
group by date
),
bsc_vaults as (
select distinct
tx_json:to as vault_address
from bsc.core.fact_transactions
where
from_address = lower('0xfA9dA51631268A30Ec3DDd1CcBf46c65FAD99251')
and left(tx_json:input, 10) = '0x2ebe3fbb' -- init vault
),
bsc_users as (
select
trunc(block_timestamp, 'month') as date,
'BSC' as chain,
count(distinct iff(exists (select 1 from bsc_vaults where vault_address = to_address), from_address, to_address)) as active_users,
count(distinct tx_hash) as tx_count
Run a query to Download Data