maybeyonasmeteor_ust
Updated 2021-11-17
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
30
31
32
33
34
35
36
›
⌄
with meteor_bois as (
select
msg_value:from_address::string as user,
sum(msg_value:amount[0]:amount/pow(10,6)) as ust_dep,
count(tx_id) as dep_txs
from terra.msgs
where msg_value:to_address = 'terra1dax9mddsycvzkc429wwy494vhzhggw3d5594rt'
and tx_status = 'SUCCEEDED'
group by 1
order by ust_dep desc
),
bal_before as (
select
address,
balance_usd as bal_before
-- distinct address_label_type
from terra.daily_balances
where
address_label_type is NULL and
address in (select user from meteor_bois) and
currency = 'UST' and
date = date_from_parts(2021,11,8)
),
deposits as(
select
msg_value:sender::string as sender,
sum(msg_value:coins[0]:amount / POW(10,6)) as dep_amount
from terra.msgs
where
msg_value:contract = 'terra1sepfj7s0aeg5967uxnfk4thzlerrsktkpelm5s'
and msg_value:execute_msg like '%deposit%'
and sender in (select user from meteor_bois)
and tx_status='SUCCEEDED'
group by 1
)
Run a query to Download Data