PapasotTerra
Updated 2022-03-08
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 lst_wallets_90 as (
select tx_from[0] as wallet
,min(block_timestamp)::date as min_date
from terra.transactions
group by 1
having min_date>=CURRENT_DATE-90
),
tx_ids as (
select tx_id
from terra.transactions join lst_wallets_90
on lst_wallets_90.wallet = tx_from[0]
-- where tx_status = 'true'
group by 1
),
contracts as (
select msg_value:contract::string as contract ,
BLOCK_TIMESTAMP::date as day,
count(DISTINCT m.tx_id) as tx_count
from terra.msgs m join tx_ids t
on m.tx_id = t.tx_id
where msg_value:contract::string is not NULL
group by 1,2
)
select day , label , tx_count
from contracts join terra.labels
on address = contract
where label is not NULL
Run a query to Download Data