MLDZMNETH.USDC1
    Updated 2022-11-24
    --with tb1 as (select
    --HOUR::date as day,
    --price
    --from ethereum.core.fact_hourly_token_prices
    --)
    select
    'Ethereum' as chain,
    count(distinct tx_hash) as no_transfers,
    count(distinct from_address ) as no_senders,
    count(distinct to_address ) as no_receivers,
    sum(RAW_AMOUNT/1e6) as volume_usd,
    avg(RAW_AMOUNT/1e6) as avg_volume,
    median(RAW_AMOUNT/1e6) as median_volume,
    no_senders/count(distinct date_trunc(day, block_timestamp)) as average_sender_day,
    volume_usd/count(distinct date_trunc(day, block_timestamp)) as average_volume_day,
    volume_usd/count(distinct BLOCK_NUMBER) as average_volume_block
    from ethereum.core.ez_token_transfers
    where SYMBOL='USDC'
    and contract_address = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
    and from_address != '0x0000000000000000000000000000000000000000'
    and to_address != '0x0000000000000000000000000000000000000000'
    and raw_amount::float > 0
    and BLOCK_TIMESTAMP>=CURRENT_DATE- {{Time_period}}
    union all
    select
    'Optimism' as chain,
    count(distinct tx_hash) as no_transfers,
    count(distinct from_address ) as no_senders,
    count(distinct to_address ) as no_receivers,
    sum(RAW_AMOUNT/1e6) as volume_usd,
    avg(RAW_AMOUNT/1e6) as avg_volume,
    median(RAW_AMOUNT/1e6) as median_volume,
    no_senders/count(distinct date_trunc(day, block_timestamp)) as average_sender_day,
    Run a query to Download Data