cypherUntitled Query
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
›
⌄
with temp as (
select * as sum_balance
from terra.daily_balances
where balance > 0 and currency = 'LUNA'
and address in (
select
distinct(
CASE
when event_attributes:from is not null then event_attributes:from
when event_attributes:"0_borrower" is not null then event_attributes:"0_borrower"
when event_attributes:seller is not null then event_attributes:seller
when event_attributes:sender is not null then event_attributes:sender
when event_attributes:minter is not null then event_attributes:minter
when event_attributes:"0_from" is not null then event_attributes:"0_from"
when event_attributes:"0_sender" is not null then event_attributes:"0_sender"
when event_attributes:borrower is not null then event_attributes:borrower
when event_attributes:owner is not null then event_attributes:owner
when event_attributes:depositor is not null then event_attributes:depositor
when event_attributes:voter is not null then event_attributes:voter
end) as address
from terra.msg_events
where DATE_TRUNC('day',block_timestamp) >= getdate() - interval '90 days'
and msg_type = 'wasm/MsgExecuteContract' and event_type='from_contract'
and date = '2022-2-6'))
order by balance desc
limit 10
Run a query to Download Data