freemartianTop 10 Tokens To Swap
Updated 2022-07-19
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 undelegation as (
select
delegator_address,
min(completion_time) as osmo_receive_time
from osmosis.core.fact_staking
where action = 'undelegate'
and block_timestamp > '2022-01-01'
group by delegator_address
),
next_transactions as (
select tx_from, tx_id, block_timestamp
from osmosis.core.fact_transactions t
inner join undelegation u on u.delegator_address = t.tx_from
where t.block_timestamp > u.osmo_receive_time
),
first_move as (
select tx_from, tx_id, min(block_timestamp)
from next_transactions
group by tx_from, tx_id
),
pools as (
select count(distinct fm.tx_id) as count, POOL_IDS
from osmosis.core.fact_swaps m
inner join first_move fm on fm.tx_id = m.tx_id
where from_currency = 'uosmo'
group by POOL_IDS
order by count DESC
limit 10
)
select f.value as pool, sum(count) as tx_count
from pools, table(flatten(pools.POOL_IDS)) f
group by pool
order by tx_count DESC
Run a query to Download Data