MLDZMNatvl
    -- forked from etvl @ https://flipsidecrypto.xyz/edit/queries/c137d795-423f-4835-ad69-d8145e028f0e

    -- forked from depbr1 @ https://flipsidecrypto.xyz/edit/queries/915f8a76-383b-454f-be6e-6e2e786e4ef9

    with t1 as ( select
    hour::date as day,
    avg(price) as avg_price
    from ethereum.core.fact_hourly_token_prices
    where symbol = 'WETH'
    group by 1),

    dep as (select
    s.block_timestamp::date as date,
    sum(ETH_VALUE*avg_price) as volume_deposit_usd
    from ethereum.core.fact_event_logs s
    left join ethereum.core.fact_transactions a on s.tx_hash=a.tx_hash
    left join t1 on s.block_timestamp::date=t1.day
    where s.CONTRACT_ADDRESS=lower('0xfb3330531E3f98671296f905cd82CC407d90CE97')
    and s.ORIGIN_FUNCTION_SIGNATURE='0x3bc1f1ed'
    --and s.tx_hash='0x4dcf1ce24a0ddef9cfa3ab5434de5af9e2e9ac8b10fb5bc34003ab918eb39037'
    group by 1
    ),

    bor as (select
    s.block_timestamp::date as date,
    sum(ETH_VALUE*avg_price) as volume_borrow_usd
    from ethereum.core.fact_event_logs s
    left join ethereum.core.fact_transactions a on s.tx_hash=a.tx_hash
    left join t1 on s.block_timestamp::date=t1.day
    where s.CONTRACT_ADDRESS=lower('0xfb3330531E3f98671296f905cd82CC407d90CE97')
    and s.ORIGIN_FUNCTION_SIGNATURE='0xfbf37739'
    group by 1)


    select
    dep.date as date,
    Run a query to Download Data