Updated 2022-08-02
    with has_amount_usd as (
    select
    block_timestamp::date as days,
    sum(amount_usd) as total_fee
    from polygon.udm_events
    where event_type = 'erc20_transfer'
    and event_name = 'transfer'
    and from_address = '0xf715beb51ec8f63317d66f491e37e7bb048fcc2d'
    and to_address = '0x5b3256965e7c3cf26e11fcaf296dfc8807c01073'
    and amount_usd is not null
    group by days
    order by days
    ),
    stable_coin_amount_usd as (
    select
    block_timestamp::date as days,
    sum(amount) as total_fee
    from polygon.udm_events
    where event_type = 'erc20_transfer'
    and event_name = 'transfer'
    and from_address = '0xf715beb51ec8f63317d66f491e37e7bb048fcc2d'
    and to_address = '0x5b3256965e7c3cf26e11fcaf296dfc8807c01073'
    and amount_usd is null
    and amount is not null
    and contract_address in ('0x8f3cf7ad23cd3cadbd9735aff958023239c6a063', '0x2791bca1f2de4661ed88a30c99a7a9449aa84174')
    group by days
    order by days
    ),
    without_amount_usd_list as (
    select
    block_timestamp,
    amount,
    case
    when contract_address = '0x70c006878a5a50ed185ac4c87d837633923de296' then 'REVV'
    when contract_address = '0x7ceb23fd6bc0add59e62ac25578270cff1b9f619' then 'WETH'
    end as symbols
    Run a query to Download Data