kiacryptowhales prefer to sell or buy?
Updated 2022-10-08Copy Reference Fork
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
›
⌄
with whales as (
select distinct tx:body:messages[0]:from_address as address
from terra.core.fact_transactions
where tx:body:messages[0]:amount[0]:amount/1e6 > 500000
),
whale_sells as (
select
count(distinct tx_id) as sell_count_by_whales,
sum(tx:body:messages[0]:amount[0]:amount/1e6) as sell_volume_by_whales
from terra.core.fact_transactions
where tx:body:messages[0]:from_address in (select address from whales) and tx:body:messages[0]:amount[0]:denom = 'uluna' and tx_succeeded = TRUE
),
whale_buys as (
select
count(distinct tx_id) as buy_count_by_whales,
sum(tx:body:messages[0]:amount[0]:amount/1e6) as buy_volume_by_whales
from terra.core.fact_transactions
where tx:body:messages[0]:to_address in (select address from whales) and tx:body:messages[0]:amount[0]:denom = 'uluna' and tx_succeeded = TRUE
)
select
sell_volume_by_whales,
sell_count_by_whales,
'sell' as type
from whale_sells
union all
select
buy_volume_by_whales,
buy_count_by_whales,
'buy' as type
from whale_buys
Run a query to Download Data