Abbas_ra21Aave Eth remove part 2
    Updated 2022-09-17
    with withdraw AS (select
    date_trunc('{{Timeframe}}', BLOCK_TIMESTAMP) AS date,
    count(*) AS events_number
    from ethereum.aave.ez_withdraws
    where SYMBOL like '%ETH%' and WITHDRAWN_TOKENS>=1000 and date between '2022-07-15' and '2022-09-15'
    group by 1),
    borrow AS (select
    date_trunc('{{Timeframe}}', BLOCK_TIMESTAMP) AS date,
    count(*) AS events_number
    from ethereum.aave.ez_borrows
    where SYMBOL like '%ETH%' and BORROWED_TOKENS>=1000 and date between '2022-07-15' and '2022-09-15'
    group by 1)
    select
    A.date AS date,
    A.events_number+B.events_number AS "events number",
    avg("events number") over (order by A.date, A.date rows between 6 preceding and current row) as "7 day events MA"
    from withdraw A inner join borrow B on A.date=B.date




    Run a query to Download Data