with
from_transactions as
(
select label, count(tx_id) as from_tx
from osmosis.core.fact_swaps join osmosis.core.dim_labels on fact_swaps.from_currency = dim_labels.address
where date(block_timestamp) >= '2022-05-01'
group by label
),
to_transactions as
(
select label, count(tx_id) as to_tx
from osmosis.core.fact_swaps join osmosis.core.dim_labels on fact_swaps.to_currency = dim_labels.address
where date(block_timestamp) >= '2022-05-01'
group by label
)
select to_transactions.label, from_tx + to_tx as txs
from from_transactions full outer join to_transactions on from_transactions.label = to_transactions.label
where txs is not null
order by txs desc
limit 10