-- forked from from Assest by volume @ https://flipsidecrypto.xyz/studio/queries/4558dc29-1d5c-4e1f-b2c9-98a7c5dc1d93
select
from_asset,
count(distinct tx_id) as transaction,
sum(coalesce(from_amount_usd, to_amount_usd)) as volume_usd
from thorchain.defi.fact_swaps
where affiliate_address = 'rg'
GROUP BY from_asset
order by transaction desc
LIMIT 10;