nasdfajsklj2024-05-12 01:54 PM
    Updated 2024-05-12

    with data as (
    select
    block_timestamp::date as date
    ,DATE_TRUNC('hour', block_timestamp) AS date_hour
    ,date_trunc('week', block_timestamp)::date as week
    ,'ETH' as chain
    , amount_usd
    , origin_to_address
    from ethereum.core.ez_token_transfers
    where 1=1
    and to_address = '0xc8c0e780960f954c3426a32b6ab453248d632b59'
    and block_timestamp::date > '2024-04-05'
    and origin_from_address != '0xc8c0e780960f954c3426a32b6ab453248d632b59' -- excludes our swaps, when we conver tokens to weth/usdc
    and origin_from_address = lower('0x2Dd271f63548228E9C6f440BF29DCb37b8938F13')


    UNION ALL
    select
    block_timestamp::date as date
    ,DATE_TRUNC('hour', block_timestamp) AS date_hour
    ,date_trunc('week', block_timestamp)::date as week
    ,'BASE' as chain
    , amount_usd
    , origin_to_address
    from base.core.ez_token_transfers
    where 1=1
    and to_address = '0xc8c0e780960f954c3426a32b6ab453248d632b59'
    and block_timestamp::date > '2024-04-05'
    and origin_from_address != '0xc8c0e780960f954c3426a32b6ab453248d632b59' -- excludes our swaps, when we conver tokens to weth/usdc
    and origin_from_address = lower('0x2Dd271f63548228E9C6f440BF29DCb37b8938F13')


    UNION ALL
    select
    block_timestamp::date as date
    QueryRunArchived: QueryRun has been archived