Updated 2022-11-01
    with tb2 as (select
    BLOCK_TIMESTAMP,
    tx_hash,
    ORIGIN_FROM_ADDRESS,
    amount_usd,
    SYMBOL as token
    from ethereum.core.ez_token_transfers
    where origin_to_address = '0x25ace71c97b33cc4729cf772ae268934f7ab5fa1'
    and symbol in ('USDC','USDT','DAI','LUSD')
    union
    select
    BLOCK_TIMESTAMP,
    tx_hash,
    ORIGIN_FROM_ADDRESS,
    amount_usd,
    'ETH' as token
    from ethereum.core.ez_eth_transfers
    where origin_to_address = '0x25ace71c97b33cc4729cf772ae268934f7ab5fa1')


    select
    date_trunc('{{Time_basis}}',BLOCK_TIMESTAMP) as date,
    token,
    count(tx_hash) as no_sent,
    sum(amount_usd) as volume,
    avg(amount_usd) as avg_volume,
    count(distinct ORIGIN_FROM_ADDRESS) as no_users,
    no_sent/no_users as average_user,
    avg(avg_volume) OVER (partition by token ORDER BY date ROWS BETWEEN 7 PRECEDING AND CURRENT ROW) as MA_7_Days,
    sum(no_sent) over (partition by token order by date rows between unbounded preceding and current row ) as cum_bridges,
    sum(no_users) over (partition by token order by date rows between unbounded preceding and current row ) as cum_users,
    sum(volume) over (partition by token order by date rows between unbounded preceding and current row ) as cum_volume
    from tb2
    where BLOCK_TIMESTAMP>=CURRENT_DATE- {{Time_period}}
    group by 1,2

    Run a query to Download Data