CryptoLionbrians2
    Updated 2021-05-18
    SELECT
    DATE_TRUNC('day',block_hour) as day,
    underlying_symbol,
    AVG(supply_apy) as day_supply_apy,
    AVG(comp_apy_supply) as day_comp_apy_s,
    day_supply_apy+day_comp_apy_s as net_supply_apy,
    AVG(borrow_apy) as day_borrow_apy,
    AVG(comp_apy_borrow) as day_comp_apy_b,
    day_supply_apy+day_comp_apy_b as net_borrow_apy
    FROM compound.market_stats
    WHERE
    DATE_TRUNC('day',block_hour) >= getdate() - interval '45 days'
    AND underlying_symbol <> 'SAI'
    GROUP BY day, underlying_symbol
    ORDER BY day
    Run a query to Download Data