Instrument Return Oracles
Perpetual Instruments
Last Oracle Rate
// How to compute lastOracleRate, which is the key input to the
// longZCB valuations
timeDiff = block.timestamp - lastTime // time difference between
timeDivWindow = timeDiff/(TIME_WINDOW)
// If time elapsed from last record is less than the constant parameter TIME_WINDOW,
// then lastOracleRate is an interpolation between last recorded exchange rate
// and lastOracle rate
if(TIME_WINDOW>= timeDiff){
lastOracleRate = lastRate * min(timeDivWindow , 1)
+ lastOracleRate * (TIME_WINDOW - timeDivWindow)/TIME_WINDOW
}
// If time elapsed from last record is greater than the constant parameter TIME_WINDOW,
// then lastOracleRate is simply the last recorded exchange rate
else{
lastOracleRate = lastRate;
}
Fixed Instruments
Last updated