adriaparcerisasgroundhog 5
    Updated 2023-01-18
    with
    t1 as (
    select trunc(block_timestamp,'day') as date,
    sum(amount_usd) as volume_transferred
    from ethereum.core.ez_eth_transfers
    where block_timestamp>=current_date - 365 and amount_usd<1e9
    group by 1
    ),
    eth_price as (
    select
    trunc(hour,'day') as date,
    avg(price) as eth_price,
    LAG(eth_price,1) IGNORE NULLS OVER (ORDER BY date) as last_price,
    ((eth_price-last_price)/eth_price)*100 as eth_price_change
    from ethereum.core.fact_hourly_token_prices where symbol='WETH' and hour>=current_date - 365
    group by 1
    ),
    t12 as (
    select trunc(block_timestamp,'day') as date,
    sum(amount_usd) as volume_transferred
    from bsc.core.ez_bnb_transfers
    where block_timestamp>=current_date - 365 and amount_usd<1e9
    group by 1
    ),
    bnb_price as (
    select
    trunc(hour,'day') as date,
    avg(price) as bnb_price,
    LAG(bnb_price,1) IGNORE NULLS OVER (ORDER BY date) as last_price,
    ((bnb_price-last_price)/bnb_price)*100 as bnb_price_change
    from ethereum.core.fact_hourly_token_prices where token_address=lower('0x418D75f65a02b3D53B2418FB8E1fe493759c7605') and hour>=CURRENT_DATE-365
    group by 1
    ),
    t13 as (
    select trunc(block_timestamp,'day') as date,
    sum(amount_usd) as volume_transferred
    Run a query to Download Data