kiichisushi lending
    Updated 2022-06-26
    with pa1 as (
    SELECT
    date_trunc(day,block_timestamp) as date,
    sum (amount_usd) as deposit_volume
    from ethereum.sushi.ez_lending
    where date between '2022-01-1' and '2022-06-20'
    and action='Deposit'
    group by date
    ),
    pa2 as (
    SELECT
    date_trunc(day,block_timestamp) as date,
    sum (amount_usd) as withdraw_volume
    from ethereum.sushi.ez_lending
    where date between '2022-01-1' and '2022-06-20'
    and action='Withdraw'
    group by date
    )
    SELECT
    a.deposit_volume,
    a.date,
    b.withdraw_volume
    from pa1 a
    LEFT JOIN pa2 b
    on a.date=b.date