cybernewApyShort
    Updated 2021-08-26
    WITH
    AAVE as (SELECT
    block_hour,
    supply_apy,
    borrow_apy,
    supply_apy + comp_apy_supply as total_supply_apy,
    borrow_apy - comp_apy_borrow as total_borrow_apy
    FROM
    compound.market_stats
    WHERE
    contract_name = 'cAAVE'),
    BAT as (SELECT
    block_hour,
    supply_apy,
    borrow_apy,
    supply_apy + comp_apy_supply as total_supply_apy,
    borrow_apy - comp_apy_borrow as total_borrow_apy
    FROM
    compound.market_stats
    WHERE
    contract_name = 'cBAT'),
    COMP as (SELECT
    block_hour,
    supply_apy,
    borrow_apy,
    supply_apy + comp_apy_supply as total_supply_apy,
    borrow_apy - comp_apy_borrow as total_borrow_apy
    FROM
    compound.market_stats
    WHERE
    contract_name = 'cCOMP'),
    DAI as (SELECT
    block_hour,
    supply_apy,
    borrow_apy,
    supply_apy + comp_apy_supply as total_supply_apy,