maybeyonasterra_new_top_20_contracts_txs
Updated 2022-03-08
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
new_users as (
select * from (
select
value as user,
min(block_timestamp) as first_use,
count(distinct tx_id) as txs
from terra.transactions t,
lateral flatten(input => t.tx_from)
group by 1
)
where first_use > current_date - interval '90 days'
),
contract_interacts as (
select
block_timestamp,
tx_id,
msg_value:sender::string as user,
msg_value:contract::string as contract
from terra.msgs
where msg_value:sender::string is not null
and msg_value:contract::string is not null
and user in (select user from new_users)
),
protocol_names as (
select
block_timestamp,
tx_id,
user,
contract,
case when label is null
then case contract
when 'terra1angxk38zehp0k09m0wqrrxf0r3ces6qjj432l8' then 'prism' -- forge -- https://finder.extraterrestrial.money/mainnet/projects/Prism
when 'terra1fyyq65sfltsnj53jdfsf6dammdfhjnelt9eh72' then 'prism' -- vesting
when 'terra1h4al753uvwmhxwhn2dlvm9gfk0jkf52xqasmq2' then 'prism' -- gov
when 'terra1xw3h7jsmxvh6zse74e4099c6gl03fnmxpep76h' then 'prism' -- luna vault
Run a query to Download Data