# @version ^0.3.6

ORACLE: constant(address) = 0xCD5F78206ca1FF96Ff4c043C61a2299B2Febf3cB
latestPrice: public(uint128)
timestampOfLatestPrice: public(uint128)

interface IDIAOracleV2:
    def getValue(key: String[7]) -> (uint128, uint128): nonpayable

@external
def getPriceInfo(key: String[7]):
    self.latestPrice, self.timestampOfLatestPrice = IDIAOracleV2(ORACLE).getValue(key)

@view
@external
def checkPriceAge(maxTimePassed: uint128) -> bool:
    inTime: bool = False
    if (convert(block.timestamp, uint128) - self.timestampOfLatestPrice) < maxTimePassed:
        inTime = True
    else:
        inTime = False

    return inTime

Find the detailed description of the functions and how to run tests on our GitHub page