barbodTotal AAVE Supplied
    Updated 2022-11-12
    with supply as (
    SELECT
    --- date_trunc('day',block_timestamp) as date,
    sum(ISSUED_TOKENS) as supply_tokens,
    sum(SUPPLIED_USD) as supply_usd
    from aave.deposits
    where SYMBOL='AAVE'
    and block_timestamp>=CURRENT_DATE-180
    ---group by 1
    ),
    withdrawal as(
    SELECT
    ---date_trunc('day',block_timestamp) as date,
    sum(WITHDRAWN_TOKENS) as withdrawal_tokens,
    sum(WITHDRAWN_USD) as withdrawal_usd
    from aave.withdraws
    where SYMBOL='AAVE'
    and block_timestamp>=CURRENT_DATE-180
    --group by 1
    )
    SELECT
    --supply.date,
    supply_tokens as aave_supplied,
    withdrawal_tokens as aave_withdrawled,
    supply_usd,
    withdrawal_usd
    from supply
    -- left
    join withdrawal
    --on supply.date=withdrawal.date
    Run a query to Download Data