LTirrell 2022-01-28_luna_anchor-other
    Updated 2022-02-02
    with borrows as (
    select
    date_trunc('day', block_timestamp) as datetime,
    sum(amount_usd) as total_amount,
    avg(amount_usd) as avg_amount
    from
    anchor.borrows
    -- where
    -- datetime >= '2021-11-03'
    group by
    datetime
    ),
    repay as (
    select
    date_trunc('day', block_timestamp) as datetime,
    sum(amount_usd) as total_amount,
    avg(amount_usd) as avg_amount
    from
    anchor.repay
    -- where
    -- datetime >= '2021-11-03'
    group by
    datetime
    ),
    deposits as (
    select
    date_trunc('day', block_timestamp) as datetime,
    sum(deposit_amount_usd) as total_amount,
    avg(deposit_amount_usd) as avg_amount
    from
    anchor.deposits
    -- where
    -- datetime >= '2021-11-03'
    group by
    datetime
    ),
    Run a query to Download Data