cloudr3n2024-03-25 09:54 PM
    Updated 2024-03-25
    -- withdrawal address 0x446ed7a8f70011db648451c668317e9c7390a7d8

    select
    date(block_timestamp) as day,
    sum(case when from_address='0x446ed7a8f70011db648451c668317e9c7390a7d8' then (-1)*amount
    when to_address='0x446ed7a8f70011db648451c668317e9c7390a7d8' then amount
    end ) net_amount,
    sum(net_amount) over (order by day asc) cumulative_flow
    from
    polygon.core.ez_token_transfers
    where
    contract_address in (
    '0xdc3326e71d45186f113a2f448984ca0e8d201995'
    )
    and (from_address='0x446ed7a8f70011db648451c668317e9c7390a7d8' or to_address='0x446ed7a8f70011db648451c668317e9c7390a7d8')
    group by
    day
    order by
    day desc
    QueryRunArchived: QueryRun has been archived