Updated 2022-03-26
    with inflow as (
    SELECT SYMBOL , sum(AMOUNT_USD) as inpu , sum(amount) as inpu_num
    from polygon.udm_events
    where to_address = '0x0319000133d3ada02600f0875d2cf03d442c3367'
    and from_address <> '0x0319000133d3ada02600f0875d2cf03d442c3367'
    and event_type = 'erc20_transfer'
    and symbol is not null
    group by 1
    ) ,

    outflow as (
    SELECT SYMBOL , sum(AMOUNT_USD) as outpu , sum(amount) as outpu_num
    from polygon.udm_events
    where from_address = '0x0319000133d3ada02600f0875d2cf03d442c3367'
    and to_address <> '0x0319000133d3ada02600f0875d2cf03d442c3367'
    and event_type = 'erc20_transfer'
    and symbol is not null


    group by 1
    )


    SELECT o.SYMBOL as locked_token , inpu-outpu as amount_usd , inpu_num , outpu_num
    ,inpu_num-outpu_num
    from inflow I , outflow o
    where O.symbol= I.Symbol
    order by 2 DESC



    Run a query to Download Data