majidshiri171Total number of transactions from Optimism to Ethereum
    Updated 2022-11-03
    with base as (select date_trunc('week', block_timestamp) as day,
    'ETH' as symbol,
    sum(amount_usd) as usd_volume,
    sum(amount_usd) / count(distinct(tx_hash)) as avg_volume,
    sum(usd_volume) over (partition by symbol order by day) as cumulative_usd_volume,
    avg(usd_volume) over (order by day rows between 6 preceding and current row) as ma_usd_volume,
    count(distinct(tx_hash)) as tx_count,
    sum(tx_count) over (partition by symbol order by day) as cumulative_tx_count,
    count(distinct(origin_from_address)) as wallet_count
    from ethereum.core.ez_eth_transfers
    where day >= '2022-05-02'
    and origin_to_address ilike '0x25ace71c97b33cc4729cf772ae268934f7ab5fa1'
    group by 1,2
    union
    select date_trunc('week', block_timestamp) as day,
    symbol,
    sum(amount_usd) as usd_volume,
    sum(amount_usd) / count(distinct(tx_hash)) as avg_volume,
    sum(usd_volume) over (partition by symbol order by day) as cumulative_usd_volume,
    avg(usd_volume) over (order by day rows between 6 preceding and current row) as ma_usd_volume,
    count(distinct(tx_hash)) as tx_count,
    sum(tx_count) over (partition by symbol order by day) as cumulative_tx_count,
    count(distinct(origin_from_address)) as wallet_count
    from ethereum.core.ez_token_transfers
    where day >= '2022-05-02'
    and origin_to_address ilike '0x25ace71c97b33cc4729cf772ae268934f7ab5fa1'
    and symbol in ('USDC', 'USDT', 'DAI')
    group by 1,2)

    select * from base order by 3 desc
    Run a query to Download Data