john-adamDaily AAVE Supplied and Withdrawn
    Updated 2022-08-10
    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>='2022-01-01'
    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>='2022-01-01'
    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