nitsWhat do common user swap from/to?
Updated 2022-06-20
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 osmo_whales as
(SELECT LIQUIDITY_PROVIDER_ADDRESS from
(SELECT LIQUIDITY_PROVIDER_ADDRESS, sum(amt_net)as total_amt from
(SELECT
LIQUIDITY_PROVIDER_ADDRESS,
amount/pow(10,6) as amt ,
case when action = 'pool_joined' then amt else amt*(-1) end as amt_net
from osmosis.core.fact_liquidity_provider_actions
where currency = 'uosmo')
GROUP by 1 )
where total_amt >= pow(10,5) ),
from_whales as
(select trader from osmosis.core.fact_swaps
where from_currency = 'uosmo' and from_amount >= pow(10,11)),
to_whales as
(select trader from osmosis.core.fact_swaps
where to_currency = 'uosmo' and to_amount >= pow(10,11)),
osmo_swaps_from_whales as
(SELECT from_currency as adr , count(DISTINCT tx_id) as total_txs, 'from' as type
from osmosis.core.fact_swaps
GROUP by 1 ),
osmo_swaps_to_whales as
(SELECT to_currency as adr, count(DISTINCT tx_id) as total_txs, 'to' as type
from osmosis.core.fact_swaps
GROUP by 1 ) ,
osmo_swaps_from_ as
(SELECT date(block_timestamp) as day, count(DISTINCT tx_id) as total_txs, sum(total_txs) over (order by day) as cumulative_txs,
count(DISTINCT trader) as total_traders, 'from' as type , 'common' as typ
from osmosis.core.fact_swaps
GROUP by 1 ),
osmo_swaps_to_ as
(SELECT date(block_timestamp) as day, count(DISTINCT tx_id) as total_txs, sum(total_txs) over (order by day) as cumulative_txs,
count(DISTINCT trader) as total_traders, 'to' as type , 'common' as typ
from osmosis.core.fact_swaps
GROUP by 1 )
SELECT * from
Run a query to Download Data