adriaparcerisasTracking USDC & USDT on optimism oa m28
    Updated 2023-03-28
    WITH
    swaps_in as (
    SELECT
    trunc(block_timestamp,'day') as date,
    symbol_in as token_in,
    count(distinct origin_from_address) as n_active_swappers,
    count(distinct tx_hash) as n_swaps,
    --sum(amount_out_usd) as volume_out,
    sum(amount_in_usd) as volume
    --volume_in-volume_out as net_volume
    from optimism.core.ez_dex_swaps x
    -- join solana.dim_labels y on x.swap_to_mint=y.address
    where block_timestamp>=CURRENT_DATE-INTERVAL '1 MONTH' and
    symbol_in in ('USDC', 'USDT', 'USDH', 'UXD', 'PAI', 'DAI', 'FRAX')
    and amount_in_usd <10000000 and amount_in_usd is not null --and swap_program<>'raydium-4' --and amount_out_usd <1000000000 and amount_out_usd is not null
    group by 1,2
    order by 1 asc
    ),
    swaps_out as (
    SELECT
    trunc(block_timestamp,'day') as date,
    symbol_out as token_out,
    count(distinct origin_from_address) as n_active_swappers,
    count(distinct tx_hash) as n_swaps,
    --sum(amount_out_usd) as volume_out,
    sum(amount_in_usd) as volume
    --volume_in-volume_out as net_volume
    from optimism.core.ez_dex_swaps x
    -- join solana.dim_labels y on x.swap_to_mint=y.address
    where block_timestamp>=CURRENT_DATE-INTERVAL '1 MONTH' and
    symbol_out in ('USDC', 'USDT', 'USDH', 'UXD', 'PAI', 'DAI', 'FRAX')
    and amount_out_usd <10000000 and amount_out_usd is not null --and swap_program<>'raydium-4'
    group by 1,2
    order by 1 asc
    )
    SELECT
    Run a query to Download Data