Moe4 xcxcxcxc
    Updated 2022-11-23
    with base as (select
    'Ethereum' as chain ,
    BLOCK_TIMESTAMP ,
    tx_hash as tx_hash,
    FROM_ADDRESS as user ,
    AMOUNT_USD as amt

    from
    ethereum.core.ez_token_transfers
    where
    SYMBOL ilike 'usdc'
    and
    BLOCK_TIMESTAMP::date >= CURRENT_DATE - {{days_back}}

    union all

    select
    'Algorand' as chain ,
    BLOCK_TIMESTAMP ,
    tx_id as tx_hash ,
    ASSET_SENDER as user ,
    amount as amt
    from
    algorand.core.ez_transfer
    where
    ASSET_NAME ilike 'usdc'
    and
    BLOCK_TIMESTAMP::date >= CURRENT_DATE - {{days_back}}
    union all

    select
    'Optimism' as chain ,
    BLOCK_TIMESTAMP ,
    tx_hash as tx_hash,
    FROM_ADDRESS as user,
    raw_amount/power(10,6) as amt
    Run a query to Download Data