boomer77Untitled Query
    Updated 2022-02-16
    with provide as (select sender, sum(amount_usd) as provide
    from anchor.collateral
    where event_type = 'provide'
    group by 1),

    wd as (select sender, sum(amount_usd) as withdraw
    from anchor.collateral
    where event_type = 'withdraw'
    group by 1)

    select a.sender, a.provide, b.withdraw
    from provide a
    left join wd b on a.sender = b.sender

    Run a query to Download Data