CryptoLionStableCoin APY spread
    Updated 2023-03-26
    SELECT
    date_trunc('day',block_hour) as day,
    contract_name,
    -avg(borrow_apy) as borrow_apy,
    avg(-borrow_apy + comp_apy_borrow) as net_borrow_apy,
    avg(supply_apy) as supply_apy,
    avg(supply_apy + comp_apy_supply) as net_supply_apy
    FROM compound.market_stats
    WHERE block_hour >= getdate() - interval '60 days'
    AND
    (contract_name = 'cUSDC'
    OR contract_name = 'cUSDT'
    OR contract_name = 'cDAI')
    GROUP BY DAY,contract_name
    ORDER BY DAY
    Run a query to Download Data