cloudr3nxSGD Deposit/Withdrawal
    Updated 2024-03-25
    -- withdrawal address 0x446ed7a8f70011db648451c668317e9c7390a7d8
    with
    polygon as (
    select
    date(block_timestamp) as day,
    case when from_address='0x446ed7a8f70011db648451c668317e9c7390a7d8' then 'Withdrawal'
    when to_address='0x446ed7a8f70011db648451c668317e9c7390a7d8' then 'Deposit'
    end as transaction_type,
    sum(amount) as total_amount,
    'polygon' as chain
    from
    polygon.core.ez_token_transfers
    where
    contract_address in (
    '0xdc3326e71d45186f113a2f448984ca0e8d201995'
    )
    and (from_address='0x446ed7a8f70011db648451c668317e9c7390a7d8' or to_address='0x446ed7a8f70011db648451c668317e9c7390a7d8')
    group by
    day,
    transaction_type
    order by
    day desc
    ),

    ethereum as (
    select
    date(block_timestamp) as day,
    case when from_address='0x446ed7a8f70011db648451c668317e9c7390a7d8' then 'Withdrawal'
    when to_address='0x446ed7a8f70011db648451c668317e9c7390a7d8' then 'Deposit'
    end as transaction_type,
    sum(amount) as total_amount,
    'ethereum' as chain
    from
    ethereum.core.ez_token_transfers
    where
    contract_address in (
    QueryRunArchived: QueryRun has been archived