binhachonStablecoin Swappers
    Updated 2022-07-04
    select
    date_trunc('week', block_timestamp) as time,
    case when pool_name = 'BNB.BUSD-BD1' then 'BUSD' else 'USDC' end as asset,
    sum(from_amount_usd + to_amount_usd) / 2 as volume,
    count(*) as number_of_swaps,
    avg(from_amount_usd + to_amount_usd) / 2 as swap_size
    from thorchain.swaps
    where pool_name in ('BNB.BUSD-BD1', 'ETH.USDC-0XA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48')
    and time >= getdate() - interval'6 months'
    group by 1, 2
    Run a query to Download Data