headitmanagerStablecoin Dominance : Volume over time
    Updated 2022-06-26
    with addressess as (select address,project_name from osmosis.core.dim_labels where
    project_name in('axlUSDC','USDC.grv','USDT','axlDAI','DAI.grv'))

    , volume_from as (select sum(from_amount/pow(10,from_decimal)) as famount,
    case
    when project_name in('axlDAI','DAI.grv') then 'DAI'
    when project_name in('axlUSDC','USDC.grv') then 'USDC'
    else 'USDT' end stablecoin
    from osmosis.core.fact_swaps inner join addressess
    on addressess.address=osmosis.core.fact_swaps.from_currency
    group by stablecoin)
    , volume_to as (select sum(to_amount/pow(10,to_decimal)) as tamount,
    case
    when project_name in('axlDAI','DAI.grv') then 'DAI'
    when project_name in('axlUSDC','USDC.grv') then 'USDC'
    else 'USDT' end stablecoin
    from osmosis.core.fact_swaps inner join addressess
    on addressess.address=osmosis.core.fact_swaps.to_currency
    group by stablecoin)
    , volume_from_overtime as (select sum(from_amount/pow(10,from_decimal)) as famount,
    case
    when project_name in('axlDAI','DAI.grv') then 'DAI'
    when project_name in('axlUSDC','USDC.grv') then 'USDC'
    else 'USDT' end stablecoin , block_timestamp::date as d
    from osmosis.core.fact_swaps inner join addressess
    on addressess.address=osmosis.core.fact_swaps.from_currency
    group by stablecoin,d)
    , volume_to_overtime as (select sum(to_amount/pow(10,to_decimal)) as tamount,
    case
    when project_name in('axlDAI','DAI.grv') then 'DAI'
    when project_name in('axlUSDC','USDC.grv') then 'USDC'
    else 'USDT' end stablecoin, block_timestamp::date as d
    from osmosis.core.fact_swaps inner join addressess
    on addressess.address=osmosis.core.fact_swaps.to_currency
    group by stablecoin,d)

    Run a query to Download Data