cloudr3nWithdrawal Liquidity - xSGD
    Updated 2024-11-04
    -- address 0x446ed7a8f70011db648451c668317e9c7390a7d8
    -- check for address as holder on both polygon and ethereum
    with
    to_polygon as (
    select
    date(block_timestamp) as day,
    amount
    from
    polygon.core.ez_token_transfers
    where
    contract_address='0xdc3326e71d45186f113a2f448984ca0e8d201995'
    and to_address='0x446ed7a8f70011db648451c668317e9c7390a7d8'
    ),

    from_polygon as (
    select
    date(block_timestamp) as day,
    amount*(-1) as amount
    from
    polygon.core.ez_token_transfers
    where
    contract_address='0xdc3326e71d45186f113a2f448984ca0e8d201995'
    and from_address='0x446ed7a8f70011db648451c668317e9c7390a7d8'
    ),

    polygon_liquidity as (
    select
    day,
    sum(amount) as daily_changes,
    sum(daily_changes) over (order by day asc) total_xsgd
    from
    (
    select * from to_polygon
    union all
    select * from from_polygon
    )
    QueryRunArchived: QueryRun has been archived